From 3d36c3fcbad1c7b341bc56467b3f51bd6cc6636e Mon Sep 17 00:00:00 2001 From: Burke Davison <40617934+burkedavison@users.noreply.github.com> Date: Mon, 20 Mar 2023 11:20:12 -0400 Subject: [PATCH] chore: change google-cloud-vision ITSystemTest to fuzzy Palace of Fine Arts assertions (#9255) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: change google-cloud-vision ITSystemTest to fuzzy Palace of Fine Arts assertions * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- java-vision/README.md | 8 +++----- .../com/google/cloud/vision/it/ITSystemTest.java | 15 ++++++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/java-vision/README.md b/java-vision/README.md index 0de8e98be0c1..5304f794818b 100644 --- a/java-vision/README.md +++ b/java-vision/README.md @@ -14,7 +14,6 @@ Java idiomatic client for [Cloud Vision][product-docs]. If you are using Maven, add this to your pom.xml file: - ```xml @@ -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" ``` - ## Authentication @@ -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 @@ -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 diff --git a/java-vision/google-cloud-vision/src/test/java/com/google/cloud/vision/it/ITSystemTest.java b/java-vision/google-cloud-vision/src/test/java/com/google/cloud/vision/it/ITSystemTest.java index 890579508ac5..08d2c48b44ab 100644 --- a/java-vision/google-cloud-vision/src/test/java/com/google/cloud/vision/it/ITSystemTest.java +++ b/java-vision/google-cloud-vision/src/test/java/com/google/cloud/vision/it/ITSystemTest.java @@ -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 @@ -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 @@ -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 @@ -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 @@ -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