The Spring Framework provides the following set of Spring-specific annotations that you can use in your unit and integration tests in conjunction with the TestContext framework. See the corresponding javadoc for further information, including default attribute values, attribute aliases, and other details.
스프링 프레임워크는 다음와 같은 스프링 특화 어노테이션을 제공한다. 이 어노테이션들은 유닛테스트 혹은 통합테스트를 할때 테스트 프레임워크(TestContext framework)와의 연결을 위해서 사용된다. 디폴트값, 속성, 등 더많은 정보를 위해서는 대응되는 javadoc을 보도록 하라.
Spring’s testing annotations include the following:
@BootstrapWithis a class-level annotation that you can use to configure how the Spring TestContext Framework is bootstrapped. Specifically, you can use@BootstrapWithto specify a customTestContextBootstrapper. See the section onbootstrapping the TestContext frameworkfor further details.
@BootstrapWith는 클래스 레벨 어노테이션이다. 어떻게 스프링 테스트 프레이워크가 부트스트랩 되는지를 정의한다. 특히, @BootstrapWith를 사용하면 커스텀 테스트 컨텍스트 부트스트랩퍼를 지정할 수 있다. 더 많은 정보를 위해서 bootstrapping the TestContext framework 를 참조하도록 하라.
@ContextConfiguration
@ContextConfigurationdefines class-level metadata that is used to determine how to load and configure anApplicationContextfor integration tests. Specifically,@ContextConfigurationdeclares the application context resourcelocationsor the componentclassesused to load the context.
@ContextConfiguration은 클래스 레벨 메타데이터를 정의한다. 메타데이터는 통합 테스트를 위한 어플리케이션 컨텍스트를 어떻게 구성 하고, 로드 하는지를 정의한다. 특히, @ContextConfiguration은 어플리케이션 컨텍스트 리소스의 위치(location) 혹은 컨텍스트를 로드할때 사용되는 클래스의 컴포넌트를 선언한다.
@WebAppConfiguration
@WebAppConfigurationis a class-level annotation that you can use to declare that theApplicationContextloaded for an integration test should be aWebApplicationContext. The mere presence of@WebAppConfigurationon a test class ensures that aWebApplicationContextis loaded for the test, using the default value of"file:src/main/webapp"for the path to the root of the web application (that is, the resource base path). The resource base path is used behind the scenes to create aMockServletContext, which serves as theServletContextfor the test’sWebApplicationContext.
@WebAppConfiguration은 클래스 레벨 어노테이션이다. @WebAppConfiguration은 통합 테스트를 위한 어플리케이션 컨텍스트가 WebApplicationContext여야 하는 경우 사용된다. @WebAppConfiguration가 사용되는 유일한 이유는 테스트를 할때WebApplicationContext가 로드되었다는것을 보장해주고, 웹 어플리케이션의 루트 패스인 "file:src/main/webapp"를 디폴트 값으로 사용하는것을 보장하는 것이다. 리소스의 베이스 패스는 Mock서블렛 컨텍스트를 생성하기위해서 사용되며 Mock서블렛 컨텍스트는 WebApplicationContext의 테스트에 사용되는 서블렛 컨텍스트 역할을 수행한다.
@ContextHierarchy
@ContextHierarchyis a class-level annotation that is used to define a hierarchy ofApplicationContextinstances for integration tests.@ContextHierarchyshould be declared with a list of one or more@ContextConfigurationinstances, each of which defines a level in the context hierarchy.
@ContextHierachy는 클래스레벨 어노테이션이다. @ContextHierarchy는 통합 테스트시 어플리케이션 컨텍스트의 인스턴스의 계층을 정의하기위해 사용된다. @ContextHierachy는 하나 이상의 @ContextConfiguration인스턴스와 함께 정의 되어야한다. 이때 사용되는 각 @ContextConfiguration가 컨텍스트 계층 레벨을 정의한다.
@ActiveProfiles
@ActiveProfilesis a class-level annotation that is used to declare which bean definition profiles should be active when loading anApplicationContextfor an integration test.
@ActiveProfiles는 클래스 레벨 어노테이션이다. @ActiveProfiles는 통합 테스트시 어플리케이션 컨텍스를 로딩할때 어떤 빈 정의 프로파일이 활성화 되어야하는지를 정의한다.
@TestPropertySource
@TestPropertySourceis a class-level annotation that you can use to configure the locations of properties files and inlined properties to be added to the set ofPropertySourcesin theEnvironmentfor anApplicationContextloaded for an integration test.
오늘은 조금 늦잠을 자고 일어났다. 일어나서 평소와 같이 걷고오고, 밥도 먹고 작업도 했다. 어제는 새로운 의자가 와서 조립을 했는데 두개중에 하나의 의자가 쇠 부분이 녹슨게 와서 교환 요청을 보냈다.
의자 하나가 내일 도착할 예정이니 일단 기존에 사용하던 의자를 당근에 올렸다. 그런데 올리고 얼마 안되서 구매하겠다는 연락이 왔다. 당장 오늘 사간다고한다. 사실 올려두고 하루 이틀정도 지난 후에 판매될거라는 생각에 올려둔건데 바로 팔려버려서 좀 당황스러웠다. 어차피 내일이 되면 새로운 의자가 올 예정이니 기쁜 마음으로 팔아버렸다.
의자를 판매하고 난 다음엔 의자가 없어서 그냥 좀 쉬었다. 쉬다가 쿠팡에서 구매한 hdmi to dvi 케이블이 왔는데 작동을 안한다. 컴퓨터 두대다 동작이 안된다. 모니터는 멀쩡한데 랩탑에서 신호를 못보내는걸 보니 케이블이 고장인것으로 판단됐다. 바로 반품신청을했다. 별다른 절차 없이 반품을 하게 해주는 쿠팡이 이럴때 참 좋다. 이 케이블이 저렴하긴 했지만, 교환 했다가 또 안되는게 올까봐 이번엔 usb3.1 c to DP 케이블을 주문했다. 두배정도 비싸다.
그리고 오늘은 이마트에 주문을 했다. 4만원 이상 구매해야 무료 배송인게 좀 거시기 하긴했는데 그래도 멀리까지 걸어갔다 올 필요가 없으니 좋았다. 무료 배송 조건에 60원이 부족한지 모르고 결재를 했다가 뒤늦게 깨닫고 취소를했다. UX를 좀 신경써서 배송비보다 무료배송 까지 남은 가격이 더 적으면 얼럿을 한번 띄워주면 어떨까 하는 생각을 했다.
저녘엔 6천원 할인하는 BBQ를 먹었다. 황올치는 역시 맛있긴한데 너무 비싸다 치킨값이 19천원이라니. 돈 많이 벌어서 치킨 많이 사먹어야겠다.