### Question:
UnknownMethodAlgorithmLogger { public static void probeResponseForMethodAlgorithm(final InboundResponseFromIdp response) { if (response != null) { response.getSignature().ifPresent((signature) -> logMethodAlgorithm(Role.IDP, signature, Response.DEFAULT_ELEMENT_LOCAL_NAME) ); } }  static void probeResponseForMethodAlgorithm(final InboundResponseFromIdp response); static void probeAssertionForMethodAlgorithm(final Assertion assertion, final String typeOfAssertion); static void probeAuthnRequestForMethodAlgorithm(final AuthnRequestFromRelyingParty authnRequest); static final String SIGNATURE_AND_DIGEST_ALGORITHMS_MESSAGE; static final String SIGNATURE_ALGORITHM_MESSAGE; static final String DIGEST_ALGORITHM_MESSAGE; }### Answer:
@Test public void shouldNotReportStrongAlgorithmsInIDPResponse() throws Exception { final InboundResponseFromIdp inboundResponseFromIdp = new InboundResponseFromIdp( ID, IN_RESPONSE_TO, ISSUER_IDP, ISSUE_INSTANT, NOT_ON_OR_AFTER, STATUS, signature, MATCHING_DATASET_ASSERTION, DESTINATION, AUTHN_STATEMENT_ASSERTION); UnknownMethodAlgorithmLogger.probeResponseForMethodAlgorithm(inboundResponseFromIdp); verify(mockAppender, times(0)).doAppend(captorLoggingEvent.capture()); }
@Test public void shouldReportUnknownSignatureAlgorithmInIDPResponse() throws Exception { InboundResponseFromIdp inboundResponseFromIdp = new InboundResponseFromIdp( ID, IN_RESPONSE_TO, ISSUER_IDP, ISSUE_INSTANT, NOT_ON_OR_AFTER, STATUS, signatureWithUnknownSignatureAlgorithm, MATCHING_DATASET_ASSERTION, DESTINATION, AUTHN_STATEMENT_ASSERTION); UnknownMethodAlgorithmLogger.probeResponseForMethodAlgorithm(inboundResponseFromIdp); verifyLog(mockAppender, captorLoggingEvent, 1, String.format(UnknownMethodAlgorithmLogger.SIGNATURE_ALGORITHM_MESSAGE, IDP, SIGNATURE_RSA_SHA1_ID, Response.DEFAULT_ELEMENT_LOCAL_NAME)); }
@Test public void shouldReportUnknownDigestAlgorithmInIDPResponse() throws Exception { InboundResponseFromIdp inboundResponseFromIdp = new InboundResponseFromIdp( ID, IN_RESPONSE_TO, ISSUER_IDP, ISSUE_INSTANT, NOT_ON_OR_AFTER, STATUS, signatureWithUnknownDigestAlgorithm, MATCHING_DATASET_ASSERTION, DESTINATION, AUTHN_STATEMENT_ASSERTION); UnknownMethodAlgorithmLogger.probeResponseForMethodAlgorithm(inboundResponseFromIdp); verifyLog(mockAppender, captorLoggingEvent, 1, String.format(UnknownMethodAlgorithmLogger.DIGEST_ALGORITHM_MESSAGE, IDP, DIGEST_SHA1_ID, Response.DEFAULT_ELEMENT_LOCAL_NAME)); }
@Test public void shouldReportUnknownSignatureAndDigestAlgorithmsInIDPResponse() throws Exception { InboundResponseFromIdp inboundResponseFromIdp = new InboundResponseFromIdp( ID, IN_RESPONSE_TO, ISSUER_IDP, ISSUE_INSTANT, NOT_ON_OR_AFTER, STATUS, signatureWithUnknownSignatureAndDigestAlgorithms, MATCHING_DATASET_ASSERTION, DESTINATION, AUTHN_STATEMENT_ASSERTION); UnknownMethodAlgorithmLogger.probeResponseForMethodAlgorithm(inboundResponseFromIdp); verifyLog(mockAppender, captorLoggingEvent, 1, String.format(UnknownMethodAlgorithmLogger.SIGNATURE_AND_DIGEST_ALGORITHMS_MESSAGE, IDP, SIGNATURE_RSA_SHA1_ID, DIGEST_SHA1_ID, Response.DEFAULT_ELEMENT_LOCAL_NAME)); }