@Test public void deleting_a_unknown_guest_results_in_false() { assertThat(guestService.deleteGuest(randomUUID().toString())).isFalse(); }
public boolean deleteGuest(@NotNull String publicId) { return findByPublicId(publicId).flatMap( g -> { em.remove(g); return of(TRUE); }).orElse(false); }
GuestService { public boolean deleteGuest(@NotNull String publicId) { return findByPublicId(publicId).flatMap( g -> { em.remove(g); return of(TRUE); }).orElse(false); } }
GuestService { public boolean deleteGuest(@NotNull String publicId) { return findByPublicId(publicId).flatMap( g -> { em.remove(g); return of(TRUE); }).orElse(false); } GuestService(); @Inject  GuestService(@Background Event<Guest> guestEvents); }
GuestService { public boolean deleteGuest(@NotNull String publicId) { return findByPublicId(publicId).flatMap( g -> { em.remove(g); return of(TRUE); }).orElse(false); } GuestService(); @Inject  GuestService(@Background Event<Guest> guestEvents); void setEntityManager(EntityManager em); void saveGuest(Guest guest); Guest findSingleGuestById(@PathParam("guestId") Long guestId); List<Guest> getAllGuests(); Optional<Guest> findById(@PathParam("guestId") Long guestId); Optional<Guest> updateGuestDetails(Guest guest); Optional<Guest> findByPublicId(String publicId); boolean deleteGuest(@NotNull String publicId); }
GuestService { public boolean deleteGuest(@NotNull String publicId) { return findByPublicId(publicId).flatMap( g -> { em.remove(g); return of(TRUE); }).orElse(false); } GuestService(); @Inject  GuestService(@Background Event<Guest> guestEvents); void setEntityManager(EntityManager em); void saveGuest(Guest guest); Guest findSingleGuestById(@PathParam("guestId") Long guestId); List<Guest> getAllGuests(); Optional<Guest> findById(@PathParam("guestId") Long guestId); Optional<Guest> updateGuestDetails(Guest guest); Optional<Guest> findByPublicId(String publicId); boolean deleteGuest(@NotNull String publicId);  }