### Question:
Registrations { public JsonObject register(Registration request) { tracer.info("registration arrived: " + request); Registration registration = em.merge(request); tracer.info("registration stored: " + request); registration.setCalculator(priceCalculator::calculateTotal); tracer.info("price computed: " + registration.getTotalPrice()); return convert(registration); }  JsonObject register(Registration request); Registration find(long registrationId); JsonObject findAsJson(int registrationId); List<Registration> all(); JsonArray allAsJson(); static final String CONFIRMATION_ID; }### Answer:
@Test public void successfulRegistration() { when(this.cut.priceCalculator.calculateTotal(Matchers.anyBoolean(), Matchers.anyInt())).thenReturn(1); Registration registration = new Registration(true, 1, 1); merge(registration); this.cut.register(registration); }