Morrie&Me | Tuesdays with Morrie
This book is the final thesis Mitch Albom writes for his old professor Morrie Schwartz. This last class Morrie teaches, discusses ‘the Meaning of life’. For this class no books are needed, the lessons are taught from experience. The class meets on Tuesdays.
life lessons, Morrie, Morrie Schwartz, Mitch Albom, Tuesdays with Morrie, book, book review, review, Morrie&Me
22752
wp-singular,post-template-default,single,single-post,postid-22752,single-format-standard,wp-theme-stockholm,qode-social-login-1.0,qode-restaurant-1.0,ajax_updown_fade,page_not_loaded,,select-theme-ver-4.1,smooth_scroll,wpb-js-composer js-comp-ver-5.1.1,vc_responsive

Boot In Action: Spring

@Service @RequiredArgsConstructor public class BookService private final BookRepository bookRepo; public Book saveBook(Book book) return bookRepo.save(book);

@Entity @Data @NoArgsConstructor public class Book @Id @GeneratedValue private Long id; private String title; private String author;

@SpringBootTest @AutoConfigureMockMvc class BookControllerTest @Autowired private MockMvc mockMvc; Spring Boot In Action

./mvnw package

Add dependency:

@Test void shouldCreateBook() throws Exception mockMvc.perform(post("/api/books") .contentType(MediaType.APPLICATION_JSON) .content("\"title\":\"Spring Boot in Action\",\"author\":\"Craig Walls\"")) .andExpect(status().isOk());

management.endpoints.web.exposure.include=health,info,metrics Build a fat JAR: public Book saveBook(Book book) return bookRepo.save(book)

java -jar target/myapp-0.0.1-SNAPSHOT.jar