Package com.google.api.ads.common.lib.soap.testing

Examples of com.google.api.ads.common.lib.soap.testing.MockSoapClient


  }

  @Test
  public void testGetServiceClientAsInterface() {
    String endpointServer = "http://google.com";
    MockSoapClientInterface soapClient = new MockSoapClient();
    when(adsServiceClientFactory.getServiceClient(adsSession, MockSoapClientInterface.class))
        .thenReturn(soapClient);

    MockSoapClientInterface testSoapClient =
        baseAdsServiceClientFactory.getServiceClientAsInterface(adsSession,
View Full Code Here


  @SuppressWarnings("unchecked")
  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);

    soapClient = new MockSoapClient();
    soapClientHandler = new SoapClientHandlerImpl();
  }
View Full Code Here

  public void testCall_identityCall() throws Throwable {
    Object[] args = new Object[] {new Long(1), "2", new Double(3.0)};

    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("identityCall", Object[].class));
    when(soapCall.getSoapClient()).thenReturn(new MockSoapClient());
    when(soapCall.getSoapArgs()).thenReturn(new Object[] {args});

    Object result = soapClientHandler.invoke(soapCall);

    assertSame(args, result);
View Full Code Here

  public void testInvoke_voidCall() throws Exception {
    Object[] args = new Object[] {"2", 1};

    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("voidCall", Object[].class));
    when(soapCall.getSoapClient()).thenReturn(new MockSoapClient());
    when(soapCall.getSoapArgs()).thenReturn(new Object[] {args});

    Object result = soapClientHandler.invoke(soapCall);

    assertNull(result);
View Full Code Here

  public void testInvoke_emptyCall() throws Exception {
    Object[] args = null;

    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("emptyCall"));
    when(soapCall.getSoapClient()).thenReturn(new MockSoapClient());
    when(soapCall.getSoapArgs()).thenReturn(args);

    Object result = soapClientHandler.invoke(soapCall);

    assertNull(result);
View Full Code Here

    Object[] args = new Object[] {firstArg, new Object[] {}, new Object(), new Object()};

    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("lotsOfArgsCall",
            Object.class, Object[].class, Object.class, Object.class));
    when(soapCall.getSoapClient()).thenReturn(new MockSoapClient());
    when(soapCall.getSoapArgs()).thenReturn(args);

    Object result = soapClientHandler.invoke(soapCall);

    assertSame(firstArg, result);
View Full Code Here

  public void testInvoke_overloadedOneParam() throws Exception {
    Object[] args = new Object[] {1};

    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("testOverloaded", int.class));
    when(soapCall.getSoapClient()).thenReturn(new MockSoapClient());
    when(soapCall.getSoapArgs()).thenReturn(args);

    Object result = soapClientHandler.invoke(soapCall);

    assertSame(1, result);
View Full Code Here

  public void testInvoke_overloadedTwoParams() throws Exception {
    Object[] args = new Object[] {"moo", "cow"};

    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("testOverloaded", String.class, String.class));
    when(soapCall.getSoapClient()).thenReturn(new MockSoapClient());
    when(soapCall.getSoapArgs()).thenReturn(args);

    Object result = soapClientHandler.invoke(soapCall);

    assertSame("moo", result);
View Full Code Here

  }

  @Test
  public void testCall_exception() throws Throwable {
    Object[] args = new Object[] {new Long(1), "2", new Double(3.0)};
    MockSoapClient mockSoapClient = new MockSoapClient();

    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("throwException", Object[].class));
    when(soapCall.getSoapClient()).thenReturn(mockSoapClient);
    when(soapCall.getSoapArgs()).thenReturn(new Object[] {args});
View Full Code Here

  @Test
  public void testCall_null() throws Throwable {
    when(soapCall.getSoapClientMethod()).thenReturn(
        MockSoapClient.class.getMethod("identityCall", Object[].class));
    when(soapCall.getSoapClient()).thenReturn(new MockSoapClient());
    when(soapCall.getSoapArgs()).thenReturn(new Object[] {null});

    Object result = soapClientHandler.invoke(soapCall);

    assertNull(result);
View Full Code Here

TOP

Related Classes of com.google.api.ads.common.lib.soap.testing.MockSoapClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.