--- hz and kafka working
This commit is contained in:
parent
c9a0994fba
commit
49fe74ea60
2 changed files with 9 additions and 9 deletions
|
|
@ -9,8 +9,10 @@ import org.springframework.context.annotation.Configuration;
|
|||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import ru.spcex.platform.imdg.iml.hazelcast.config.HazelcastClientParams;
|
||||
import ru.spcex.platform.imdg.iml.hazelcast.service.HazelcastService;
|
||||
import ru.spcex.platform.imdg.iml.hazelcast.util.HazelcastHelper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@Configuration
|
||||
public class HazelcastServiceTestConfiguration {
|
||||
|
|
@ -46,6 +48,7 @@ public class HazelcastServiceTestConfiguration {
|
|||
// )
|
||||
cfg.setNetworkConfig(networkConfig);
|
||||
hazelcastInstance = Hazelcast.newHazelcastInstance(cfg);
|
||||
HazelcastHelper.otcSystem_setStorageState(true, hazelcastInstance);
|
||||
return new HazelcastService(taskExecutorHazelcastClientInitializer, taskExecutorIdGeneratorAwaiter, params);
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +68,7 @@ public class HazelcastServiceTestConfiguration {
|
|||
params.setLogin("dev");
|
||||
params.setPassword("dev-pass");
|
||||
params.setClusterMembers("127.0.0.1");
|
||||
params.setInstanceName("localhost");
|
||||
params.setInstanceName("hzTestClient" + new Random().nextInt());
|
||||
params.setNearCacheConfig(new NearCacheConfig());
|
||||
|
||||
return params;
|
||||
|
|
|
|||
|
|
@ -92,19 +92,16 @@ public class BankAccountServiceTest {
|
|||
// ArgumentCaptor<BankAccount> bankAccountCaptor = ArgumentCaptor.forClass(BankAccount.class);
|
||||
//
|
||||
// doReturn(bankAccountMap).when(imdgProvider).getImdg(IMDGDistributedNames.Map_BankAccount, BankAccount.class);
|
||||
|
||||
|
||||
//мапа которую проверял Илья
|
||||
Imdg<BankAccount> imdg = hazelcastServiceTest.getImdg(IMDGDistributedNames.Map_BankAccount, BankAccount.class);
|
||||
// IMap<Long, BankAccount> iMap = hazelcastServiceTest.getHazelcast().getMap(IMDGDistributedNames.Map_BankAccount);
|
||||
BankAccountService bankAccountService = new BankAccountService(mockConsumer, hazelcastServiceTest);
|
||||
try {
|
||||
hazelcastServiceTest.init();
|
||||
// hazelcastServiceTest.init();
|
||||
Thread.sleep(10000);
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
//мапа которую проверял Илья
|
||||
IMap<Object, Object> map = hazelcastServiceTest.getHazelcast().getMap(IMDGDistributedNames.Map_KeyRate);
|
||||
Imdg<BankAccount> imdg = hazelcastServiceTest.getImdg(IMDGDistributedNames.Map_BankAccount, BankAccount.class);
|
||||
// IMap<Long, BankAccount> iMap = hazelcastServiceTest.getHazelcast().getMap(IMDGDistributedNames.Map_BankAccount);
|
||||
BankAccountService bankAccountService = new BankAccountService(mockConsumer, hazelcastServiceTest);
|
||||
bankAccountService.afterPropertiesSet();
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue