use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class MatchingServiceHealthCheckerTest method shouldIncludeOnboardingStatusTrueWhenMsaIsOnboarding.
@Test
public void shouldIncludeOnboardingStatusTrueWhenMsaIsOnboarding() {
MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = aMatchingServiceConfigEntityDataDto().withOnboarding(true).withHealthCheckEnabled().build();
prepareForHealthyResponse(matchingServiceConfigEntityDataDto);
MatchingServiceHealthCheckResult result = matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto);
assertThat(result.getDetails().isOnboarding()).isTrue();
}
use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class MatchingServiceHealthCheckerTest method shouldLogExceptionsWhenAFailureOccursInTranslatingHealthCheckRequest.
@Test
public void shouldLogExceptionsWhenAFailureOccursInTranslatingHealthCheckRequest() {
String uri = "http://random";
ApplicationException unauditedException = ApplicationException.createUnauditedException(ExceptionType.INVALID_SAML, UUID.randomUUID());
when(samlEngineProxy.generateHealthcheckAttributeQuery(any())).thenReturn(new SamlMessageDto("<saml/>"));
when(samlEngineProxy.translateHealthcheckMatchingServiceResponse(any())).thenThrow(unauditedException);
MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = aMatchingServiceConfigEntityDataDto().withUri(uri).build();
when(matchingServiceHealthCheckClient.sendHealthCheckRequest(any(), eq(matchingServiceConfigEntityDataDto.getUri()))).thenReturn(new MatchingServiceHealthCheckResponseDto(Optional.of("<saml/>")));
matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto);
verify(eventLogger).logException(unauditedException, MessageFormat.format("Matching service health check failed for URI {0}", uri));
}
use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class MatchingServiceHealthCheckerTest method shouldReturnDisabledValuesForVersionEidasEnabledAndUseSha1WhenReasonableRequestIdReceived.
@Test
public void shouldReturnDisabledValuesForVersionEidasEnabledAndUseSha1WhenReasonableRequestIdReceived() {
MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = aMatchingServiceConfigEntityDataDto().build();
prepareForHealthyResponse(matchingServiceConfigEntityDataDto);
mockHealthcheckResponseId("healthcheck-response-id-version-1234-eidasenabled-false-shouldsignwithsha1-true");
MatchingServiceHealthCheckResult result = matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto);
assertThat(result.getDetails().getVersionNumber()).isEqualTo("1234");
assertThat(result.getDetails().getEidasEnabled()).isEqualTo("false");
assertThat(result.getDetails().getShouldSignWithSha1()).isEqualTo("true");
}
Aggregations