use of com.google.privacy.dlp.v2.GetDeidentifyTemplateRequest in project java-dlp by googleapis.
the class DlpServiceClientTest method getDeidentifyTemplateTest.
@Test
public void getDeidentifyTemplateTest() throws Exception {
DeidentifyTemplate expectedResponse = DeidentifyTemplate.newBuilder().setName(DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]").toString()).setDisplayName("displayName1714148973").setDescription("description-1724546052").setCreateTime(Timestamp.newBuilder().build()).setUpdateTime(Timestamp.newBuilder().build()).setDeidentifyConfig(DeidentifyConfig.newBuilder().build()).build();
mockDlpService.addResponse(expectedResponse);
DeidentifyTemplateName name = DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]");
DeidentifyTemplate actualResponse = client.getDeidentifyTemplate(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockDlpService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetDeidentifyTemplateRequest actualRequest = ((GetDeidentifyTemplateRequest) actualRequests.get(0));
Assert.assertEquals(name.toString(), actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
use of com.google.privacy.dlp.v2.GetDeidentifyTemplateRequest in project java-dlp by googleapis.
the class DlpServiceClientTest method getDeidentifyTemplateTest2.
@Test
public void getDeidentifyTemplateTest2() throws Exception {
DeidentifyTemplate expectedResponse = DeidentifyTemplate.newBuilder().setName(DeidentifyTemplateName.ofOrganizationDeidentifyTemplateName("[ORGANIZATION]", "[DEIDENTIFY_TEMPLATE]").toString()).setDisplayName("displayName1714148973").setDescription("description-1724546052").setCreateTime(Timestamp.newBuilder().build()).setUpdateTime(Timestamp.newBuilder().build()).setDeidentifyConfig(DeidentifyConfig.newBuilder().build()).build();
mockDlpService.addResponse(expectedResponse);
String name = "name3373707";
DeidentifyTemplate actualResponse = client.getDeidentifyTemplate(name);
Assert.assertEquals(expectedResponse, actualResponse);
List<AbstractMessage> actualRequests = mockDlpService.getRequests();
Assert.assertEquals(1, actualRequests.size());
GetDeidentifyTemplateRequest actualRequest = ((GetDeidentifyTemplateRequest) actualRequests.get(0));
Assert.assertEquals(name, actualRequest.getName());
Assert.assertTrue(channelProvider.isHeaderSent(ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), GaxGrpcProperties.getDefaultApiClientHeaderPattern()));
}
Aggregations