Skip to content

Commit

Permalink
Fixed some more classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisvg committed Nov 15, 2017
1 parent 008a5cd commit f79a44f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;

import com.google.api.services.vision.v1.model.GoogleCloudVisionV1EntityAnnotation;
import com.google.api.services.vision.v1.model.EntityAnnotation;
import com.google.common.collect.ImmutableSet;

import org.junit.Before;
Expand All @@ -46,11 +46,11 @@ public class LabelAppIT {
}

@Test public void labelImage_cat_returnsCatDescription() throws Exception {
List<GoogleCloudVisionV1EntityAnnotation> labels =
List<EntityAnnotation> labels =
appUnderTest.labelImage(Paths.get("data/cat.jpg"), MAX_LABELS);

ImmutableSet.Builder<String> builder = ImmutableSet.builder();
for (GoogleCloudVisionV1EntityAnnotation label : labels) {
for (EntityAnnotation label : labels) {
builder.add(label.getDescription());
}
ImmutableSet<String> descriptions = builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import static com.google.common.truth.Truth.assertThat;

import com.google.api.services.vision.v1.model.GoogleCloudVisionV1EntityAnnotation;
import com.google.api.services.vision.v1.model.EntityAnnotation;
import com.google.common.collect.ImmutableList;

import org.junit.Test;
Expand All @@ -42,7 +42,7 @@ public class LabelAppTest {

// Act
LabelApp.printLabels(
out, Paths.get("path/to/some/image.jpg"), ImmutableList.<GoogleCloudVisionV1EntityAnnotation>of());
out, Paths.get("path/to/some/image.jpg"), ImmutableList.<EntityAnnotation>of());

// Assert
assertThat(bout.toString()).contains("No labels found.");
Expand All @@ -52,11 +52,11 @@ public class LabelAppTest {
// Arrange
ByteArrayOutputStream bout = new ByteArrayOutputStream();
PrintStream out = new PrintStream(bout);
ImmutableList<GoogleCloudVisionV1EntityAnnotation> labels =
ImmutableList<EntityAnnotation> labels =
ImmutableList.of(
new GoogleCloudVisionV1EntityAnnotation().setDescription("dog").setScore(0.7564f),
new GoogleCloudVisionV1EntityAnnotation().setDescription("husky").setScore(0.67891f),
new GoogleCloudVisionV1EntityAnnotation().setDescription("poodle").setScore(0.1233f));
new EntityAnnotation().setDescription("dog").setScore(0.7564f),
new EntityAnnotation().setDescription("husky").setScore(0.67891f),
new EntityAnnotation().setDescription("poodle").setScore(0.1233f));

// Act
LabelApp.printLabels(out, Paths.get("path/to/some/image.jpg"), labels);
Expand Down

0 comments on commit f79a44f

Please sign in to comment.