Search in sources :

Example 1 with CampaignServiceInterfaceImpl

use of com.google.api.ads.common.lib.soap.jaxws.testing.mocks.CampaignServiceInterfaceImpl in project googleads-java-lib by googleads.

the class JaxWsHandlerTest method testInvokeSoapCall.

@Test
public void testInvokeSoapCall() throws SecurityException, NoSuchMethodException {
    CampaignServiceInterface soapClient = new CampaignServiceInterfaceImpl();
    Method soapCallMethod = CampaignServiceInterface.class.getMethod("getTestMessage", new Class<?>[0]);
    SoapCall<BindingProvider> soapCall = new SoapCall<BindingProvider>(soapCallMethod, soapClient, new Object[0]);
    RemoteCallReturn returnedValue = jaxWsHandler.invokeSoapCall(soapCall);
    assertEquals("Here!", returnedValue.getReturnValue());
    assertEquals(null, returnedValue.getException());
    assertEquals(CampaignServiceInterfaceImpl.endpointAddress, returnedValue.getRequestInfo().getUrl());
}
Also used : CampaignServiceInterface(com.google.api.ads.common.lib.soap.jaxws.testing.mocks.CampaignServiceInterface) Method(java.lang.reflect.Method) BindingProvider(javax.xml.ws.BindingProvider) SoapCall(com.google.api.ads.common.lib.soap.SoapCall) CampaignServiceInterfaceImpl(com.google.api.ads.common.lib.soap.jaxws.testing.mocks.CampaignServiceInterfaceImpl) RemoteCallReturn(com.google.api.ads.common.lib.client.RemoteCallReturn) Test(org.junit.Test)

Example 2 with CampaignServiceInterfaceImpl

use of com.google.api.ads.common.lib.soap.jaxws.testing.mocks.CampaignServiceInterfaceImpl in project googleads-java-lib by googleads.

the class JaxWsHandlerTest method testCreateSoapClient.

@Test
public void testCreateSoapClient() {
    SoapServiceDescriptor serviceDescriptor = new MockJaxWsCompatibleDescriptor();
    BindingProvider provider = jaxWsHandler.createSoapClient(serviceDescriptor);
    assertTrue(provider instanceof CampaignServiceInterfaceImpl);
    assertTrue(provider.getBinding().getHandlerChain().get(0) instanceof JaxWsSoapContextHandler);
}
Also used : MockJaxWsCompatibleDescriptor(com.google.api.ads.common.lib.soap.jaxws.testing.mocks.MockJaxWsCompatibleDescriptor) BindingProvider(javax.xml.ws.BindingProvider) SoapServiceDescriptor(com.google.api.ads.common.lib.soap.SoapServiceDescriptor) CampaignServiceInterfaceImpl(com.google.api.ads.common.lib.soap.jaxws.testing.mocks.CampaignServiceInterfaceImpl) Test(org.junit.Test)

Aggregations

CampaignServiceInterfaceImpl (com.google.api.ads.common.lib.soap.jaxws.testing.mocks.CampaignServiceInterfaceImpl)2 BindingProvider (javax.xml.ws.BindingProvider)2 Test (org.junit.Test)2 RemoteCallReturn (com.google.api.ads.common.lib.client.RemoteCallReturn)1 SoapCall (com.google.api.ads.common.lib.soap.SoapCall)1 SoapServiceDescriptor (com.google.api.ads.common.lib.soap.SoapServiceDescriptor)1 CampaignServiceInterface (com.google.api.ads.common.lib.soap.jaxws.testing.mocks.CampaignServiceInterface)1 MockJaxWsCompatibleDescriptor (com.google.api.ads.common.lib.soap.jaxws.testing.mocks.MockJaxWsCompatibleDescriptor)1 Method (java.lang.reflect.Method)1