use of com.google.example.library.v1.ShelfName in project gapic-generator-java by googleapis.
the class LibraryServiceClientTest method mergeShelvesTest3.
@Test
public void mergeShelvesTest3() throws Exception {
Shelf expectedResponse = Shelf.newBuilder().setName(ShelfName.of("[SHELF_ID]").toString()).setTheme("theme110327241").build();
mockLibraryService.addResponse(expectedResponse);
String name = "name3373707";
ShelfName otherShelf = ShelfName.of("[SHELF_ID]");
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.toString(), actualRequest.getOtherShelf());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.example.library.v1.ShelfName in project gapic-generator-java by googleapis.
the class LibraryServiceClientTest method deleteShelfTest.
@Test
public void deleteShelfTest() throws Exception {
Empty expectedResponse = Empty.newBuilder().build();
mockLibraryService.addResponse(expectedResponse);
ShelfName name = ShelfName.of("[SHELF_ID]");
client.deleteShelf(name);
List<AbstractMessage> actualRequests = mockLibraryService.getRequests();
Assert.assertEquals(1, actualRequests.size());
DeleteShelfRequest actualRequest = ((DeleteShelfRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations