diff --git a/server/src/test/java/access/AbstractTest.java b/server/src/test/java/access/AbstractTest.java index f369ae52..fe7a2a78 100644 --- a/server/src/test/java/access/AbstractTest.java +++ b/server/src/test/java/access/AbstractTest.java @@ -317,19 +317,21 @@ protected void stubForManageProvisioning(List identifiers) throws JsonPr protected void stubForManageProviderByOrganisationGUID(String organisationGUID) throws JsonProcessingException { String path = "/manage/api/internal/search/%s"; List> providers = localManage.providersByInstitutionalGUID(organisationGUID); - Map>> providersMap = Map.of( + Optional> identityProvider = localManage.identityProviderByInstitutionalGUID(organisationGUID); + Map providersMap = Map.of( EntityType.SAML20_SP, providers.stream().filter(m -> m.get("type").equals(EntityType.SAML20_SP.collectionName())).toList(), + EntityType.SAML20_IDP, + List.of(identityProvider.get()), EntityType.OIDC10_RP, providers.stream().filter(m -> m.get("type").equals(EntityType.OIDC10_RP.collectionName())).toList() ); //Lambda can't do exception handling - for (Map.Entry>> entry : providersMap.entrySet()) { + for (Map.Entry entry : providersMap.entrySet()) { EntityType entityType = entry.getKey(); - List> providerList = entry.getValue(); stubFor(post(urlPathMatching(String.format(path, entityType.collectionName()))).willReturn(aResponse() .withHeader("Content-Type", "application/json") - .withBody(objectMapper.writeValueAsString(providerList)))); + .withBody(objectMapper.writeValueAsString(entry.getValue())))); } }