public void resolveDcMetadata(SamlRequest samlRequest) throws DienstencatalogusException {

        final DcMetadataResponse metadataFromDc = dienstencatalogusClient.retrieveMetadataFromDc(samlRequest);

        if (samlRequest instanceof AuthenticationRequest) {
            dcMetadataResponseMapper.dcMetadataToAuthenticationRequest((AuthenticationRequest) samlRequest, metadataFromDc, samlRequest.getServiceEntityId());
        } else {
            dcMetadataResponseMapper.dcMetadataToSamlRequest(samlRequest, metadataFromDc);
        }
    }
@Test
    public void resolveDcMetadataUnknownStatusTest() throws DienstencatalogusException {
        when(dienstencatalogusClientMock.retrieveMetadataFromDc(any(SamlRequest.class))).thenReturn(null);
        SamlRequest request = new AuthenticationRequest();
        request.setConnectionEntityId(CONNECTION_ENTITY_ID);
        request.setServiceEntityId(SERVICE_ENTITY_ID);

        try {
            dcMetadataService.resolveDcMetadata(request);
        } catch (DienstencatalogusException e) {
            assertEquals("Unknown status from digid_dc", e.getMessage());
        }
    }