EmailServiceCamelSmtpImpl implements EmailService { @Override public void sendEmailToAdmins(String subject, String body) { if (enabled.getValue()) { sendFormattedEmail(recipients.getValue(), subject, body); } }  @Override void sendEmailToAdmins(String subject, String body); @Override void sendFormattedEmail(String recipients, String subject, String body, Object... values);  }
@Test public void testSendEmailToAdmins_enabled() { setPrivateField(emailService, "enabled", new FixedConfigurationItem<>(Boolean.TRUE)); emailService.sendEmailToAdmins(TEST_SUBJECT, TEST_BODY); verify(producerTemplateMock, times(1)).sendBodyAndHeaders(eq("smtp: }
@Test public void testSendEmailToAdmins_disabled() { setPrivateField(emailService, "enabled", new FixedConfigurationItem<>(Boolean.FALSE)); emailService.sendEmailToAdmins(TEST_SUBJECT, TEST_BODY); verify(producerTemplateMock, never()).sendBodyAndHeaders(eq("smtp: }