Skip to content

Commit 786e764

Browse files
committed
feat(spanner): added asserts to test
1 parent 0a74b9c commit 786e764

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/DatabaseId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static DatabaseId of(String project, String instance, String database) {
9494
return new DatabaseId(new InstanceId(project, instance), database);
9595
}
9696

97-
/** Creates a {@code DatabaseId} with "default" project, given instance and database IDs. */
97+
/** Creates a {@code DatabaseId} with "default" as project id, given instance and database IDs. */
9898
public static DatabaseId of(String instance, String database) {
9999
return new DatabaseId(new InstanceId("default", instance), database);
100100
}

google-cloud-spanner/src/test/java/com/google/cloud/spanner/SessionClientTests.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,10 @@ public void testSessionNamePatterns() {
515515
// Valid pattern for external host session name
516516
String externalHost = "instances/default/databases/test-db/sessions/abcd1234";
517517
try {
518-
SessionId.of(host);
519-
SessionId.of(externalHost);
518+
SessionId hostSession = SessionId.of(host);
519+
assertEquals("abcd1234", hostSession.getName());
520+
SessionId externalHostSession = SessionId.of(externalHost);
521+
assertEquals("abcd1234", externalHostSession.getName());
520522
// If no exceptions are thrown, the test will pass
521523
} catch (IllegalArgumentException e) {
522524
fail("Expected no exception to be thrown, but got: " + e.getMessage());

0 commit comments

Comments
 (0)