분류 전체보기
-
-
-
-
-
@Profile 대신 @ConditionalOnProperty 을 사용하라BackEnd/스프링 2022. 8. 3. 14:34
@Profile("local") 와 같은 사용은 코드가 string 으로 정의한 Profile 에 의존하게 하며, 여기저기 퍼진 Profile 정의는 1. String 정의가 변경이 됐을 때 텍스트로 코드 전체 검색을 통해 수정을 해야한다. 2. 특정 환경에서 애플리케이션이 어떤 코드로 동작하는지 파악하기 어렵다. 3. test, h2, prod 등 여러 환경과 활성화시킬 데이터 베이스 등이 Profile로 정의되면 특정 profile 활성화, 비활성화 여부나 멀티 profile 활성화 시에 애플리케이션의 동작방식을 파악하기 어렵다. 4. @Profile("!test") 같은 코드까지 섞여있다면 더 파악하기 어려워질 수 있다. 그래서 Profile 대신에 application-{profile}.yml/p..
-
-
ControllerTest - Pageable, SearchDTOBackEnd/스프링 2022. 8. 2. 16:21
응답데이터 { "content": [ { "id": 1, "title": "welcome", "content": "hello world", "categoryName": "spring", "email": "seung90@gmail.com", "viewCount": 3 } ], "pageable": { "sort": { "unsorted": true, "sorted": false, "empty": true }, "pageNumber": 0, "pageSize": 20, "offset": 0, "paged": true, "unpaged": false }, "totalPages": 1, "totalElements": 1, "last": true, "numberOfElements": 1, "first": true..
-