Search in sources :

Example 6 with WriteLogEntriesResponse

use of com.google.logging.v2.WriteLogEntriesResponse in project google-cloud-java by GoogleCloudPlatform.

the class LoggingImplTest method testWriteLogEntries.

@Test
public void testWriteLogEntries() {
    WriteLogEntriesRequest request = WriteLogEntriesRequest.newBuilder().addAllEntries(Iterables.transform(ImmutableList.of(LOG_ENTRY1, LOG_ENTRY2), LogEntry.toPbFunction(PROJECT))).build();
    WriteLogEntriesResponse response = WriteLogEntriesResponse.newBuilder().build();
    EasyMock.expect(loggingRpcMock.write(request)).andReturn(ApiFutures.immediateFuture(response));
    EasyMock.replay(rpcFactoryMock, loggingRpcMock);
    logging = options.getService();
    logging.write(ImmutableList.of(LOG_ENTRY1, LOG_ENTRY2));
}
Also used : WriteLogEntriesRequest(com.google.logging.v2.WriteLogEntriesRequest) WriteLogEntriesResponse(com.google.logging.v2.WriteLogEntriesResponse) Test(org.junit.Test)

Aggregations

WriteLogEntriesRequest (com.google.logging.v2.WriteLogEntriesRequest)6 WriteLogEntriesResponse (com.google.logging.v2.WriteLogEntriesResponse)6 Test (org.junit.Test)6 MonitoredResource (com.google.api.MonitoredResource)1 LogEntry (com.google.logging.v2.LogEntry)1 LogNameOneof (com.google.logging.v2.LogNameOneof)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1