// fixture-monkey
    testImplementation('com.navercorp.fixturemonkey:fixture-monkey-starter:0.5.2')
    testImplementation('com.navercorp.fixturemonkey:fixture-monkey-javax-validation:0.5.2')
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jackson:0.5.2")
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-jakarta-validation:0.5.2")
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-junit-jupiter:0.5.2")
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-autoparams:0.5.2")
    testImplementation("com.navercorp.fixturemonkey:fixture-monkey-engine:0.5.2")
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # profile 값에 따른 소스파일 변경 설정. profile 값이 없을 경우 local 이 default 입니다. | |
| ext.profile = (!project.hasProperty(‘profile’) || !profile) ? ‘local’ : profile | |
| # resource-env/local, resource-env/dev 와 같이 폴더를 설정해서 해당 파일을 bootJar 을 통해 묶습니다. 아래와 같이 설정한다면 별도 application.yml 을 적용시킬 수 있습니다. | |
| sourceSets { | |
| main { | |
| resources { | |
| srcDirs “src/main/resources”, “src/main/resources-env/${profile}” | |
| } | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // UserRepositoryTest.java | |
| @DataJpaTest | |
| @Import(TestMySQLContainer::class, DataSourceConfig::class) | |
| class UserRepositoryTest { | |
| // lateinit 이 변수가 나중에 초기화될 것이며, 선언할 때 즉시 초기화할 필요가 없다는 것을 의미 | |
| @Autowired | |
| private lateinit var userRepository: UserRepository | |
| @Test | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class HamBurgerTest { | |
| @Test | |
| void testCalulateCalories() { | |
| final HamBurger hamBurger = HamBurger.from( | |
| List.of( | |
| new Patty(200), | |
| new Lettuce(50) | |
| ) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | public class StaticFactoryMethodTest { | |
| private static final String DEFAULT_ID = "10"; | |
| private static final String DEFAULT_NAME = "test"; | |
| /** | |
| * from : 매개 변수를 하나 받아서 해당 타입의 인스턴스를 반환하는 method 명명 규칙입니다. | |
| */ | |
| @Test | |
| @DisplayName("정적팩토리메서드 from 테스트") | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class MapSortTest { | |
| @Test | |
| @DisplayName("String type value 로 map sort") | |
| void testMapSortStringValueTest() { | |
| final Map<Integer, String> map = Map.of( | |
| 10, "abc", | |
| 5, "def", | |
| 2, "adef" | |
| ); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // ItemInfoMapper.java | |
| @Mapper( | |
| componentModel = "spring", | |
| injectionStrategy = InjectionStrategy.CONSTRUCTOR, | |
| unmappedTargetPolicy = ReportingPolicy.ERROR | |
| ) | |
| public interface ItemInfoMapper { | |
| ItemInfoMapper INSTANCE = Mappers.getMapper(ItemInfoMapper.class); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // build.gradle | |
| implementation 'org.springframework.boot:spring-boot-starter-validation' | |
| // ItemConstraint.java | |
| @Documented | |
| @Retention(RUNTIME) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // enum | |
| public enum MemberTypeEnum { | |
| BRONZE, SILVER, GOLD | |
| } | |
| // test source | |
| public class MemberTypeEnumTest { | |
| private static Map<MemberTypeEnum, Supplier<String>> enumMap; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // build.gradle | |
| implementation 'org.springframework.boot:spring-boot-starter-validation' | |
| // controller | |
| @Slf4j | |
| @RestController | |
| @RequiredArgsConstructor | 
NewerOlder