@Test
    void verifyFailsOperation() throws Throwable {
        val request = new MockHttpServletRequest();
        val response = mock(MockHttpServletResponse.class);
        doThrow(new RuntimeException()).when(response).setContentType(anyString());
        doCallRealMethod().when(response).sendError(anyInt());
        doCallRealMethod().when(response).getStatus();
        wsFederationMetadataController.doGet(request, response);
        assertEquals(HttpStatus.SC_INTERNAL_SERVER_ERROR, response.getStatus());
    }
This is {@link WSFederationMetadataControllerTests}.

@author Misagh Moayyed
@since 6.2.0
support/cas-server-support-ws-idp/src/test/java/org/apereo/cas/ws/idp/metadata/WSFederationMetadataControllerTests.java