@@ -0,0 +1,2217 @@
+package io.tracee.jaxws;%0A%0Aimport io.tracee.TraceeBackend;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport javax.xml.ws.handler.MessageContext;%0Aimport javax.xml.ws.handler.soap.SOAPMessageContext;%0A%0Aimport static org.hamcrest.MatcherAssert.assertThat;%0Aimport static org.hamcrest.Matchers.hasItem;%0Aimport static org.hamcrest.Matchers.is;%0Aimport static org.mockito.Mockito.*;%0A%0Apublic class AbstractTraceeHandlerTest %7B%0A%0A%09private TestTraceeHandler unit;%0A%0Aprivate final TraceeBackend traceeBackend = mock(TraceeBackend.class);%0A%0A%09@Before%0A%09public void setupMocks() %7B%0A%09%09unit = spy(new TestTraceeHandler(traceeBackend));%0A%09%7D%0A%0A%09@Test%0A%09public void shouldHandleOutgoingContextInOutgoingMethod() %7B%0A%09%09final SOAPMessageContext messageContext = mock(SOAPMessageContext.class);%0A%09%09when(messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)).thenReturn(Boolean.TRUE);%0A%09%09unit.handleMessage(messageContext);%0A%0A%09%09verify(unit).handleOutgoing(messageContext);%0A%09%7D%0A%0A%09@Test%0A%09public void shouldHandleIncomingContextInIncomingMethod() %7B%0A%09%09final SOAPMessageContext messageContext = mock(SOAPMessageContext.class);%0A%09%09unit.handleMessage(messageContext);%0A%09%09verify(unit).handleIncoming(messageContext);%0A%09%7D%0A%0A%09@Test%0A%09public void shouldHandleNoContextPropertyInIncomingMethod() %7B%0A%09%09final SOAPMessageContext messageContext = mock(SOAPMessageContext.class);%0A%09%09when(messageContext.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)).thenReturn(Boolean.FALSE);%0A%09%09unit.handleMessage(messageContext);%0A%0A%09%09verify(unit).handleIncoming(messageContext);%0A%09%7D%0A%0A%09@Test%0A%09public void shouldRegisterForTraceeHeaders() %7B%0A%09%09assertThat(unit.getHeaders(), hasItem(TraceeWsHandlerConstants.TRACEE_SOAP_HEADER_QNAME));%0A%09%7D%0A%0A%09@Test%0A%09public void shouldReturnTraceeBackendFromInitializiation() %7B%0A%09%09assertThat(unit.getTraceeBackend(), is(traceeBackend));%0A%09%7D%0A%0A%0A%09private static class TestTraceeHandler extends AbstractTraceeHandler %7B%0A%0A%09%09public TestTraceeHandler(TraceeBackend traceeBackend) %7B%0A%09%09%09super(traceeBackend);%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09protected void handleIncoming(SOAPMessageContext context) %7B%0A%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09protected void handleOutgoing(SOAPMessageContext context) %7B%0A%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public boolean handleFault(SOAPMessageContext context) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%7D%0A%7D

Add more test cases #5