@Operation(summary = "Get SAML metadata")
    @GetMapping(value = "/idp/metadata", produces = MediaType.APPLICATION_XML_VALUE)
    @ResponseBody
    public String metadata() throws MetadataException {
        logger.debug("Receive SAML metadata request!");
        return idpMetadataService.getMetadata();
    }
@Test
    public void idpMetadataTest() throws MetadataException {
        String idpMetadata = "idpMetadata";
        when(idpMetadataServiceMock.getMetadata()).thenReturn(idpMetadata);

        String result = metadataControllerMock.metadata();

        assertNotNull(result);
        assertEquals(idpMetadata, result);
        verify(idpMetadataServiceMock, times(1)).getMetadata();
    }