### Question:
NotOnOrAfterLogger { public static void logAssertionNotOnOrAfter(final Assertion assertion, String typeOfAssertion) { final String idp = assertion.getIssuer().getValue(); assertion.getSubject().getSubjectConfirmations() .forEach(subjectConfirmation -> { DateTime notOnOrAfter = subjectConfirmation.getSubjectConfirmationData().getNotOnOrAfter(); LOGGER.info(String.format("NotOnOrAfter in %s from %s is set to %s", typeOfAssertion, idp, notOnOrAfter.toString(dateTimeFormatter))); }); }  static void logAssertionNotOnOrAfter(final Assertion assertion, String typeOfAssertion);  }### Answer:
@Test public void shouldLogNotOnOrAfterWithIdp() { DateTime notOnOrAfter = DateTime.now().withZone(DateTimeZone.UTC).plusHours(1); Assertion assertion = anAssertionWithNotOnOrAfter(notOnOrAfter); String typeOfAssertion = "assertionType"; NotOnOrAfterLogger.logAssertionNotOnOrAfter(assertion, typeOfAssertion); String expectedMessage = String.format("NotOnOrAfter in %s from %s is set to %s", typeOfAssertion, ISSUER_IDP, notOnOrAfter.toString(dateTimeFormatter)); verifyLog(mockAppender, captorLoggingEvent, expectedMessage); }