Spring Boot Cheatsheet
Spring Boot Cheatsheet
Essentials
application.properties
application.yml
Configuration Test
Start application with Uses JUnit, includes Mockito, Hamcrest and more
throws Exception {
SpringApplication.run(CommentStoreApp.class, args); @DataJpaTest : Marks as a Spring Data JPA test and only auto-configures that part
}
}
@WebMvcTest : Marks as a Spring MVC test and only auto-configures that part
use in test
@ComponentScan : Scans classpath for Spring Components and auto registers them
logging.path : if file is not absolute, path where the logfile is stored Endpoints available under / or /application (Spring Boot 2) Change path with
management.context-path
logging.level.root
property
: set log level for application; replace root with your package to fine
codeboje.de