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 resolveDcMetadataNoFederationTest() throws DienstencatalogusException {
        DcMetadataResponse dcMetadataResponse = dcClientStubGetMetadata(stubsCaMetadataFile, null, 1L);
        when(dienstencatalogusClientMock.retrieveMetadataFromDc(any(SamlRequest.class))).thenReturn(dcMetadataResponse);
        SamlRequest request = new AuthenticationRequest();
        request.setConnectionEntityId(CONNECTION_ENTITY_ID);
        request.setServiceEntityId(SERVICE_ENTITY_ID);

        assertDoesNotThrow(() -> dcMetadataService.resolveDcMetadata(request));
    }