Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dad9933

Browse files
committed
Fix test failures
1 parent 0345d20 commit dad9933

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

plugins/storage/volume/scaleio/src/test/java/org/apache/cloudstack/storage/datastore/lifecycle/ScaleIOPrimaryDataStoreLifeCycleTest.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import static org.mockito.ArgumentMatchers.any;
2424
import static org.mockito.ArgumentMatchers.anyLong;
2525
import static org.mockito.ArgumentMatchers.anyMap;
26-
import static org.mockito.ArgumentMatchers.eq;
2726
import static org.mockito.Mockito.lenient;
2827
import static org.mockito.Mockito.mock;
2928
import static org.mockito.Mockito.mockStatic;
@@ -65,7 +64,6 @@
6564
import com.cloud.dc.dao.DataCenterDao;
6665
import com.cloud.host.dao.HostDao;
6766
import com.cloud.hypervisor.Hypervisor;
68-
import com.cloud.storage.DataStoreRole;
6967
import com.cloud.storage.StorageManager;
7068
import com.cloud.storage.StorageManagerImpl;
7169
import com.cloud.storage.StoragePoolAutomation;
@@ -129,9 +127,8 @@ public void tearDown() throws Exception {
129127
}
130128

131129
@Test
132-
public void testAttachZone() throws Exception {
130+
public void testAttachZone() {
133131
final DataStore dataStore = mock(DataStore.class);
134-
when(dataStore.getId()).thenReturn(1L);
135132

136133
MockedStatic<ScaleIOGatewayClientConnectionPool> scaleIOGatewayClientConnectionPoolMocked = mockStatic(ScaleIOGatewayClientConnectionPool.class);
137134
ScaleIOGatewayClientImpl client = mock(ScaleIOGatewayClientImpl.class);
@@ -152,12 +149,6 @@ public void testAttachZone() throws Exception {
152149
when(resourceManager.getEligibleUpAndEnabledHostsInZoneForStorageConnection(dataStore, scope.getScopeId(), Hypervisor.HypervisorType.KVM))
153150
.thenReturn(Arrays.asList(host1, host2));
154151

155-
when(dataStoreMgr.getDataStore(anyLong(), eq(DataStoreRole.Primary))).thenReturn(store);
156-
when(store.isShared()).thenReturn(true);
157-
when(store.getStorageProviderName()).thenReturn(ScaleIOUtil.PROVIDER_NAME);
158-
159-
when(dataStoreProviderMgr.getDataStoreProvider(ScaleIOUtil.PROVIDER_NAME)).thenReturn(dataStoreProvider);
160-
when(dataStoreProvider.getName()).thenReturn(ScaleIOUtil.PROVIDER_NAME);
161152
storageMgr.registerHostListener(ScaleIOUtil.PROVIDER_NAME, hostListener);
162153

163154
when(dataStoreHelper.attachZone(Mockito.any(DataStore.class))).thenReturn(null);

0 commit comments

Comments
 (0)