Skip to content

Commit 2903046

Browse files
authored
samples(test): ignore string case when comparing outputs (googleapis#1402)
1 parent 9ef89ba commit 2903046

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

samples/snippets/src/test/java/com/example/datastore/queryprofile/QueryProfileSampleIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void testQueryProfileExplain() throws Exception {
6464
QueryProfileExplain.invoke();
6565

6666
// Assert
67-
systemsOutRule.assertContains("query_scope: Collection Group");
67+
systemsOutRule.assertContains("query_scope: Collection group");
6868
systemsOutRule.assertContains("properties: (__name__ ASC)");
6969
}
7070

@@ -74,7 +74,7 @@ public void testQueryProfileExplainAggregation() throws Exception {
7474
QueryProfileExplainAggregation.invoke();
7575

7676
// Assert
77-
systemsOutRule.assertContains("query_scope: Collection Group");
77+
systemsOutRule.assertContains("query_scope: Collection group");
7878
systemsOutRule.assertContains("properties: (__name__ ASC)");
7979
}
8080

@@ -86,7 +86,7 @@ public void testQueryProfileExplainAnalyze() throws Exception {
8686
// Assert
8787
systemsOutRule.assertContains("documents_scanned:");
8888
systemsOutRule.assertContains("index_entries_scanned:");
89-
systemsOutRule.assertContains("query_scope: Collection Group");
89+
systemsOutRule.assertContains("query_scope: Collection group");
9090
systemsOutRule.assertContains("Entity: Entity{key=");
9191
}
9292

@@ -98,7 +98,7 @@ public void testQueryProfileExplainAnalyzeAggregation() throws Exception {
9898
// Assert
9999
systemsOutRule.assertContains("index_entries_scanned:");
100100
systemsOutRule.assertContains("documents_scanned:");
101-
systemsOutRule.assertContains("query_scope: Collection Group");
101+
systemsOutRule.assertContains("query_scope: Collection group");
102102
systemsOutRule.assertContains("Count: 2");
103103
}
104104
}

samples/snippets/src/test/java/com/rule/SystemsOutRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ public void evaluate() throws Throwable {
4848
}
4949

5050
public void assertContains(String content) {
51-
assertThat(currentOut.toString()).contains(content);
51+
assertThat(currentOut.toString().toLowerCase()).contains(content.toLowerCase());
5252
}
5353
}

0 commit comments

Comments
 (0)