개발자's Life

Spring 용어 정리 - (강의_FCS_01) 본문

Back-end/Spring

Spring 용어 정리 - (강의_FCS_01)

Rowen Jobs 2023. 2. 6. 21:41
728x90
반응형

패스트 캠퍼스 초격차 패키지 강의

개발 환경

- Java

- JPA

- Intelli J (Ultimate Ver)

- Gradle

- Spring

- Github

- GitKraken

- junit5

- 의존성


    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-data-rest'
    implementation 'org.springframework.data:spring-data-rest-hal-explorer'
    implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
    implementation 'org.springframework.boot:spring-boot-starter-security'
    implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
    runtimeOnly 'com.h2database:h2'
    runtimeOnly 'com.mysql:mysql-connector-j'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
    developmentOnly 'org.springframework.boot:spring-boot-devtools'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'org.springframework.boot:spring-boot-starter-test'

(공부하면서 정리하는거라 틀린 정보가 있으면 댓글 부탁드립니다~)

 

1. @DisplayName :  테스트 코드를 작성할 때 사용하였고 해당 클래스 or 메소드에 대한 테스트의 설명을 첨가하여 사용하여 테스트 진행 시 가독성과 분류하기 좋다. 

 

2. @WebMvcTest(controller.class) : MVC 를 위한 테스트이며 테스트하기 힘든 Controller 를 테스트하기 유용하고 특정 빈만 가지고 와서 테스트 하여 가볍게 테스트를 할 수 있다.

 

3. @Mock : 실제 Bean 을 사용하지 않고 Mock 이라는 가상의 객체를 만들어 테스트를 진행.

 

4. @RequestParam : 단일 HTTP 요청 파라미터의 값을 메소드 파라미터에 넣어준느 어노테이션이고 해당 파라미터가 반드시 존재해야 한다. 필수가 아닐 경우에는 required 를 false로 설정(@RequestParam(required = false) ) 

5. @PageableDefault : Pageable 파라미터를 받을 수 있고 내부에는 size, sort, direction.. 이 있다. 
@PageableDefault(size = 10, sort = "createdDate"..)

 

728x90

'Back-end > Spring' 카테고리의 다른 글

[SPRING] @Configuration, @Bean 간략 설명  (0) 2023.05.29
[Spring] AOP 를 쉽게 이해하자!  (0) 2023.05.14
Comments