From 98c01a0c07534d6021347581168d3f74ce174e79 Mon Sep 17 00:00:00 2001 From: psemenkov Date: Mon, 30 Jan 2023 17:00:41 +0300 Subject: [PATCH] fixing bug. --- .../service/BankAccountServiceTest.java | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/clearing-parent/account-service/src/test/java/ru/spcex/clearing/account/service/BankAccountServiceTest.java b/clearing-parent/account-service/src/test/java/ru/spcex/clearing/account/service/BankAccountServiceTest.java index 10cc195e0..c1620229c 100644 --- a/clearing-parent/account-service/src/test/java/ru/spcex/clearing/account/service/BankAccountServiceTest.java +++ b/clearing-parent/account-service/src/test/java/ru/spcex/clearing/account/service/BankAccountServiceTest.java @@ -17,7 +17,10 @@ import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; import ru.clearing.classes.statics.data.account.BankAccount; +import ru.spcex.clearing.account.config.ErrorResolverConfig; import ru.spcex.clearing.account.config.HazelcastServiceTestConfiguration; +import ru.spcex.clearing.account.config.ValidationConfig; +import ru.spcex.clearing.account.utils.ImapEvent; import ru.spcex.clearing.account.utils.MatcherFactory.Matcher; import ru.spcex.clearing.imdg.IMDGDistributedNames; import ru.spcex.clearing.platform.messaging.domain.ActionType; @@ -27,10 +30,14 @@ import ru.spcex.clearing.platform.messaging.domain.cud.account.BankAccountNewReq import ru.spcex.clearing.platform.messaging.domain.cud.account.BankAccountUpdateRequest; import ru.spcex.clearing.platform.messaging.domain.cud.common.CommonDeleteRequest; import ru.spcex.platform.imdg.iml.hazelcast.service.HazelcastService; +import ru.spcex.platform.utils.enumeration.IMessageResolver; +import ru.spcex.platform.utils.validation.IValidator; import java.util.Collections; import java.util.HashMap; +import java.util.function.Function; +import static org.junit.jupiter.api.Assertions.assertTrue; import static ru.spcex.clearing.account.utils.MatcherFactory.usingIgnoringFieldsComparator; @ExtendWith(SpringExtension.class) @@ -48,6 +55,13 @@ public class BankAccountServiceTest { @Autowired @Qualifier("hazelcastServiceTest") private HazelcastService hazelcastServiceTest; + + @Autowired + private IMessageResolver messageResolver; + + @Autowired + private Function bankAccountNewRequestValidator; + private MockConsumer mockConsumer; private MockProducer mockProducer; @@ -110,7 +124,7 @@ public class BankAccountServiceTest { //ACT hazelcastServiceTest.waitTillReadyState(); //service set up - BankAccountService bankAccountService = new BankAccountService(mockConsumer, mockProducer, hazelcastServiceTest); + BankAccountService bankAccountService = new BankAccountService(mockConsumer, mockProducer, hazelcastServiceTest, messageResolver, bankAccountNewRequestValidator); //callbacks set up bankAccountService.afterPropertiesSet(); @@ -205,7 +219,7 @@ public class BankAccountServiceTest { hazelcastServiceTest.waitTillReadyState(); //service set up - BankAccountService bankAccountService = new BankAccountService(mockConsumer, mockProducer, hazelcastServiceTest); + BankAccountService bankAccountService = new BankAccountService(mockConsumer, mockProducer, hazelcastServiceTest, messageResolver, bankAccountNewRequestValidator); //callbacks set up bankAccountService.afterPropertiesSet(); @@ -270,7 +284,7 @@ public class BankAccountServiceTest { //ACT //service set up hazelcastServiceTest.waitTillReadyState(); - BankAccountService bankAccountService = new BankAccountService(mockConsumer, mockProducer, hazelcastServiceTest); + BankAccountService bankAccountService = new BankAccountService(mockConsumer, mockProducer, hazelcastServiceTest, messageResolver, bankAccountNewRequestValidator); //callbacks set up bankAccountService.afterPropertiesSet();