@Test public void getTotalPrice() { boolean vatAvailable = true; this.cut = new Registration(vatAvailable, 2, 1); BiFunction<Boolean, Integer, Integer> taxCalculator = mock(BiFunction.class); this.cut.setCalculator(taxCalculator); int netPrice = this.cut.getNetPrice(); final int expectedPrice = 42; when(taxCalculator.apply(vatAvailable, netPrice)).thenReturn(expectedPrice); int totalPrice = this.cut.getTotalPrice(); assertThat(totalPrice, is(expectedPrice)); verify(taxCalculator).apply(vatAvailable, netPrice); }
public int getTotalPrice() { return taxCalculator.apply(this.vatIdAvailable, getNetPrice()); }
Registration { public int getTotalPrice() { return taxCalculator.apply(this.vatIdAvailable, getNetPrice()); } }
Registration { public int getTotalPrice() { return taxCalculator.apply(this.vatIdAvailable, getNetPrice()); } Registration(boolean vatIdAvailable, int numberOfDays, int numberOfAttendees);  Registration(long id);  Registration(); }
Registration { public int getTotalPrice() { return taxCalculator.apply(this.vatIdAvailable, getNetPrice()); } Registration(boolean vatIdAvailable, int numberOfDays, int numberOfAttendees);  Registration(long id);  Registration(); int getNetPrice(); void setCalculator(BiFunction<Boolean, Integer, Integer> taxCalculator); int getTotalPrice(); boolean isVatIdAvailable(); long getId(); }
Registration { public int getTotalPrice() { return taxCalculator.apply(this.vatIdAvailable, getNetPrice()); } Registration(boolean vatIdAvailable, int numberOfDays, int numberOfAttendees);  Registration(long id);  Registration(); int getNetPrice(); void setCalculator(BiFunction<Boolean, Integer, Integer> taxCalculator); int getTotalPrice(); boolean isVatIdAvailable(); long getId(); static final String findAll; }