Search in sources :

Example 1 with MatchingServiceConfigEntityDataDto

use of uk.gov.ida.hub.config.dto.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.

the class MatchingServiceResource method getMatchingServices.

@GET
@Timed
public Collection<MatchingServiceConfigEntityDataDto> getMatchingServices() {
    Collection<MatchingServiceConfigEntityDataDto> matchingServices = new ArrayList<>();
    for (TransactionConfigEntityData transactionConfigEntityData : transactionConfigEntityDataRepository.getAllData()) {
        MatchingServiceConfigEntityData matchingServiceConfigEntityData = matchingServiceConfigEntityDataRepository.getData(transactionConfigEntityData.getMatchingServiceEntityId()).get();
        matchingServices.add(new MatchingServiceConfigEntityDataDto(matchingServiceConfigEntityData.getEntityId(), matchingServiceConfigEntityData.getUri(), transactionConfigEntityData.getEntityId(), matchingServiceConfigEntityData.getHealthCheckEnabled(), matchingServiceConfigEntityData.getOnboarding(), matchingServiceConfigEntityData.getUserAccountCreationUri()));
    }
    return matchingServices;
}
Also used : MatchingServiceConfigEntityDataDto(uk.gov.ida.hub.config.dto.MatchingServiceConfigEntityDataDto) MatchingServiceConfigEntityData(uk.gov.ida.hub.config.domain.MatchingServiceConfigEntityData) ArrayList(java.util.ArrayList) TransactionConfigEntityData(uk.gov.ida.hub.config.domain.TransactionConfigEntityData) Timed(com.codahale.metrics.annotation.Timed) GET(javax.ws.rs.GET)

Example 2 with MatchingServiceConfigEntityDataDto

use of uk.gov.ida.hub.config.dto.MatchingServiceConfigEntityDataDto in project verify-hub by alphagov.

the class MatchingServiceResourceIntegrationTest method getMatchingService_returnsMatchingServiceForEntityId.

@Test
public void getMatchingService_returnsMatchingServiceForEntityId() {
    String entityId = ENTITY_ID;
    URI uri = configAppRule.getUri(Urls.ConfigUrls.MATCHING_SERVICE_RESOURCE).buildFromEncoded(StringEncoding.urlEncode(entityId).replace("+", "%20"));
    Response response = client.target(uri.toASCIIString()).request().get();
    assertThat(response.getStatus()).isEqualTo(Response.Status.OK.getStatusCode());
    MatchingServiceConfigEntityDataDto ms = response.readEntity(MatchingServiceConfigEntityDataDto.class);
    assertThat(ms.getEntityId()).isEqualTo(entityId);
    assertThat(ms.getUri().toString()).isEqualTo(MATCHING_URI);
}
Also used : Response(javax.ws.rs.core.Response) MatchingServiceConfigEntityDataDto(uk.gov.ida.hub.config.dto.MatchingServiceConfigEntityDataDto) URI(java.net.URI) Test(org.junit.Test)

Aggregations

MatchingServiceConfigEntityDataDto (uk.gov.ida.hub.config.dto.MatchingServiceConfigEntityDataDto)2 Timed (com.codahale.metrics.annotation.Timed)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 GET (javax.ws.rs.GET)1 Response (javax.ws.rs.core.Response)1 Test (org.junit.Test)1 MatchingServiceConfigEntityData (uk.gov.ida.hub.config.domain.MatchingServiceConfigEntityData)1 TransactionConfigEntityData (uk.gov.ida.hub.config.domain.TransactionConfigEntityData)1