Search in sources :

Example 16 with RequestInfo

use of com.google.api.ads.common.lib.client.RequestInfo in project googleads-java-lib by googleads.

the class RemoteCallLoggerDelegateTest method setUp.

@Before
public void setUp() throws Exception {
    MockitoAnnotations.initMocks(this);
    loggerDelegate = new RemoteCallLoggerDelegate(requestInfoLogger, soapXmlLogger, prettyPrinter, RemoteCallType.SOAP);
    RequestInfo requestInfo = new RequestInfo.Builder().withContext("clientCustomerId", "555-555-0000").withServiceName("test service").withMethodName("test method").withUrl("http://www.example.com").withPayload(requestXml).build();
    ResponseInfo responseInfo = new ResponseInfo.Builder().withRequestId("abc123def456").withOperationsCount(1_234L).withResponseTimeMillis(543_210L).withPayload(responseXml).build();
    remoteCallReturn = new RemoteCallReturn.Builder().withException(null).withRequestInfo(requestInfo).withResponseInfo(responseInfo).withReturnValue("some object").build();
    when(prettyPrinter.prettyPrint(requestXml)).thenReturn(prettyRequest);
    when(prettyPrinter.prettyPrint(responseXml)).thenReturn(prettyResponse);
}
Also used : ResponseInfo(com.google.api.ads.common.lib.client.ResponseInfo) RequestInfo(com.google.api.ads.common.lib.client.RequestInfo) Before(org.junit.Before)

Aggregations

RequestInfo (com.google.api.ads.common.lib.client.RequestInfo)16 ResponseInfo (com.google.api.ads.common.lib.client.ResponseInfo)11 Test (org.junit.Test)11 RemoteCallReturn (com.google.api.ads.common.lib.client.RemoteCallReturn)6 SOAPException (javax.xml.soap.SOAPException)3 SOAPHeader (javax.xml.soap.SOAPHeader)3 SOAPMessage (javax.xml.soap.SOAPMessage)3 SOAPPart (javax.xml.soap.SOAPPart)3 StreamResult (javax.xml.transform.stream.StreamResult)3 Before (org.junit.Before)3 AdsApiConfiguration (com.google.api.ads.common.lib.conf.AdsApiConfiguration)2 RequestInfoXPathSet (com.google.api.ads.common.lib.soap.RequestInfoXPathSet)2 ResponseInfoXPathSet (com.google.api.ads.common.lib.soap.ResponseInfoXPathSet)2 NodeExtractor (com.google.api.ads.common.lib.utils.NodeExtractor)2 Streams (com.google.api.ads.common.lib.utils.Streams)2 Supplier (com.google.common.base.Supplier)2 OutputStream (java.io.OutputStream)2 Charset (java.nio.charset.Charset)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2