Search in sources :

Example 1 with HybridInspectResponse

use of com.google.privacy.dlp.v2.HybridInspectResponse in project java-dlp by googleapis.

the class DlpServiceClientTest method hybridInspectDlpJobTest2.

@Test
public void hybridInspectDlpJobTest2() throws Exception {
    HybridInspectResponse expectedResponse = HybridInspectResponse.newBuilder().build();
    mockDlpService.addResponse(expectedResponse);
    String name = "name3373707";
    HybridInspectResponse actualResponse = client.hybridInspectDlpJob(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockDlpService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    HybridInspectDlpJobRequest actualRequest = ((HybridInspectDlpJobRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) HybridInspectDlpJobRequest(com.google.privacy.dlp.v2.HybridInspectDlpJobRequest) HybridInspectResponse(com.google.privacy.dlp.v2.HybridInspectResponse) ByteString(com.google.protobuf.ByteString) Test(org.junit.Test)

Example 2 with HybridInspectResponse

use of com.google.privacy.dlp.v2.HybridInspectResponse in project java-dlp by googleapis.

the class DlpServiceClientTest method hybridInspectJobTriggerTest2.

@Test
public void hybridInspectJobTriggerTest2() throws Exception {
    HybridInspectResponse expectedResponse = HybridInspectResponse.newBuilder().build();
    mockDlpService.addResponse(expectedResponse);
    String name = "name3373707";
    HybridInspectResponse actualResponse = client.hybridInspectJobTrigger(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockDlpService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    HybridInspectJobTriggerRequest actualRequest = ((HybridInspectJobTriggerRequest) actualRequests.get(0));
    Assert.assertEquals(name, actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : HybridInspectJobTriggerRequest(com.google.privacy.dlp.v2.HybridInspectJobTriggerRequest) AbstractMessage(com.google.protobuf.AbstractMessage) HybridInspectResponse(com.google.privacy.dlp.v2.HybridInspectResponse) ByteString(com.google.protobuf.ByteString) Test(org.junit.Test)

Example 3 with HybridInspectResponse

use of com.google.privacy.dlp.v2.HybridInspectResponse in project java-dlp by googleapis.

the class DlpServiceClientTest method hybridInspectDlpJobTest.

@Test
public void hybridInspectDlpJobTest() throws Exception {
    HybridInspectResponse expectedResponse = HybridInspectResponse.newBuilder().build();
    mockDlpService.addResponse(expectedResponse);
    DlpJobName name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]");
    HybridInspectResponse actualResponse = client.hybridInspectDlpJob(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockDlpService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    HybridInspectDlpJobRequest actualRequest = ((HybridInspectDlpJobRequest) actualRequests.get(0));
    Assert.assertEquals(name.toString(), actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : AbstractMessage(com.google.protobuf.AbstractMessage) DlpJobName(com.google.privacy.dlp.v2.DlpJobName) HybridInspectDlpJobRequest(com.google.privacy.dlp.v2.HybridInspectDlpJobRequest) HybridInspectResponse(com.google.privacy.dlp.v2.HybridInspectResponse) Test(org.junit.Test)

Example 4 with HybridInspectResponse

use of com.google.privacy.dlp.v2.HybridInspectResponse in project java-dlp by googleapis.

the class DlpServiceClientTest method hybridInspectJobTriggerTest.

@Test
public void hybridInspectJobTriggerTest() throws Exception {
    HybridInspectResponse expectedResponse = HybridInspectResponse.newBuilder().build();
    mockDlpService.addResponse(expectedResponse);
    JobTriggerName name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]");
    HybridInspectResponse actualResponse = client.hybridInspectJobTrigger(name);
    Assert.assertEquals(expectedResponse, actualResponse);
    List<AbstractMessage> actualRequests = mockDlpService.getRequests();
    Assert.assertEquals(1, actualRequests.size());
    HybridInspectJobTriggerRequest actualRequest = ((HybridInspectJobTriggerRequest) actualRequests.get(0));
    Assert.assertEquals(name.toString(), actualRequest.getName());
    Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Also used : HybridInspectJobTriggerRequest(com.google.privacy.dlp.v2.HybridInspectJobTriggerRequest) AbstractMessage(com.google.protobuf.AbstractMessage) HybridInspectResponse(com.google.privacy.dlp.v2.HybridInspectResponse) JobTriggerName(com.google.privacy.dlp.v2.JobTriggerName) Test(org.junit.Test)

Aggregations

HybridInspectResponse (com.google.privacy.dlp.v2.HybridInspectResponse)4 AbstractMessage (com.google.protobuf.AbstractMessage)4 Test (org.junit.Test)4 HybridInspectDlpJobRequest (com.google.privacy.dlp.v2.HybridInspectDlpJobRequest)2 HybridInspectJobTriggerRequest (com.google.privacy.dlp.v2.HybridInspectJobTriggerRequest)2 ByteString (com.google.protobuf.ByteString)2 DlpJobName (com.google.privacy.dlp.v2.DlpJobName)1 JobTriggerName (com.google.privacy.dlp.v2.JobTriggerName)1