1919import org .mockito .Mock ;
2020import org .mockito .MockitoAnnotations ;
2121
22- public class CheckedDistributedStorageAdminTest {
22+ public class CommonDistributedStorageAdminTest {
2323
2424 private static final String SYSTEM_NAMESPACE = "scalardb" ;
2525
2626 @ Mock private DistributedStorageAdmin admin ;
2727 @ Mock private DatabaseConfig databaseConfig ;
2828
29- private CheckedDistributedStorageAdmin checkedAdmin ;
29+ private CommonDistributedStorageAdmin commonDistributedStorageAdmin ;
3030
3131 @ BeforeEach
3232 public void setUp () throws Exception {
3333 MockitoAnnotations .openMocks (this ).close ();
3434
3535 // Arrange
3636 when (databaseConfig .getSystemNamespaceName ()).thenReturn (SYSTEM_NAMESPACE );
37- checkedAdmin = new CheckedDistributedStorageAdmin (admin , databaseConfig );
37+ commonDistributedStorageAdmin = new CommonDistributedStorageAdmin (admin , databaseConfig );
3838 }
3939
4040 @ Test
4141 public void createNamespace_SystemNamespaceNameGiven_ShouldThrowIllegalArgumentException () {
4242 // Arrange
4343
4444 // Act Assert
45- assertThatThrownBy (() -> checkedAdmin .createNamespace (SYSTEM_NAMESPACE ))
45+ assertThatThrownBy (() -> commonDistributedStorageAdmin .createNamespace (SYSTEM_NAMESPACE ))
4646 .isInstanceOf (IllegalArgumentException .class );
4747 }
4848
@@ -51,7 +51,7 @@ public void dropNamespace_SystemNamespaceNameGiven_ShouldThrowIllegalArgumentExc
5151 // Arrange
5252
5353 // Act Assert
54- assertThatThrownBy (() -> checkedAdmin .dropNamespace (SYSTEM_NAMESPACE ))
54+ assertThatThrownBy (() -> commonDistributedStorageAdmin .dropNamespace (SYSTEM_NAMESPACE ))
5555 .isInstanceOf (IllegalArgumentException .class );
5656 }
5757
@@ -67,7 +67,7 @@ public void createTable_ShouldCallAdminProperly() throws ExecutionException {
6767 when (admin .tableExists (namespaceName , tableName )).thenReturn (true );
6868
6969 // Act
70- checkedAdmin .createTable (namespaceName , tableName , tableMetadata , options );
70+ commonDistributedStorageAdmin .createTable (namespaceName , tableName , tableMetadata , options );
7171
7272 // Assert
7373 verify (admin ).createTable (namespaceName , tableName , tableMetadata , options );
@@ -91,7 +91,9 @@ public void createTable_ShouldCallAdminProperly() throws ExecutionException {
9191
9292 // Act Assert
9393 assertThatThrownBy (
94- () -> checkedAdmin .createTable (namespaceName , tableName , tableMetadata , options ))
94+ () ->
95+ commonDistributedStorageAdmin .createTable (
96+ namespaceName , tableName , tableMetadata , options ))
9597 .isInstanceOf (UnsupportedOperationException .class );
9698 }
9799
@@ -101,7 +103,7 @@ public void namespaceExists_SystemNamespaceNameGiven_ShouldReturnTrue()
101103 // Arrange
102104
103105 // Act
104- boolean actual = checkedAdmin .namespaceExists (SYSTEM_NAMESPACE );
106+ boolean actual = commonDistributedStorageAdmin .namespaceExists (SYSTEM_NAMESPACE );
105107
106108 // Assert
107109 assertThat (actual ).isTrue ();
@@ -114,7 +116,7 @@ public void getNamespaceNames_ShouldReturnListWithSystemNamespaceName()
114116 when (admin .getNamespaceNames ()).thenReturn (Collections .emptySet ());
115117
116118 // Act
117- Set <String > actual = checkedAdmin .getNamespaceNames ();
119+ Set <String > actual = commonDistributedStorageAdmin .getNamespaceNames ();
118120
119121 // Assert
120122 assertThat (actual ).containsExactly (SYSTEM_NAMESPACE );
@@ -130,7 +132,7 @@ public void repairTable_ShouldCallAdminProperly() throws ExecutionException {
130132 Map <String , String > options = ImmutableMap .of ("name" , "value" );
131133
132134 // Act
133- checkedAdmin .repairTable (namespaceName , tableName , tableMetadata , options );
135+ commonDistributedStorageAdmin .repairTable (namespaceName , tableName , tableMetadata , options );
134136
135137 // Assert
136138 verify (admin ).repairTable (namespaceName , tableName , tableMetadata , options );
@@ -150,7 +152,9 @@ public void repairTable_ShouldCallAdminProperly() throws ExecutionException {
150152
151153 // Act Assert
152154 assertThatThrownBy (
153- () -> checkedAdmin .repairTable (namespaceName , tableName , tableMetadata , options ))
155+ () ->
156+ commonDistributedStorageAdmin .repairTable (
157+ namespaceName , tableName , tableMetadata , options ))
154158 .isInstanceOf (UnsupportedOperationException .class );
155159 }
156160}
0 commit comments