Skip to content

Commit

Permalink
changes in test class
Browse files Browse the repository at this point in the history
Signed-off-by: Neha Farheen <[email protected]>
  • Loading branch information
Neha Farheen committed Mar 14, 2024
1 parent e2f0ac1 commit 2c8a609
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,24 @@
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.Errors;
import org.springframework.validation.beanvalidation.SpringValidatorAdapter;
import org.springframework.web.context.WebApplicationContext;

import com.fasterxml.jackson.databind.ObjectMapper;

import io.mosip.authentication.common.service.config.IDAMappingConfig;
import io.mosip.authentication.common.service.helper.IdInfoHelper;
import io.mosip.authentication.common.service.impl.match.DemoMatchType;
import io.mosip.authentication.common.service.integration.MasterDataManager;
import io.mosip.authentication.common.service.util.EnvUtil;
import io.mosip.authentication.common.service.validator.AuthRequestValidator;
import io.mosip.authentication.core.indauth.dto.EkycAuthRequestDTO;
import io.mosip.authentication.core.indauth.dto.IdType;
import io.mosip.authentication.core.indauth.dto.IdentityDTO;
import io.mosip.authentication.core.indauth.dto.IdentityInfoDTO;
import io.mosip.authentication.core.indauth.dto.EkycAuthRequestDTO;
import io.mosip.authentication.core.indauth.dto.RequestDTO;
import io.mosip.authentication.core.spi.indauth.match.IdInfoFetcher;
import io.mosip.kernel.logger.logback.appender.RollingFileAppender;
import io.mosip.kernel.pinvalidator.impl.PinValidatorImpl;

Expand All @@ -55,6 +52,7 @@
@WebMvcTest
@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class })
@Import(EnvUtil.class)
@TestPropertySource(locations="classpath:application.properties")
public class KycAuthRequestValidatorTest {

@Mock
Expand All @@ -65,8 +63,7 @@ public class KycAuthRequestValidatorTest {

@InjectMocks
RollingFileAppender appender;



@InjectMocks
KycAuthRequestValidator KycAuthRequestValidator;

Expand All @@ -78,21 +75,12 @@ public class KycAuthRequestValidatorTest {

@Mock
PinValidatorImpl pinValidator;

@Mock
private ObjectMapper objectMapper;

@Autowired
EnvUtil env;

@Mock
private MasterDataManager masterDataManager;

@Mock
private IDAMappingConfig idMappingConfig;

@Mock
private IdInfoFetcher idInfoFetcher;

@Before
public void before() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package io.mosip.authentication.service.kyc.validator;

import io.mosip.authentication.common.service.util.EnvUtil;
import io.mosip.authentication.core.indauth.dto.KycAuthRequestDTO;
import io.mosip.authentication.core.indauth.dto.VciCredentialsDefinitionRequestDTO;
import io.mosip.authentication.core.indauth.dto.VciExchangeRequestDTO;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.time.Instant;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -13,24 +17,23 @@
import org.springframework.context.annotation.Import;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.validation.BeanPropertyBindingResult;
import org.springframework.validation.Errors;
import org.springframework.web.context.WebApplicationContext;

import java.time.Instant;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import io.mosip.authentication.common.service.util.EnvUtil;
import io.mosip.authentication.core.indauth.dto.KycAuthRequestDTO;
import io.mosip.authentication.core.indauth.dto.VciCredentialsDefinitionRequestDTO;
import io.mosip.authentication.core.indauth.dto.VciExchangeRequestDTO;

@RunWith(SpringRunner.class)
@WebMvcTest
@ContextConfiguration(classes = { TestContext.class, WebApplicationContext.class })
@Import(EnvUtil.class)
@TestPropertySource(locations="classpath:application.properties")
public class VciExchangeRequestValidatorTest {

@InjectMocks
Expand Down

0 comments on commit 2c8a609

Please sign in to comment.