Specify mock subtypes

Signed-off-by: fmdewal <fmdewal89@gmail.com>
This commit is contained in:
fmdewal 2021-09-01 04:12:38 +08:00
parent d0513cc6ce
commit 0a5c8ad7a1
2 changed files with 3 additions and 2 deletions

View File

@ -70,6 +70,7 @@ import static io.hetu.core.statestore.hazelcast.HazelcastConstants.DISCOVERY_POR
import static io.prestosql.spi.metastore.HetuErrorCode.HETU_METASTORE_CODE;
import static io.prestosql.statestore.StateStoreConstants.STATE_STORE_CONFIGURATION_PATH;
import static java.util.Collections.emptyMap;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.testng.Assert.assertEquals;
@ -135,7 +136,7 @@ public class TestHetuMetastoreGlobalCache
seeds.add(mockSeed);
SeedStoreManager mockSeedStoreManager = mock(SeedStoreManager.class);
when(mockSeedStoreManager.getSeedStore(SeedStoreSubType.HAZELCAST)).thenReturn(mockSeedStore);
when(mockSeedStoreManager.getSeedStore(any(SeedStoreSubType.class))).thenReturn(mockSeedStore);
when(mockSeed.getLocation()).thenReturn(LOCALHOST + ":" + PORT3);
when(mockSeedStore.get()).thenReturn(seeds);

View File

@ -92,7 +92,7 @@ public class TestSeedStoreManager
SeedStoreFactory mockSeedStoreFactory = mock(SeedStoreFactory.class);
when(mockSeedStoreFactory.getName()).thenReturn("filebased");
when(mockSeedStoreFactory.create(any(String.class),
SeedStoreSubType.HAZELCAST,
any(SeedStoreSubType.class),
any(HetuFileSystemClient.class),
any(Map.class))).thenReturn(mockSeedStore);
seedStoreManager.addSeedStoreFactory(mockSeedStoreFactory);