Search in sources :

Example 6 with MergeShelvesRequest

use of com.google.example.library.v1.MergeShelvesRequest in project gapic-generator-java by googleapis.

the class LibraryServiceClientTest method mergeShelvesTest4.

@Test
public void mergeShelvesTest4() throws Exception {
    Shelf expectedResponse = Shelf.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).setTheme("theme110327241").build();
    mockLibraryService.addResponse(expectedResponse);
    String name = "name3373707";
    String otherShelf = "otherShelf-193668870";
    Shelf actualResponse = client.mergeShelves(name, otherShelf);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockLibraryService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    MergeShelvesRequest actualRequest = ((MergeShelvesRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertEquals(otherShelf, actualRequest.getOtherShelf());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) Shelf(com.google.example.library.v1.Shelf) MergeShelvesRequest(com.google.example.library.v1.MergeShelvesRequest) Test(org.junit.Test)

Aggregations

MergeShelvesRequest (com.google.example.library.v1.MergeShelvesRequest)6 Shelf (com.google.example.library.v1.Shelf)6 AbstractMessage (com.google.protobuf.AbstractMessage)4 Test (org.junit.Test)4 ShelfName (com.google.example.library.v1.ShelfName)3 LibraryServiceClient (com.google.cloud.example.library.v1.LibraryServiceClient)2