### Question:
SoapServiceClient implements InvocationHandler { @Override public Object invoke(Object proxy, final Method method, final Object[] args) throws Throwable { try { return getClass().getMethod(method.getName(), method.getParameterTypes()) .invoke(this, args); } catch (NoSuchMethodException e) { } setHeaders(); RemoteCallReturn remoteCallReturn = callSoapClient( createSoapCall(soapClientHandler.getSoapClientMethod(soapClient, method), args)); logSoapCall(remoteCallReturn); return unwrapRemoteCallReturn(remoteCallReturn); } protected  SoapServiceClient(SoapClientHandlerInterface<T> soapClientHandler,
      T soapClient); @Override Object invoke(Object proxy, final Method method, final Object[] args); void setEndpointAddress(String endpointAddress); Object getSoapClient();  }### Answer:
@Test public void testInvoke_serviceClientSubclassMethod() throws Throwable { soapServiceClient.invoke(null, TestSoapServiceClient.class.getMethod("doSomething", Object.class), new Object[] {""}); }
@Test public void testInvoke_soapClientMethod() throws Throwable { Object returnValue = new Object(); RemoteCallReturn callReturn = new RemoteCallReturn.Builder().withReturnValue(returnValue).build(); Method identityCallMethod = MockSoapClient.class.getMethod("identityCall", Object[].class); Object[] arg = new String[] {"arg1", "arg2"}; Object[] args = new Object[] {arg}; SoapCall<Object> soapCall = new SoapCall<Object>(identityCallMethod, soapClient, args); when(soapClientHandler.getSoapClientMethod(soapClient, identityCallMethod)) .thenReturn(identityCallMethod); when(soapClientHandler.invokeSoapCall(soapCall)).thenReturn(callReturn); Object result = soapServiceClient.invoke(null, identityCallMethod, args); assertEquals(returnValue, result); }
@Test public void testInvoke_soapClientMethodAuthenticationException() throws Throwable { Method indentityCallMethod = MockSoapClient.class.getMethod("identityCall", Object[].class); Object[] args = new String[] {"arg1", "arg2"}; soapServiceClient.throwAuthException = true; thrown.expect(Matchers.<Exception>equalTo(TestSoapServiceClient.AUTH_EXCEPTION)); soapServiceClient.invoke(null, indentityCallMethod, args); }
@Test public void testInvoke_soapClientMethodNoSuchmethodException() throws Throwable { Method indentityCallMethod = MockSoapClient.class.getMethod("identityCall", Object[].class); Object[] args = new String[] {"arg1", "arg2"}; when(soapClientHandler.getSoapClientMethod(soapClient, indentityCallMethod)) .thenThrow(new NoSuchMethodException()); thrown.expect(NoSuchMethodException.class); soapServiceClient.invoke(null, indentityCallMethod, args); }