use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class ConfigStubRule method setUpStubForForcedMatchingServiceHealthCheckRequest.
public void setUpStubForForcedMatchingServiceHealthCheckRequest(URI msaUri, String msaEntityId) throws JsonProcessingException {
final MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = new MatchingServiceConfigEntityDataDto(msaEntityId, msaUri, "rp-entity-id", false, false, null);
Collection<MatchingServiceConfigEntityDataDto> matchingServices = ImmutableList.of(matchingServiceConfigEntityDataDto);
String uri = UriBuilder.fromPath(Urls.ConfigUrls.ENABLED_MATCHING_SERVICES_RESOURCE).build().getPath();
register(uri, OK.getStatusCode(), matchingServices);
}
use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class ConfigStubRule method setUpStubForTwoMatchingServiceHealthCheckRequests.
public void setUpStubForTwoMatchingServiceHealthCheckRequests(URI msaUri, String msaEntityId, URI msaUri2, String msaEntityId2) throws JsonProcessingException {
final MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = new MatchingServiceConfigEntityDataDto(msaEntityId, msaUri, "rp-entity-id", true, false, null);
final MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto2 = new MatchingServiceConfigEntityDataDto(msaEntityId2, msaUri2, "rp-entity-id2", true, false, null);
Collection<MatchingServiceConfigEntityDataDto> matchingServices = ImmutableList.of(matchingServiceConfigEntityDataDto, matchingServiceConfigEntityDataDto2);
String uri = UriBuilder.fromPath(Urls.ConfigUrls.ENABLED_MATCHING_SERVICES_RESOURCE).build().getPath();
register(uri, OK.getStatusCode(), matchingServices);
}
use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class MatchingServiceHealthCheckerTest method handle_shouldReturnResponseIdVersionIfDifferentOnesArePresentInResponseIDAndHeaderWithMessageForHealthyMatchingService.
@Test
public void handle_shouldReturnResponseIdVersionIfDifferentOnesArePresentInResponseIDAndHeaderWithMessageForHealthyMatchingService() throws Exception {
final Optional<String> headerVersion = Optional.fromNullable("HEADERVER");
final String idVersion = "IDVER";
MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = aMatchingServiceConfigEntityDataDto().build();
prepareForHealthyResponse(matchingServiceConfigEntityDataDto, headerVersion);
mockHealthcheckResponseId("healthcheck-response-id-uuid-version-" + idVersion);
MatchingServiceHealthCheckResult result = matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto);
assertThat(result.getDetails().getVersionNumber()).isEqualTo(idVersion);
}
use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class MatchingServiceHealthCheckerTest method handle_shouldExecuteHealthCheckForMatchingServiceWithHealthCheckEnabled.
@Test
public void handle_shouldExecuteHealthCheckForMatchingServiceWithHealthCheckEnabled() {
MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = aMatchingServiceConfigEntityDataDto().withHealthCheckEnabled().build();
prepareForHealthyResponse(matchingServiceConfigEntityDataDto, Optional.absent());
matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto);
verify(matchingServiceHealthCheckClient, times(1)).sendHealthCheckRequest(any(), eq(matchingServiceConfigEntityDataDto.getUri()));
}
use of uk.gov.ida.hub.samlsoapproxy.contract.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.
the class MatchingServiceHealthCheckerTest method handle_shouldReturnFailureWithMessageForUnhealthyMatchingService.
@Test
public void handle_shouldReturnFailureWithMessageForUnhealthyMatchingService() throws Exception {
MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = aMatchingServiceConfigEntityDataDto().build();
prepareForResponse(matchingServiceConfigEntityDataDto, RequesterError, Optional.absent());
MatchingServiceHealthCheckResult result = matchingServiceHealthChecker.performHealthCheck(matchingServiceConfigEntityDataDto);
assertThat(result.isHealthy()).isEqualTo(false);
assertThat(result.getDetails().getDetails()).isEqualTo("responded with non-healthy status");
}
Aggregations