File tree 1 file changed +6
-1
lines changed
spanner/cloud-client/src/test/java/com/example/spanner
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 25
25
26
26
import java .io .ByteArrayOutputStream ;
27
27
import java .io .PrintStream ;
28
+ import java .util .UUID ;
28
29
import org .junit .After ;
29
30
import org .junit .Before ;
30
31
import org .junit .Test ;
39
40
public class SpannerSampleIT {
40
41
// The instance needs to exist for tests to pass.
41
42
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" ) );
43
44
DatabaseId dbId ;
44
45
DatabaseAdminClient dbClient ;
45
46
private long lastUpdateDataTimeInMillis ;
@@ -116,4 +117,8 @@ public void testSample() throws Exception {
116
117
out = runSample ("readonlytransaction" );
117
118
assertThat (out .replaceAll ("[\r \n ]+" , " " )).containsMatch ("(Total Junk.*){2}" );
118
119
}
120
+
121
+ private String formatForTest (String name ) {
122
+ return name + "-" + UUID .randomUUID ().toString ().substring (0 , 20 );
123
+ }
119
124
}
You can’t perform that action at this time.
0 commit comments