본문 바로가기

전체 글

(291)
[Spring Security] Handle Spring Security Exceptions https://www.baeldung.com/spring-security-exceptions Spring Security는 비즈니스 로직에 대한 호출을 제어하거나 특정 URL에 대한 HTTP 요청 액세스를 제한한다 해당 보안 계층에서 Exceptions 처리가 어떻게 진행되는지 알아보자 Authentication Success Handler Authentication Failure Handler Access Denied Handler Security Configuration This will be in charge of managing all the security configurations of the application SecurityFilterChain @Bean public SecurityFil..
[mariaDB] Spring + mariaDB 연동 더보기 https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' application.properties spring.datasource.driver-class-name=org.mariadb.jdbc.Driver spring.datasource.url=jdbc:mariadb://localhost:3306/DB명 spring.datasource.username=userName spring.datasource.password=password #update the schema with the given values. spring.jpa.hiberna..
[Spring] HandlerAdapters in Spring MVC https://www.baeldung.com/spring-mvc-handler-adapters on the various handler adapters implementations available in the Spring framework. HandlerAdapter는 Spring MVC에 유연한 방식으로 HTTP 요청 처리를 용이하게 할 수 있는 interface이다 메소드를 특정 URL에 매핑하는 HandlerMapping과 함께 사용한다 DispatcherServlet은 HandlerAdapter를 사용하여 이 메소드를 호출한다. Servlet이 메소드를 직접 호출하는게 아니다. 기본적으로 자신과 핸들러 객체 사이의 bridge 역할로 느슨한 결합(loosely coupling) 설계이다. pub..
[JPA] 강의 들으면서 쫌쫌따리 더보기 https://youtu.be/1Q3Qtd5HZy4?list=PLwouWTPuIjUgRvSmAVlZekcyAo4zkf_TK Spring Boot + Spring Data JPA 자동설정 persistence.xml, EntityManagerFactory 스프링연동 스프링 트랜잭션 연동 EntityManager 연동 spring-boot-starter-data-jpa Repository interface를 엔티티 단위로 생성 필요한 곳에 주입해서 사용하면 된다 datasource, database 등에 대한 설정값 입력 스프링 부트에 따라 설정이 달라지니 문서를 보고 설정해주어야한다.
[Spring Test] JUnit 5 Conditional Test Execution with Annotations https://www.baeldung.com/junit-5-conditional-test-execution 조건부 테스트 적용 방법 Operating System Conditions 경우에 따라 OS(운영체제)에 따른 테스트 시나리오를 변경해야할 경우가 있다 @EnabledOnOs 애노테이션을 붙이고 값을 제공하면 된다. 배열 인수도 가능하다. @Test @EnabledOnOs({OS.WINDOWS, OS.MAC}) public void shouldRunBothWindowsAndMac() { //... } @DisabledOnOs는 이름에서 알 수 있듯이 OS 유형 인수에 따라 테스트를 비활성화한다. @Test @DisabledOnOs(OS.LINUX) public void shouldNotRunAtLi..
[Spring Test] Guide to JUnit 5 Parameterized Tests https://www.baeldung.com/parameterized-tests-junit-5 Guide to JUnit 5 Parameterized Tests | Baeldung Learn how to simplify test coverage in JUnit 5 with parameterized tests www.baeldung.com JUnit5 는 여러 유용한 기능으로 테스트를 쉽게 할 수 있게 한다 특히 Parameterized 된 테스트를 이용하면, 다른 매개변수를 사용하여 단일 테스트를 여러번 실행할 수 있어 유용하다 https://junit.org/junit5/docs/current/user-guide/#running-tests-ide-eclipse JUnit 5 User Guide Alth..
[Spring Test] Testing in Spring Boot https://www.baeldung.com/spring-boot-testing Testing in Spring Boot | Baeldung Learn about how the Spring Boot supports testing, to write unit tests efficiently. www.baeldung.com a typical tiered architecture — the API call is processed from the Controller to Service to the Persistence layer Test Configuration With @TestConfiguration a test annotated with @SpringBootTest will bootstrap the full ..
[Spring Test] Test a REST API with Java https://www.baeldung.com/integration-testing-a-rest-api focus on the basic principles and mechanics of testing a REST API with live Integration Tests (with a JSON payload). When testing a REST resource, there are usually a few orthogonal responsibilities the tests should focus on: the HTTP response code other HTTP headers in the response the payload (JSON, XML) 각 테스트는 단일 책임에 포커스를 두고 단일 assertion..

728x90