3838import java .io .IOException ;
3939import java .util .List ;
4040import java .util .logging .Logger ;
41- import org .junit .AfterClass ;
41+ import org .junit .After ;
4242import org .junit .Before ;
4343import org .junit .BeforeClass ;
4444import org .junit .ClassRule ;
@@ -57,7 +57,7 @@ public class BigtableMaterializedViewIT {
5757 private static BigtableInstanceAdminClient client ;
5858 private static BigtableTableAdminClient tableAdminClient ;
5959 private static Table testTable ;
60- private static String instanceId = "" ;
60+ private String instanceId = "" ;
6161
6262 // TODO: Update this test once emulator supports InstanceAdmin operation
6363 // https://github.com/googleapis/google-cloud-go/issues/1069
@@ -73,28 +73,28 @@ public static void validatePlatform() throws IOException {
7373
7474 public static void createInstance () throws IOException {
7575 client = testEnvRule .env ().getInstanceAdminClient ();
76+ }
7677
78+ @ Before
79+ public void setUp () throws InterruptedException {
7780 instanceId = new PrefixGenerator ().newPrefix ();
7881 client .createInstance (
7982 CreateInstanceRequest .of (instanceId )
8083 .setDisplayName ("BigtableMaterializedViewIT" )
8184 .addCluster (
8285 instanceId + "-c1" , testEnvRule .env ().getPrimaryZone (), 1 , StorageType .SSD ));
8386 tableAdminClient = testEnvRule .env ().getTableAdminClientForInstance (instanceId );
87+
88+ testTable = createTestTable (tableAdminClient );
8489 }
8590
86- @ AfterClass
87- public static void deleteInstance () {
91+ @ After
92+ public void deleteInstance () {
8893 if (!instanceId .isEmpty ()) {
8994 client .deleteInstance (instanceId );
9095 }
9196 }
9297
93- @ Before
94- public void setUp () throws InterruptedException {
95- testTable = createTestTable (tableAdminClient );
96- }
97-
9898 @ Test
9999 public void createMaterializedViewAndGetMaterializedViewTest () {
100100 String materializedViewId = prefixGenerator .newPrefix ();
0 commit comments