CXFSAMLCallbackHandler implements CallbackHandler { protected String getResource(final Message message) { String resource = null; try { final boolean isInbound = (Boolean) message.get(Message.INBOUND_MESSAGE); if (!isInbound) { resource = (String) message.get(Message.ENDPOINT_ADDRESS); } } catch (final Exception e) { LOG.error("Get resource exception: {}", e.getLocalizedMessage(), e); } return resource; } CXFSAMLCallbackHandler();  CXFSAMLCallbackHandler(final HOKSAMLAssertionBuilder builder); @Override void handle(final Callback[] callbacks); static final String HOK_CONFIRM; }
@Test public void testGetResource() { final Message message = mock(Message.class); final String URL = "https: when(message.get(Message.INBOUND_MESSAGE)).thenReturn(false); when(message.get(Message.ENDPOINT_ADDRESS)).thenReturn(URL); CXFSAMLCallbackHandler callbackHandler = new CXFSAMLCallbackHandler(); String resource = callbackHandler.getResource(message); assertEquals(resource, URL); }