Spring Boot In Action Access
@SpringBootTest @AutoConfigureMockMvc class BookControllerTest @Autowired private MockMvc mockMvc;
@Entity @Data @NoArgsConstructor public class Book @Id @GeneratedValue private Long id; private String title; private String author; Spring Boot In Action
@Service @RequiredArgsConstructor public class BookService private final BookRepository bookRepo; public Book saveBook(Book book) return bookRepo.save(book); private String title
Add dependency:
management.endpoints.web.exposure.include=health,info,metrics Build a fat JAR: private String author
./mvnw package