Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DLP dependency update, fix tests (still requires right service account credentials) #776

Merged
merged 1 commit into from
Jul 30, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ before_install:
&& set +x && source secrets.env && set -x
|| true
# Cross project - GOOGLE_APPLICATION_CREDENTIALS uses cloud-docs-tests, but BQ uses G_C_P (argh!)
- export GOOGLE_CLOUD_PROJECT=java-docs-samples-tests
- export GOOGLE_CLOUD_PROJECT=java-docs-samples-testing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOL - some days I'm just stupid. (missing this)

# Skip the install step, since Maven will download the dependencies we need
# when the test build runs.
# http://stackoverflow.com/q/31945809/101923
Expand Down
19 changes: 1 addition & 18 deletions dlp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,12 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<!-- Temporary workaround for known issue : https://github.com/GoogleCloudPlatform/google-cloud-java/issues/2192 -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
<version>${google.auth.version}</version>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-oauth2-http</artifactId>
<version>${google.auth.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<!--- End of workaround -->

<dependencies>
<!-- [START dlp_maven] -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-dlp</artifactId>
<version>0.20.3-alpha</version>
<version>0.21.0-alpha</version>
</dependency>
<!-- [END dlp_maven] -->
<dependency>
Expand Down
7 changes: 4 additions & 3 deletions dlp/src/main/java/com/example/dlp/Inspect.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@

package com.example.dlp;

import com.google.api.gax.grpc.OperationFuture;
import com.google.api.gax.rpc.OperationFuture;
import com.google.cloud.ServiceOptions;
import com.google.cloud.dlp.v2beta1.DlpServiceClient;
import com.google.longrunning.Operation;
import com.google.privacy.dlp.v2beta1.CloudStorageOptions;
import com.google.privacy.dlp.v2beta1.CloudStorageOptions.FileSet;
import com.google.privacy.dlp.v2beta1.ContentItem;
Expand Down Expand Up @@ -226,7 +227,7 @@ private static void inspectGcsFile(String bucketName, String fileName,
OutputStorageConfig outputConfig = OutputStorageConfig.getDefaultInstance();

// asynchronously submit an inspect operation
OperationFuture<InspectOperationResult, InspectOperationMetadata> responseFuture =
OperationFuture<InspectOperationResult, InspectOperationMetadata, Operation> responseFuture =
dlpServiceClient.createInspectOperationAsync(inspectConfig, storageConfig, outputConfig);

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

// asynchronously submit an inspect operation
OperationFuture<InspectOperationResult, InspectOperationMetadata> responseFuture =
OperationFuture<InspectOperationResult, InspectOperationMetadata, Operation> responseFuture =
dlpServiceClient.createInspectOperationAsync(inspectConfig, storageConfig, outputConfig);

// ...
Expand Down