Skip to content

Commit

Permalink
fix: process review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
olavloite committed Jan 19, 2020
1 parent cdd2cee commit 1e26496
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Expand Up @@ -38,7 +38,10 @@
*/
public final class SpannerExceptionFactory {
static final String DATABASE_NOT_FOUND_MSG =
"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";
"Database not found: projects/.*/instances/.*/databases/.*\n"
+ "resource_type: \"type.googleapis.com/google.spanner.admin.database.v1.Database\"\n"
+ "resource_name: \"projects/.*/instances/.*/databases/.*\"\n"
+ "description: \"Database does not exist.\"\n";
private static final Pattern DATABASE_NOT_FOUND_MSG_PATTERN =
Pattern.compile(".*" + DATABASE_NOT_FOUND_MSG + ".*");

Expand Down
Expand Up @@ -52,7 +52,10 @@
@RunWith(JUnit4.class)
public class DatabaseClientImplTest {
private static final String DATABASE_NOT_FOUND_FORMAT =
SpannerExceptionFactory.DATABASE_NOT_FOUND_MSG.replaceAll("\\.\\*", "%s");
"Database not found: projects/%s/instances/%s/databases/%s\n"
+ "resource_type: \"type.googleapis.com/google.spanner.admin.database.v1.Database\"\n"
+ "resource_name: \"projects/%s/instances/%s/databases/%s\"\n"
+ "description: \"Database does not exist.\"\n";
private static final String TEST_PROJECT = "my-project";
private static final String TEST_INSTANCE = "my-instance";
private static final String TEST_DATABASE = "my-database";
Expand Down
Expand Up @@ -86,6 +86,7 @@ public void databaseDeletedTest() throws Exception {
} catch (DatabaseNotFoundException e) {
// This is what we expect.
notFoundException = e;
break;
}
}
assertThat(notFoundException).isNotNull();
Expand Down

0 comments on commit 1e26496

Please sign in to comment.