Skip to content

chore: change google-cloud-vision ITSystemTest to fuzzy Palace of Fine Arts assertions #9255

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

Merged
merged 2 commits into from
Mar 20, 2023
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
8 changes: 3 additions & 5 deletions java-vision/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Java idiomatic client for [Cloud Vision][product-docs].

If you are using Maven, add this to your pom.xml file:

<!-- {x-version-update-start:google-cloud-vision:released} -->

```xml
<dependency>
Expand All @@ -35,7 +34,6 @@ If you are using SBT, add this to your dependencies:
```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-vision" % "3.11.0"
```
<!-- {x-version-update-end} -->

## Authentication

Expand All @@ -52,7 +50,7 @@ The client application making API calls must be granted [authorization scopes][a
You will need a [Google Cloud Platform Console][developer-console] project with the Cloud Vision [API enabled][enable-api].
You will need to [enable billing][enable-billing] to use Google Cloud Vision.
[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by
[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line:
[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line:
`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`.

### Installation and setup
Expand Down Expand Up @@ -173,14 +171,14 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-stable-green
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-vision.svg
[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-vision&core=gav
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-vision/3.11.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy
[developer-console]: https://console.developers.google.com/
[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
[cloud-sdk]: https://cloud.google.com/sdk/
[cloud-cli]: https://cloud.google.com/cli
[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting
[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md
[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ public void detectLandmarksTest() throws IOException {
for (EntityAnnotation annotation : assertNotEmpty(res, res.getLandmarkAnnotationsList())) {
actual.add(annotation.getDescription());
}
assertThat(actual).contains("Palace of Fine Arts");
String allAnnotations = String.join(";", actual);
assertThat(allAnnotations).ignoringCase().contains("Palace of Fine Arts");
}

@Test
Expand All @@ -355,7 +356,8 @@ public void detectLandmarksUrlTest() throws Exception {
for (EntityAnnotation annotation : assertNotEmpty(res, res.getLandmarkAnnotationsList())) {
actual.add(annotation.getDescription());
}
assertThat(actual).contains("Palace of Fine Arts");
String allAnnotations = String.join(";", actual);
assertThat(allAnnotations).ignoringCase().contains("Palace of Fine Arts");
}

@Test
Expand All @@ -366,7 +368,8 @@ public void detectLandmarksGcsTest() throws IOException {
for (EntityAnnotation annotation : assertNotEmpty(res, res.getLandmarkAnnotationsList())) {
actual.add(annotation.getDescription());
}
assertThat(actual).contains("Palace of Fine Arts");
String allAnnotations = String.join(";", actual);
assertThat(allAnnotations).ignoringCase().contains("Palace of Fine Arts");
}

@Test
Expand Down Expand Up @@ -476,7 +479,8 @@ public void detectWebEntitiesGcsTest() {
assertNotEmpty(res, res.getWebDetection().getWebEntitiesList())) {
actual.add(entity.getDescription());
}
assertThat(actual).contains("Palace of Fine Arts");
String allAnnotations = String.join(";", actual);
assertThat(allAnnotations).ignoringCase().contains("Palace of Fine Arts");
}

@Test
Expand Down Expand Up @@ -531,7 +535,8 @@ public void detectWebEntitiesIncludeGeoResultsGcsTest() {
assertNotEmpty(res, res.getWebDetection().getWebEntitiesList())) {
actual.add(entity.getDescription());
}
assertThat(actual).contains("Palace of Fine Arts");
String allAnnotations = String.join(";", actual);
assertThat(allAnnotations).ignoringCase().contains("Palace of Fine Arts");
}

@Test
Expand Down