use of com.google.phishingprotection.v1beta1.ReportPhishingRequest in project java-phishingprotection by googleapis.
the class PhishingProtectionServiceV1Beta1ClientTest method reportPhishingTest.
@Test
public void reportPhishingTest() throws Exception {
ReportPhishingResponse expectedResponse = ReportPhishingResponse.newBuilder().build();
mockPhishingProtectionServiceV1Beta1.addResponse(expectedResponse);
ProjectName parent = ProjectName.of("[PROJECT]");
String uri = "uri116076";
ReportPhishingResponse actualResponse = client.reportPhishing(parent, uri);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockPhishingProtectionServiceV1Beta1.getRequests();
Assert.assertEquals(1, actualRequests.size());
ReportPhishingRequest actualRequest = ((ReportPhishingRequest) actualRequests.get(0));
Assert.assertEquals(parent.toString(), actualRequest.getParent());
Assert.assertEquals(uri, actualRequest.getUri());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.phishingprotection.v1beta1.ReportPhishingRequest in project java-phishingprotection by googleapis.
the class PhishingProtectionServiceV1Beta1ClientTest method reportPhishingTest2.
@Test
public void reportPhishingTest2() throws Exception {
ReportPhishingResponse expectedResponse = ReportPhishingResponse.newBuilder().build();
mockPhishingProtectionServiceV1Beta1.addResponse(expectedResponse);
String parent = "parent-995424086";
String uri = "uri116076";
ReportPhishingResponse actualResponse = client.reportPhishing(parent, uri);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockPhishingProtectionServiceV1Beta1.getRequests();
Assert.assertEquals(1, actualRequests.size());
ReportPhishingRequest actualRequest = ((ReportPhishingRequest) actualRequests.get(0));
Assert.assertEquals(parent, actualRequest.getParent());
Assert.assertEquals(uri, actualRequest.getUri());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations