### Question:
StreetViewPublishServiceClient implements BackgroundResource { public final void deletePhoto(String photoId) { DeletePhotoRequest request = DeletePhotoRequest.newBuilder().setPhotoId(photoId).build(); deletePhoto(request); } protected  StreetViewPublishServiceClient(StreetViewPublishServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected  StreetViewPublishServiceClient(StreetViewPublishServiceStub stub); static final StreetViewPublishServiceClient create(); static final StreetViewPublishServiceClient create(
      StreetViewPublishServiceSettings settings); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") static final StreetViewPublishServiceClient create(StreetViewPublishServiceStub stub); final StreetViewPublishServiceSettings getSettings(); @BetaApi("A restructuring of stub classes is planned, so this may break in the future") StreetViewPublishServiceStub getStub(); final UploadRef startUpload(Empty request); final UnaryCallable<Empty, UploadRef> startUploadCallable(); final Photo createPhoto(Photo photo); final Photo createPhoto(CreatePhotoRequest request); final UnaryCallable<CreatePhotoRequest, Photo> createPhotoCallable(); final Photo getPhoto(String photoId, PhotoView view); final Photo getPhoto(GetPhotoRequest request); final UnaryCallable<GetPhotoRequest, Photo> getPhotoCallable(); final BatchGetPhotosResponse batchGetPhotos(List<String> photoIds, PhotoView view); final BatchGetPhotosResponse batchGetPhotos(BatchGetPhotosRequest request); final UnaryCallable<BatchGetPhotosRequest, BatchGetPhotosResponse> batchGetPhotosCallable(); final ListPhotosPagedResponse listPhotos(PhotoView view, String filter); final ListPhotosPagedResponse listPhotos(ListPhotosRequest request); final UnaryCallable<ListPhotosRequest, ListPhotosPagedResponse> listPhotosPagedCallable(); final UnaryCallable<ListPhotosRequest, ListPhotosResponse> listPhotosCallable(); final Photo updatePhoto(Photo photo, FieldMask updateMask); final Photo updatePhoto(UpdatePhotoRequest request); final UnaryCallable<UpdatePhotoRequest, Photo> updatePhotoCallable(); final BatchUpdatePhotosResponse batchUpdatePhotos(
      List<UpdatePhotoRequest> updatePhotoRequests); final BatchUpdatePhotosResponse batchUpdatePhotos(BatchUpdatePhotosRequest request); final UnaryCallable<BatchUpdatePhotosRequest, BatchUpdatePhotosResponse> batchUpdatePhotosCallable(); final void deletePhoto(String photoId); final void deletePhoto(DeletePhotoRequest request); final UnaryCallable<DeletePhotoRequest, Empty> deletePhotoCallable(); final BatchDeletePhotosResponse batchDeletePhotos(List<String> photoIds); final BatchDeletePhotosResponse batchDeletePhotos(BatchDeletePhotosRequest request); final UnaryCallable<BatchDeletePhotosRequest, BatchDeletePhotosResponse> batchDeletePhotosCallable(); @Override final void close(); @Override void shutdown(); @Override boolean isShutdown(); @Override boolean isTerminated(); @Override void shutdownNow(); @Override boolean awaitTermination(long duration, TimeUnit unit);  }### Answer:
@Test @SuppressWarnings("all") public void deletePhotoTest() { Empty expectedResponse = Empty.newBuilder().build(); mockStreetViewPublishService.addResponse(expectedResponse); String photoId = "photoId-1274270136"; client.deletePhoto(photoId); List<GeneratedMessageV3> actualRequests = mockStreetViewPublishService.getRequests(); Assert.assertEquals(1, actualRequests.size()); DeletePhotoRequest actualRequest = (DeletePhotoRequest) actualRequests.get(0); Assert.assertEquals(photoId, actualRequest.getPhotoId()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern())); }
@Test @SuppressWarnings("all") public void deletePhotoExceptionTest() throws Exception { StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); mockStreetViewPublishService.addException(exception); try { String photoId = "photoId-1274270136"; client.deletePhoto(photoId); Assert.fail("No exception raised"); } catch (InvalidArgumentException e) { } }