File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
spanner/cloud-client/src/test/java/com/example/spanner Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2525
2626import java .io .ByteArrayOutputStream ;
2727import java .io .PrintStream ;
28+ import java .util .UUID ;
2829import org .junit .After ;
2930import org .junit .Before ;
3031import org .junit .Test ;
3940public class SpannerSampleIT {
4041 // The instance needs to exist for tests to pass.
4142 private final String instanceId = System .getProperty ("spanner.test.instance" );
42- private final String databaseId = System .getProperty ("spanner.sample.database" );
43+ private final String databaseId = formatForTest ( System .getProperty ("spanner.sample.database" ) );
4344 DatabaseId dbId ;
4445 DatabaseAdminClient dbClient ;
4546 private long lastUpdateDataTimeInMillis ;
@@ -116,4 +117,8 @@ public void testSample() throws Exception {
116117 out = runSample ("readonlytransaction" );
117118 assertThat (out .replaceAll ("[\r \n ]+" , " " )).containsMatch ("(Total Junk.*){2}" );
118119 }
120+
121+ private String formatForTest (String name ) {
122+ return name + "-" + UUID .randomUUID ().toString ().substring (0 , 20 );
123+ }
119124}
You can’t perform that action at this time.
0 commit comments