Skip to content

Commit 1e26496

Browse files
committed
fix: process review comments
1 parent cdd2cee commit 1e26496

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
*/
3939
public final class SpannerExceptionFactory {
4040
static final String DATABASE_NOT_FOUND_MSG =
41-
"Database not found: projects/.*/instances/.*/databases/.*\nresource_type: \"type.googleapis.com/google.spanner.admin.database.v1.Database\"\nresource_name: \"projects/.*/instances/.*/databases/.*\"\ndescription: \"Database does not exist.\"\n";
41+
"Database not found: projects/.*/instances/.*/databases/.*\n"
42+
+ "resource_type: \"type.googleapis.com/google.spanner.admin.database.v1.Database\"\n"
43+
+ "resource_name: \"projects/.*/instances/.*/databases/.*\"\n"
44+
+ "description: \"Database does not exist.\"\n";
4245
private static final Pattern DATABASE_NOT_FOUND_MSG_PATTERN =
4346
Pattern.compile(".*" + DATABASE_NOT_FOUND_MSG + ".*");
4447

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@
5252
@RunWith(JUnit4.class)
5353
public class DatabaseClientImplTest {
5454
private static final String DATABASE_NOT_FOUND_FORMAT =
55-
SpannerExceptionFactory.DATABASE_NOT_FOUND_MSG.replaceAll("\\.\\*", "%s");
55+
"Database not found: projects/%s/instances/%s/databases/%s\n"
56+
+ "resource_type: \"type.googleapis.com/google.spanner.admin.database.v1.Database\"\n"
57+
+ "resource_name: \"projects/%s/instances/%s/databases/%s\"\n"
58+
+ "description: \"Database does not exist.\"\n";
5659
private static final String TEST_PROJECT = "my-project";
5760
private static final String TEST_INSTANCE = "my-instance";
5861
private static final String TEST_DATABASE = "my-database";

google-cloud-spanner/src/test/java/com/google/cloud/spanner/it/ITDatabaseTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ public void databaseDeletedTest() throws Exception {
8686
} catch (DatabaseNotFoundException e) {
8787
// This is what we expect.
8888
notFoundException = e;
89+
break;
8990
}
9091
}
9192
assertThat(notFoundException).isNotNull();

0 commit comments

Comments
 (0)