Skip to content

Commit f99f1e6

Browse files
jabubakelesv
authored andcommitted
DLP dependency update, fix tests (GoogleCloudPlatform#776)
1 parent 53415b7 commit f99f1e6

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ before_install:
4444
&& set +x && source secrets.env && set -x
4545
|| true
4646
# Cross project - GOOGLE_APPLICATION_CREDENTIALS uses cloud-docs-tests, but BQ uses G_C_P (argh!)
47-
- export GOOGLE_CLOUD_PROJECT=java-docs-samples-tests
47+
- export GOOGLE_CLOUD_PROJECT=java-docs-samples-testing
4848
# Skip the install step, since Maven will download the dependencies we need
4949
# when the test build runs.
5050
# http://stackoverflow.com/q/31945809/101923

dlp/pom.xml

+1-18
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,12 @@
3737
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3838
</properties>
3939

40-
<!-- Temporary workaround for known issue : https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2192 -->
41-
<dependencyManagement>
42-
<dependencies>
43-
<dependency>
44-
<groupId>com.google.auth</groupId>
45-
<artifactId>google-auth-library-credentials</artifactId>
46-
<version>${google.auth.version}</version>
47-
</dependency>
48-
<dependency>
49-
<groupId>com.google.auth</groupId>
50-
<artifactId>google-auth-library-oauth2-http</artifactId>
51-
<version>${google.auth.version}</version>
52-
</dependency>
53-
</dependencies>
54-
</dependencyManagement>
55-
<!--- End of workaround -->
56-
5740
<dependencies>
5841
<!-- [START dlp_maven] -->
5942
<dependency>
6043
<groupId>com.google.cloud</groupId>
6144
<artifactId>google-cloud-dlp</artifactId>
62-
<version>0.20.3-alpha</version>
45+
<version>0.21.0-alpha</version>
6346
</dependency>
6447
<!-- [END dlp_maven] -->
6548
<dependency>

dlp/src/main/java/com/example/dlp/Inspect.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515

1616
package com.example.dlp;
1717

18-
import com.google.api.gax.grpc.OperationFuture;
18+
import com.google.api.gax.rpc.OperationFuture;
1919
import com.google.cloud.ServiceOptions;
2020
import com.google.cloud.dlp.v2beta1.DlpServiceClient;
21+
import com.google.longrunning.Operation;
2122
import com.google.privacy.dlp.v2beta1.CloudStorageOptions;
2223
import com.google.privacy.dlp.v2beta1.CloudStorageOptions.FileSet;
2324
import com.google.privacy.dlp.v2beta1.ContentItem;
@@ -226,7 +227,7 @@ private static void inspectGcsFile(String bucketName, String fileName,
226227
OutputStorageConfig outputConfig = OutputStorageConfig.getDefaultInstance();
227228

228229
// asynchronously submit an inspect operation
229-
OperationFuture<InspectOperationResult, InspectOperationMetadata> responseFuture =
230+
OperationFuture<InspectOperationResult, InspectOperationMetadata, Operation> responseFuture =
230231
dlpServiceClient.createInspectOperationAsync(inspectConfig, storageConfig, outputConfig);
231232

232233
// ...
@@ -291,7 +292,7 @@ private static void inspectDatastore(String projectId, String namespaceId, Strin
291292
OutputStorageConfig outputConfig = OutputStorageConfig.getDefaultInstance();
292293

293294
// asynchronously submit an inspect operation
294-
OperationFuture<InspectOperationResult, InspectOperationMetadata> responseFuture =
295+
OperationFuture<InspectOperationResult, InspectOperationMetadata, Operation> responseFuture =
295296
dlpServiceClient.createInspectOperationAsync(inspectConfig, storageConfig, outputConfig);
296297

297298
// ...

0 commit comments

Comments
 (0)