This is the IDVController Class.
package com.sc.we.idv.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.sc.we.idv.common.model.BiometricVerificationRequest;
import com.sc.we.idv.common.model.BiometricVerificationResponse;
import com.sc.we.idv.common.model.InitializeRequest;
import com.sc.we.idv.common.model.InitializeResponse;
import com.sc.we.idv.common.model.LivelinessRequest;
import com.sc.we.idv.common.model.LivelinessResponse;
import com.sc.we.idv.common.model.ServiceInfo;
import com.sc.we.idv.config.IDVConfig;
import com.sc.we.idv.config.SharedConfig;
import com.sc.we.idv.logger.LoggerContextService;
import com.sc.we.idv.model.CvRequest;
import com.sc.we.idv.model.CvResponse;
import com.sc.we.idv.model.DemographicRequest;
import com.sc.we.idv.model.DemographicResponse;
import com.sc.we.idv.model.EnquiryRequest;
import com.sc.we.idv.model.EnquiryResponse;
import com.sc.we.idv.model.IDVBO;
import com.sc.we.idv.model.converter.DemographicRequestToIDVBOConverter;
import com.sc.we.idv.model.converter.LivelinessRequestToIDVBOConverter;
import com.sc.we.idv.service.IDVService;
import com.sc.we.idv.utils.RequestFieldValidator;
import com.sc.we.idv.model.VerificationResult;

import static com.sc.we.idv.common.constants.IDVConstants.*;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


@RestController
@RequestMapping("${context.path}")
public class IDVController {
	
	private static Logger log = LoggerFactory.getLogger(IDVController.class);
	
	@Autowired
	private LoggerContextService loggerContextService;

	@Autowired
	private IDVService idvService;
	
	@Autowired
	private RequestFieldValidator requestFieldValidator;
	
	@Autowired
	private IDVConfig config;
	
	@Value("${stub.enabled}")
    private boolean isStubEnabled;

	@Value("${cv.mockresponse.enable}")
	private boolean isCVMockResponseEnabled;
	
	@Autowired
	private SharedConfig sharedConfig;

	@PostMapping("/getDemographics")
	public ResponseEntity<DemographicResponse> getDemographics(@RequestBody DemographicRequest request) throws Exception {
		log.info("------------------Inside IDVController getDemographics------------------");
		loggerContextService.logAPIStart(request);
		requestFieldValidator.validateGetDemographicsRequest(request);
		DemographicRequestToIDVBOConverter conveter = new DemographicRequestToIDVBOConverter();
		IDVBO idvBO = conveter.convertReqToBusinessObject(request);
		DemographicResponse res = idvService.getDemographics(idvBO);
		loggerContextService.logAPIEnd();
		log.info("------------------Exiting IDVController getDemographics------------------");
		return new ResponseEntity<DemographicResponse>(res, HttpStatus.OK);
	}

	@PostMapping("/initialize")
	public ResponseEntity<InitializeResponse> initialize(@RequestHeader(value = "stub", required = false, defaultValue = "n") String stubHeader, @RequestBody InitializeRequest request) throws Exception {
		log.info("--------------Inside Initialize API-----------------");
		sharedConfig.setShouldStubInitialize(false);
		if(config.getEnvironment().equalsIgnoreCase("dev") || isStubEnabled && "y".equalsIgnoreCase(stubHeader) && config.isStubEnabled(request.getInternalInfo().getSourceCountry(),
				request.getInternalInfo().getSystemIdentifier())) {
			log.info("--------------Stubbing Initialize response-----------------");
			sharedConfig.setShouldStubInitialize(true);
		}
		loggerContextService.logAPIStart(request);
		requestFieldValidator.validateInitializeRequest(request);
		InitializeResponse initialize = idvService.initialize(request);
		loggerContextService.logAPIEnd();
		log.info("------------------Exiting IDVController Initialize API------------------");
		return new ResponseEntity<InitializeResponse>(initialize, HttpStatus.OK);

	}

	@PostMapping("/verify/customer")
	public ResponseEntity<CvResponse> verifyCustomer(@RequestBody CvRequest cvRequest) throws Exception {
		log.info("--------------Inside Customer Verification API-----------------");
		loggerContextService.logAPIStart(cvRequest);
		RequestFieldValidator.validateMandatoryFieldsCustomerVerificationAPI(cvRequest);
		requestFieldValidator.invalidAttrtibutesCustomerVerification(cvRequest);
		CvResponse cvResponse = null;
		cvResponse = idvService.verifyCustomerData(cvRequest);
		
		if(isCVMockResponseEnabled && config.isCVMockResponseEnabled(cvRequest.getInternalInfo().getSourceCountry(),
			cvRequest.getInternalInfo().getSystemIdentifier())) {
			cvResponse = buildMockResponse(cvRequest.getServiceInfo());
		}
		loggerContextService.logAPIEnd();
		log.info("--------------Exiting IDVController Customer Verification API-----------------");
		return new ResponseEntity<CvResponse>(cvResponse, HttpStatus.OK);
	}
	 
	private CvResponse buildMockResponse(ServiceInfo serviceInfo) {
		CvResponse res = new CvResponse();
		res.setServiceInfo(serviceInfo);
		res.setVerificationResult(buildVerificationResult());
		return res;
	}	
	 	
	private VerificationResult buildVerificationResult() {
		VerificationResult res = new VerificationResult();
		res.overallStatus(VERIFICATION_STATUS_SUCCESS);
		Timestamp timeStamp = new Timestamp(new Date().getTime());
		res.verificationDateTime(timeStamp.toString());
		res.setDocumentVerification(VERIFICATION_STATUS_SUCCESS);
		res.setFacialMatchResult(VERIFICATION_STATUS_SUCCESS);
		res.setPoiMatchStatus(VERIFICATION_STATUS_SUCCESS);
		res.setPoiFailureReason(getEmptyList());
		res.setNameOfVerification(VERIFICATION_STATUS_SUCCESS);
		res.setDateOfBirthVerification(VERIFICATION_STATUS_SUCCESS);
		res.setIdNumberVerification(VERIFICATION_STATUS_SUCCESS);
		res.setPoaMatchStatus(VERIFICATION_STATUS_SUCCESS);
		res.setPoaFailureReason(getEmptyList());
		res.setDocumentFacialFailureReason(getEmptyList());
		return res;
	}
 
	private List<String> getEmptyList() {
		List<String> list = new ArrayList<String>();
		list.add("");
		return list;
	}	 
	 

	@PostMapping("/enquiry")
    public ResponseEntity<EnquiryResponse> handleEnquiryRequest(@RequestBody EnquiryRequest request) throws Exception {
		log.info("--------------Inside Enquiry API-----------------");
		RequestFieldValidator.validateMandatoryFieldsEnquiry(request);
		requestFieldValidator.invalidAttrtibutesEnquiry(request);
		EnquiryResponse response = idvService.enquiryIDV(request);
		if(isCVMockResponseEnabled && config.isCVMockResponseEnabled(request.getInternalInfo().getSourceCountry(),
			request.getInternalInfo().getSystemIdentifier())) {
			CvResponse cvResponse = buildMockResponse(request.getServiceInfo());
			response.setVerificationResult(cvResponse.getVerificationResult());
		}
		log.info("--------------Exiting IDVController Enquiry API-----------------");
		return new ResponseEntity<EnquiryResponse>(response, HttpStatus.OK);
		
	}
	
	@PostMapping("/verify/biometric")
	public ResponseEntity<BiometricVerificationResponse> verifyFingerPrint(
			@RequestBody BiometricVerificationRequest request) throws Exception {
		log.info("--------------Starting Fingerprint verification API-----------------");
		requestFieldValidator.validateBiometricVerificationRequest(request);
		BiometricVerificationResponse response = idvService.verifyFingerPrint(request);
		log.info("--------------Exiting Fingerprint verification API-----------------");
		return new ResponseEntity<BiometricVerificationResponse>(response, HttpStatus.OK);
	}
	
	@PostMapping("/verify/liveliness")
	public ResponseEntity<LivelinessResponse> verifyFaceMatch(@RequestBody LivelinessRequest request) throws Exception {
		log.info("--------------Starting Liveliness API-----------------");
		RequestFieldValidator.validateMandatoryFieldsLiveliness(request);
		requestFieldValidator.validateLivelinessVerificationRequest(request);
		LivelinessRequestToIDVBOConverter converter = new LivelinessRequestToIDVBOConverter();
		IDVBO idvBo = converter.convertLivelinessRequestToIDVBO(request);
		LivelinessResponse response = idvService.verifyFaceMatch(idvBo);
		log.info("--------------Exiting Liveliness API-----------------");
		return new ResponseEntity<LivelinessResponse>(response, HttpStatus.OK);
	}
	
}

This is the IDVController JUnit test class:
package com.sc.we.idv.controller;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.when;

import java.util.List;
import java.util.Map;

import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.springframework.core.env.Environment;
import org.springframework.http.ResponseEntity;

import com.sc.we.idv.IDVBaseTest;
import com.sc.we.idv.TestCVUtils;
import com.sc.we.idv.TestCommonUtils;
import com.sc.we.idv.common.model.BiometricVerificationRequest;
import com.sc.we.idv.common.model.BiometricVerificationResponse;
import com.sc.we.idv.common.model.InitializeRequest;
import com.sc.we.idv.common.model.InitializeResponse;
import com.sc.we.idv.common.model.LivelinessRequest;
import com.sc.we.idv.common.model.LivelinessResponse;
import com.sc.we.idv.config.IDVConfig;
import com.sc.we.idv.config.IdTypeConfig;
import com.sc.we.idv.config.SharedConfig;
import com.sc.we.idv.exceptions.ContainsInvalidCharectersException;
import com.sc.we.idv.exceptions.FieldValueNotInRangeException;
import com.sc.we.idv.exceptions.MandatoryFieldValidationException;
import com.sc.we.idv.logger.LoggerContextService;
import com.sc.we.idv.model.CvRequest;
import com.sc.we.idv.model.CvResponse;
import com.sc.we.idv.model.DemographicRequest;
import com.sc.we.idv.model.DemographicResponse;
import com.sc.we.idv.model.EnquiryRequest;
import com.sc.we.idv.model.EnquiryResponse;
import com.sc.we.idv.service.IDVService;
import com.sc.we.idv.utils.RequestFieldValidator;

public class IDVControllerTest extends IDVBaseTest {

	@Mock
	private IDVService idvService;
	
	@Mock
    private SharedConfig sharedConfig;

	@InjectMocks
	private IDVController controller;

	@Mock
	private RequestFieldValidator requestFieldValidator;

	@Mock
	private IdTypeConfig idTypeConfig;
	
	@Mock
	private IDVConfig config;
	
	@Mock
	private LoggerContextService loggerContextService;
	
	@Mock
	private Environment env;
	
	@Test
	public void testGetDemographics() throws Exception {

		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setServiceType("NEW");
		req.getServiceInfo().setAckReference("ABCD1234");
		req.getInternalInfo().setSourceCountry("VN");
		req.getCustomerDetails().setFullname("Nguyễn Trường");
		req.getCustomerDetails().setAddress("Eco space");
		req.getCustomerDetails().setCustomerPhoto("aaaa");
		req.getCustomerDetails().setDocumentNumber("A1001");
		req.getCustomerDetails().setDateOfBirth("2021-12-24");
		req.getCustomerDetails().setCustomerDetail("IVA");
		req.getCustomerDetails().setIdDetails("123");
		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		// When
		ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		// Then
		assertNotNull(res);
		assertNotNull(res.getBody());
		assertEquals(res.getBody().getIdDetails().getDocumentNumber(), "DOCNO 123");
	}

	@Test
	public void testGetDemographics_onlyMandatoryFields() throws Exception {

		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setServiceType("NEW");
		req.getInternalInfo().setSourceCountry("VN");
		req.getServiceInfo().setAckReference("ABCD1234");

		req.setCustomerDetails(null);
		req.setCustomerAuthentication(null);

		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		// When
		ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		// Then
		assertNotNull(res);
		assertNotNull(res.getBody());
		assertEquals(res.getBody().getIdDetails().getDocumentNumber(), "DOCNO 123");
	}

	@Test
	public void testEnquiry() throws Exception {

		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());

		// When
		ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);

		// Then
		assertNotNull(response);
		assertNotNull(response.getBody());
		assertEquals(response.getBody().getVerificationResult().getOverallStatus(), "Success");
	}

	@Test
	public void testGetDemographicMissingMandatoryFieldForNullFields() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setServiceType(null);
		req.getInternalInfo().setSourceCountry(null);
		req.getInternalInfo().setSystemIdentifier(null);
		req.getServiceInfo().setTransactionReference(null);
		req.getServiceInfo().setAckReference(null);

		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());
		try {
			// When
			ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals(
					"[service-type, source-country, system-identifier, transaction-reference, ack-reference] : Mandatory Fields are Missing",
					e.getMessage());
		}

	}
	
	@Test
	public void testEnquiryIncorrectServicetype() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setServiceType("Enquiry");
		
		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());
		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals(
					"[SystemIdentifier should only contain Enquiry]",
					e.getMessage());
		}
	}

	@Test
	public void testEnquiryIncorrectSystemIdentifierField() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setSystemIdentifier("05");

		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());
		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals("[SystemIdentifier should only contain 01,02,03,04]", e.getMessage());
		}
	}

	@Test
	public void testEnquiryIncorrectProductIdentifierField() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getServiceInfo().setProductIdentifier("X");

		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());
		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals("[productIdentifier  should be A,D,L,C]", e.getMessage());
		}

	}

	@Test
	public void testEnquiryMissingMandatoryFieldForNullFields() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setServiceType(null);
		request.getInternalInfo().setSourceCountry(null);
		request.getInternalInfo().setSystemIdentifier(null);
		request.getServiceInfo().setAckReference(null);
		request.getServiceInfo().setChannelReference(null);
		request.getServiceInfo().setTransactionReference(null);
		request.getServiceInfo().setVendorTransactionId(null);

		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());
		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals(
					"[service-type, source-country, system-identifier, transaction-reference, ack-reference] : Mandatory Fields are Missing",
					e.getMessage());
		}

	}

	@Test
	public void testInitializeMissingMandatoryFieldForNullFields() throws Exception {
		// Given
		InitializeRequest request = TestCommonUtils.buildInitializeRequest();
		request.getInternalInfo().setServiceType(null);
		request.getInternalInfo().setSourceCountry(null);
		request.getInternalInfo().setSystemIdentifier(null);
		request.getServiceInfo().setTransactionReference(null);
		request.getServiceInfo().setSegmentCode(null);
		request.getServiceInfo().setProductIdentifier(null);
		sharedConfig.setShouldStubInitialize(false);

		when(idvService.initialize(request)).thenReturn(TestCommonUtils.buildInitializeResponse());
		try {
			// When
			ResponseEntity<InitializeResponse> response = controller.initialize("n",request);
		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals(
					"[service-type, source-country, system-identifier, transaction-reference] : Mandatory Fields are Missing",
					e.getMessage());
		}

	}

	@Test
	public void testInitialize_onlyMandatoryFields() throws Exception {
		// Given
		InitializeRequest request = TestCommonUtils.buildInitializeRequest();
		request.setCustomerDetails(null);
		request.setSystemInfo(null);

		request.getServiceInfo().setChannelReference(null);
		request.getServiceInfo().setDeviceInfo(null);

		when(idvService.initialize(request)).thenReturn(TestCommonUtils.buildInitializeResponse());
		// When
		ResponseEntity<InitializeResponse> response = controller.initialize("n",request);

		// Then
		assertNotNull(response);
		assertNotNull(response.getBody());
	}
	
	@Test
	public void testEnquiry_onlyMandatoryFields() throws Exception {
		
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setServiceType("Enquiry");
		request.getServiceInfo().setAckReference("ABCD1234");
		request.getInternalInfo().setSourceCountry("HK");
		
		when(idvService.enquiryIDV(any())).thenReturn(TestCommonUtils.buildEnquiryResponse());
		
		// When
		ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		
		// Then
		assertNotNull(response);
		assertNotNull(response.getBody());
		assertEquals(response.getBody().getVerificationResult().getOverallStatus(), "Success");
	}

	@Test
	public void testGetDemographicsMissingMandatoryFieldForEmptyFields() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setServiceType(" ");
		req.getInternalInfo().setSourceCountry(" ");
		req.getInternalInfo().setSystemIdentifier(" ");
		req.getCustomerDetails().setDocumentNumber(" ");
		req.getServiceInfo().setVendorTransactionId(" ");
		req.getServiceInfo().setChannelReference(" ");
		req.getServiceInfo().setAckReference(" ");
		req.getServiceInfo().setVendorTransactionId(" ");
		req.getServiceInfo().setSegmentCode(" ");
		req.getServiceInfo().setProductIdentifier(" ");

		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());
		try {
			// When
			ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals(
					"[service-type, source-country, vendor-transaction-id, system-identifier, ack-reference] : Mandatory Fields are Missing",
					e.getMessage());
		}

	}

	@Test
	public void testInitializeMissingMandatoryFieldForEmptyFields() throws Exception {
		// Given
		InitializeRequest request = TestCommonUtils.buildInitializeRequest();
		request.getInternalInfo().setServiceType("");
		request.getInternalInfo().setSourceCountry("");
		request.getInternalInfo().setSystemIdentifier("");
		request.getServiceInfo().setTransactionReference("");
		request.getServiceInfo().setSegmentCode("");
		request.getServiceInfo().setProductIdentifier("");

		when(idvService.initialize(request)).thenReturn(TestCommonUtils.buildInitializeResponse());
		try {
			// When
			ResponseEntity<InitializeResponse> response = controller.initialize("n",request);
		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals(
					"[service-type, source-country, system-identifier, transaction-reference] : Mandatory Fields are Missing",
					e.getMessage());
		}

	}

	@Test
	public void testEnquiryMissingMandatoryFieldForEmptyFields() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setServiceType("");
		request.getInternalInfo().setSourceCountry("");
		request.getInternalInfo().setSystemIdentifier("");
		request.getServiceInfo().setAckReference("");
		request.getServiceInfo().setChannelReference("");
		request.getServiceInfo().setTransactionReference("");
		request.getServiceInfo().setVendorTransactionId("");

		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());
		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		} catch (MandatoryFieldValidationException e) {
			// Then
			assertEquals(
					"[service-type, source-country, system-identifier, transaction-reference, ack-reference] : Mandatory Fields are Missing",
					e.getMessage());
		}

	}

	@Test
	public void testGetDemographicsInvalidSourceCountry() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setSourceCountry("VN");
		req.getCustomerDetails().setFullname("Nguyễn Trường");
		req.getCustomerDetails().setAddress("Eco space");
		req.getCustomerDetails().setCustomerPhoto("aaaa");
		req.getCustomerDetails().setDocumentNumber("A1001");
		req.getCustomerDetails().setDateOfBirth("2021-12-24");
		req.getCustomerDetails().setCustomerDetail("IVA");
		req.getCustomerDetails().setIdDetails("123");

		doThrow(new ContainsInvalidCharectersException(req.getServiceInfo().getTransactionReference(),
				"[source-country is invalid]")).when(requestFieldValidator)
				.validateGetDemographicsRequest(any(DemographicRequest.class));
		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			// When
			controller.getDemographics(req);
		});

		// Then
		assertTrue(exception.getMessage().contains("[source-country is invalid]"));

	}

	@Test
	public void testGetDemographicsInvalidSystemIdentifier() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setSourceCountry("HK");
		req.getInternalInfo().setSystemIdentifier("09");

		doThrow(new ContainsInvalidCharectersException(req.getServiceInfo().getTransactionReference(),
				"[source-country is invalid]")).when(requestFieldValidator)
				.validateGetDemographicsRequest(any(DemographicRequest.class));
		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			// When
			controller.getDemographics(req);
		});

		// Then
		assertTrue(exception.getMessage().contains("[source-country is invalid]"));

	}

	
	@Test
	public void testGetDemographicInvalidServiceType() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setSourceCountry("HK");
		req.getInternalInfo().setServiceType("X");

		doThrow(new ContainsInvalidCharectersException(req.getServiceInfo().getTransactionReference(),
				"[source-country is invalid]")).when(requestFieldValidator)
				.validateGetDemographicsRequest(any(DemographicRequest.class));
		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			// When
			controller.getDemographics(req);
		});

		// Then
		assertTrue(exception.getMessage().contains("[source-country is invalid]"));

	}

	@Test
	public void testInitializeInvalidSourceCountry() throws Exception {
		// Given
		InitializeRequest request = TestCommonUtils.buildInitializeRequest();
		request.getInternalInfo().setSourceCountry("SG");

		doThrow(new FieldValueNotInRangeException(request.getServiceInfo().getTransactionReference(),
				"[source-country is invalid]")).when(requestFieldValidator)
				.validateInitializeRequest(any(InitializeRequest.class));
		when(idvService.initialize(request)).thenReturn(TestCommonUtils.buildInitializeResponse());

		FieldValueNotInRangeException exception = assertThrows(FieldValueNotInRangeException.class, () -> {
			// When
			controller.initialize("n",request);
		});

		// Then
		assertTrue(exception.getMessage().contains("[source-country is invalid]"));

	}

	@Test
	public void testEnquiryInvalidSourceCountry() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setSourceCountry("SG");

		doThrow(new ContainsInvalidCharectersException(request.getServiceInfo().getTransactionReference(),
				"[source-country is invalid]")).when(requestFieldValidator)
				.invalidAttrtibutesEnquiry(any(EnquiryRequest.class));
		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());

		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			// When
			controller.handleEnquiryRequest(request);
		});

		// Then
		assertTrue(exception.getMessage().contains("[source-country is invalid]"));

	}

	@Test
	public void testGetDemographicsInvalidAttributesForLengthCheck() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setSourceCountry("HKuetyd");
		req.getInternalInfo().setSystemIdentifier("1");
		req.getCustomerDetails().setDocumentNumber("mmmdnkd");
		req.getServiceInfo().setVendorTransactionId("6");
		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		try {
			// When
			ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		} catch (Exception e) {
			// Then
			assertNotEquals(2, req.getInternalInfo().getSourceCountry().length());
			assertNotEquals(2, req.getInternalInfo().getSystemIdentifier().length());
			assertEquals(7, req.getCustomerDetails().getDocumentNumber().length());
			assertEquals(1, req.getServiceInfo().getVendorTransactionId().length());
		}

	}

	@Test
	public void testInitializeInvalidAttributesForLengthCheck() throws Exception {
		// Given
		InitializeRequest request = TestCommonUtils.buildInitializeRequest();
		request.getInternalInfo().setServiceType("Newyy");
		request.getInternalInfo().setSourceCountry("HKiijtg");
		request.getInternalInfo().setSystemIdentifier("1");
		request.getServiceInfo().setChannelReference("HK20240423001");
		request.getServiceInfo().setTransactionReference("TXNREF10041");
		request.getServiceInfo().setSegmentCode("023");
		request.getServiceInfo().setProductIdentifier("DEPOSIT");
		request.getCustomerDetails().setDocumentNumber("H131685(2)");
		when(idvService.initialize(request)).thenReturn(TestCommonUtils.buildInitializeResponse());

		try {
			// When
			ResponseEntity<InitializeResponse> response = controller.initialize("n", request);

		} catch (Exception e) {
			// Then
			assertNotEquals(3, request.getInternalInfo().getServiceType().length());
			assertNotEquals(2, request.getInternalInfo().getSourceCountry().length());
			assertNotEquals(2, request.getInternalInfo().getSystemIdentifier().length());
			assertEquals(13, request.getServiceInfo().getChannelReference().length());
			assertEquals(11, request.getServiceInfo().getTransactionReference().length());
			assertEquals(3, request.getServiceInfo().getSegmentCode().length());
			assertEquals(7, request.getServiceInfo().getProductIdentifier().length());
		}
	}

	@Test
	public void testEnquiryInvalidAttributesForLengthCheck() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setServiceType("Enquiryy");
		request.getInternalInfo().setSourceCountry("HKiijtg");
		request.getInternalInfo().setSystemIdentifier("1");
		request.getServiceInfo().setAckReference("123123123");
		request.getServiceInfo().setChannelReference("HK20240423001");
		request.getServiceInfo().setTransactionReference("11111111");

		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());

		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);

		} catch (Exception e) {
			// Then
			assertNotEquals(7, request.getInternalInfo().getServiceType().length());
			assertNotEquals(2, request.getInternalInfo().getSourceCountry().length());
			assertNotEquals(2, request.getInternalInfo().getSystemIdentifier().length());
			assertEquals(9, request.getServiceInfo().getAckReference().length());
			assertEquals(13, request.getServiceInfo().getChannelReference().length());
			assertEquals(8, request.getServiceInfo().getTransactionReference().length());
		}
	}

	@Test
	public void testGetDemographicsValidateErrorMessagesforLengthMax() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setServiceType("NEW");
		req.getInternalInfo().setSourceCountry("VN");
		req.getInternalInfo().setSystemIdentifier("01");
		req.getCustomerDetails().setDocumentNumber("011");
		req.getServiceInfo().setVendorTransactionId("6");
		req.getServiceInfo().setAckReference("ABCD1234");
		req.getServiceInfo().setChannelReference("HK2024042300100000000000000000000000fgdtfgsrdgtrrsfftrughfsrdgftrf");
		req.getCustomerDetails().setFullname("Nguyễn Trường");
		req.getCustomerDetails().setAddress("Eco space");
		req.getCustomerDetails().setCustomerPhoto("aaaa");
		req.getCustomerDetails().setDateOfBirth("2021-12-24");
		req.getCustomerDetails().setCustomerDetail("IVA");
		req.getCustomerDetails().setIdDetails("123");

		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		try {
			// When
			ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		} catch (Exception e) {
			// Then
			assertEquals(
					"[source-country is invalid, source-country should not exceed 2 char, system-identifier should not exceed 2 char, document-type should not exceed 3 char, channel-reference should not exceed 35 char]",
					e.getMessage());

		}

	}

	@Test
	public void testInitializeValidateErrorMessagesforLengthMax() throws Exception {
		// Given
		InitializeRequest request = TestCommonUtils.buildInitializeRequest();
		request.getInternalInfo().setServiceType("Newtt");
		request.getInternalInfo().setSourceCountry("yfgf");
		request.getInternalInfo().setSystemIdentifier("jgfi2v");
		request.getServiceInfo().setChannelReference("HK2024042300100000000000000000000000");
		request.getServiceInfo().setSegmentCode("023");
		request.getServiceInfo().setProductIdentifier("DEPOSIT");

		when(idvService.initialize(request)).thenReturn(TestCommonUtils.buildInitializeResponse());

		try {
			// When
			ResponseEntity<InitializeResponse> response = controller.initialize("n", request);
		} catch (Exception e) {
			// Then
			assertEquals(
					"[source-country is invalid, service-type should not exceed 3 char, source-country should not exceed 2 char, system-identifier should not exceed 2 char, channel-reference should not exceed 35 char, segment-code should not exceed 2 char, product-identifier should not exceed 1 char]",
					e.getMessage());

		}

	}

	@Test
	public void testEnquiryValidateErrorMessagesforLengthMax() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setServiceType("Enquiryy");
		request.getInternalInfo().setSystemIdentifier("jgfi2v");
		request.getServiceInfo().setAckReference("123123123000000000000000000000000000000000000000000");

		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());

		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		} catch (Exception e) {
			// Then
			assertEquals(
					"[service-type should not exceed 7 char, system-identifier should not exceed 2 char, ack-reference should not exceed 50 char]",
					e.getMessage());

		}

	}

	@Test
	public void testGetDemographicsValidateErrorMessagesforMinLength() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setServiceType("NEW");
		req.getInternalInfo().setSourceCountry("VN");
		req.getInternalInfo().setSystemIdentifier("01");
		req.getCustomerDetails().setDocumentNumber("mmmdnkd");
		req.getServiceInfo().setVendorTransactionId("6");
		req.getServiceInfo().setAckReference("ABCD1234");
		req.getCustomerDetails().setFullname("Nguyễn Trường");
		req.getCustomerDetails().setAddress("Eco space");
		req.getCustomerDetails().setCustomerPhoto("aaaa");
		req.getCustomerDetails().setDateOfBirth("2021-12-24");
		req.getCustomerDetails().setCustomerDetail("IVA");
		req.getCustomerDetails().setIdDetails("123");

		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		try {
			// When
			ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		} catch (Exception e) {
			// Then
			assertEquals(
					"[source-country is invalid, source-country should be minimum 2 char, system-identifier should be minimum 2 char, document-type should not exceed 3 char]",
					e.getMessage());

		}

	}

	@Test
	public void testInitializeValidateErrorMessagesforMinLength() throws Exception {
		// Given
		InitializeRequest request = TestCommonUtils.buildInitializeRequest();
		request.getInternalInfo().setServiceType("Ne");
		request.getInternalInfo().setSourceCountry("H");
		request.getInternalInfo().setSystemIdentifier("1");

		when(idvService.initialize(request)).thenReturn(TestCommonUtils.buildInitializeResponse());

		try {
			// When
			ResponseEntity<InitializeResponse> response = controller.initialize("n", request);
		} catch (Exception e) {
			// Then
			assertEquals(
					"[source-country is invalid, service-type should be minimum 3 char, source-country should be minimum 2 char, system-identifier should be minimum 2 char]",
					e.getMessage());

		}

	}

	@Test
	public void testEnquiryValidateErrorMessagesforMinLength() throws Exception {
		// Given
		EnquiryRequest request = TestCommonUtils.buildEnquiryRequest();
		request.getInternalInfo().setServiceType("New");
		request.getInternalInfo().setSourceCountry("H");
		request.getInternalInfo().setSystemIdentifier("1");

		when(idvService.enquiryIDV(request)).thenReturn(TestCommonUtils.buildEnquiryResponse());

		try {
			// When
			ResponseEntity<EnquiryResponse> response = controller.handleEnquiryRequest(request);
		} catch (Exception e) {
			// Then
			assertEquals(
					"[service-type should be minimum 7 char, source-country should be minimum 2 char, system-identifier should be minimum 2 char, source-country is invalid]",
					e.getMessage());

		}

	}

	@Test
	public void testInitialize() throws Exception {
		// Given
		InitializeRequest req = TestCommonUtils.buildInitializeRequest();
		Map<String, List<String>> map = TestCommonUtils.buildIdTypeConfig();

		// When
		when(idvService.initialize(req)).thenReturn(TestCommonUtils.buildInitializeResponse());
		when(idTypeConfig.getProperties()).thenReturn(map);
		ResponseEntity<InitializeResponse> initializeRes = controller.initialize("n", req);

		// Then
		assertNotNull(initializeRes);
		assertNotNull(initializeRes.getBody());
		assertEquals(initializeRes.getBody().getServiceInfo().getTransactionReference(), "TXNREF1002");
	}

	@Test
	public void testVerifyCustomer() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequest();
		when(idvService.verifyCustomerData(cvRequest)).thenReturn(TestCVUtils.buildCVResponse());

		// When
		ResponseEntity<CvResponse> res = controller.verifyCustomer(cvRequest);

		// Then
		assertNotNull(res);
		assertNotNull(res.getBody());
		assertEquals(res.getBody().getVerificationResult().getOverallStatus(), "Success");
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_fullname() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("fullname");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[fullname] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_dob() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("dob");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[date-of-birth] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_id() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("id-number");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[id-number] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	
	public void testVerifyCustomerMandatoryMandatoryFieldException_servicetype() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("service-type");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[service-type] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_sourcecountry() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("source-country");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[source-country] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_systemIdentifier() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("system-identifier");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[system-identifier] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_transactionreference() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("transaction-reference");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[transaction-reference] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_ackreference() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("ack-reference");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[ack-reference] : Mandatory Fields are Missing", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerMandatoryMandatoryFieldException_combinations() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("combine");

		// when
		MandatoryFieldValidationException exception = assertThrows(MandatoryFieldValidationException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});

		// then
		assertEquals("[id-number, date-of-birth] : Mandatory Fields are Missing", exception.getMessage());
	}

	// ***************************InvalidAttrtibutesException************************************//
	@Test
	public void testVerifyCustomerInvalidAttrtibutesException_serviceType() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("InvalidAttribute");

		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[service-type should not exceed 3 char]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));
		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[service-type should not exceed 3 char]", exception.getMessage());
	}

	@Test
	public void tesVerifyCustomertInvalidAttrtibutesException_sourcecountry() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("source-country_invalid");

		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[source-country should not exceed 2 char, source-country is invalid]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));

		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[source-country should not exceed 2 char, source-country is invalid]", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerInvalidAttrtibutesException_systemIdentifier() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("system-identifier_invalid");

		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[system-identifier should not exceed 2 char]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));

		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[system-identifier should not exceed 2 char]", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerInvalidAttrtibutesException_TransactionRef() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("transaction-reference_invalid");

		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[transaction-reference should not exceed 80 char]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));

		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[transaction-reference should not exceed 80 char]", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerInvalidAttrtibutesException_acknumber() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("ack-reference_invalid");

		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[ack-reference should not exceed 50 char]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));

		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[ack-reference should not exceed 50 char]", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerInvalidAttrtibutesException_idnumber() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("Id-number_invalid");

		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[Id-number should not exceed 50 char]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));
		when(idvService.verifyCustomerData(any())).thenReturn(TestCVUtils.buildCVResponse());
		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[Id-number should not exceed 50 char]", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerInvalidAttrtibutesException_fullname() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("fullname_invalid");
		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[fullname should not exceed 150 char]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));
		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[fullname should not exceed 150 char]", exception.getMessage());
	}

	@Test
	public void testVerifyCustomerInvalidAttrtibutesException_dob() throws Exception {
		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequestException("date-of-birth_invalid");

		doThrow(new ContainsInvalidCharectersException(cvRequest.getServiceInfo().getTransactionReference(),
				"[date-of-birth should not exceed 10 char]")).when(requestFieldValidator)
				.invalidAttrtibutesCustomerVerification(any(CvRequest.class));
		// when
		ContainsInvalidCharectersException exception = assertThrows(ContainsInvalidCharectersException.class, () -> {
			controller.verifyCustomer(cvRequest);
		});
		// then
		assertEquals("[date-of-birth should not exceed 10 char]", exception.getMessage());
	}
	
	
	@Test
	public void testVerifyFingerPrint() throws Exception {
		// Given
		BiometricVerificationRequest bioauthRequest = TestCVUtils.biometricVerificationRequest();
		// When
		when(idvService.verifyFingerPrint(bioauthRequest)).thenReturn(TestCVUtils.buildBioAuthResponse());
		ResponseEntity<BiometricVerificationResponse> bioAuthResponse = controller.verifyFingerPrint(bioauthRequest);
		// then
		assertNotNull(bioAuthResponse);
		assertNotNull(bioAuthResponse.getBody());
		assertEquals(bioAuthResponse.getBody().getResponseInfo().getProcessDescription(), "Success");
	}
	
	@Test
	public void testVerifyFaceMatch() throws Exception {
		
		//Given
		LivelinessRequest request = TestCommonUtils.buildLivelinessRequest();

		// When
		when(idvService.verifyFaceMatch(any())).thenReturn(TestCommonUtils.buildLivelinessResponse());
		ResponseEntity<LivelinessResponse> responseEntity = controller.verifyFaceMatch(request);
		
		//Then
		assertNotNull(responseEntity);
		assertNotNull(responseEntity.getBody());
		assertEquals(responseEntity.getBody().getResponseInfo().getProcessStatus(), "200");
		assertEquals(responseEntity.getBody().getResponseInfo().getMatchScore(), "0.98825");
		assertEquals(responseEntity.getBody().getResponseInfo().getMatchResult(), "Match");
		
		
	}
	
	@Test
	public void testVerifyFingerprint_exception() throws Exception {
		
		//Given
		BiometricVerificationRequest request = TestCVUtils.buildBioAuthRequest();
		request.getInternalInfo().setSourceCountry("AB");
		
		doThrow(new ContainsInvalidCharectersException(request.getServiceInfo().getTransactionReference(),
				"[source-country is invalid]")).when(requestFieldValidator)
				.validateBiometricVerificationRequest(any(BiometricVerificationRequest.class));
		// when
		Exception exception = assertThrows(Exception.class, () -> {
			controller.verifyFingerPrint(request);
		});
		// then
		assertEquals("[source-country is invalid]", exception.getMessage());	
	}
	
	@Test
	public void testVerifyFaceMatch_exception() throws Exception {
		
		//Given
		LivelinessRequest request = TestCommonUtils.buildLivelinessRequest();
		request.getInternalInfo().setSourceCountry("AB");
		
		doThrow(new ContainsInvalidCharectersException(request.getServiceInfo().getTransactionReference(),
				"[source-country is invalid]")).when(requestFieldValidator)
				.validateLivelinessVerificationRequest(request);
		// when
		Exception exception = assertThrows(Exception.class, () -> {
			controller.verifyFaceMatch(request);
		});
		// then
		assertEquals("[source-country is invalid]", exception.getMessage());	
	}
	
	@Test
	public void getDemographicsSuccessTest() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getInternalInfo().setServiceType("NEW");
		req.getServiceInfo().setAckReference("ABCD1234");
		req.getInternalInfo().setSourceCountry("VN");
		req.getServiceInfo().setVerificationType("NFC");
		req.getCustomerDetails().setIdentityType("IDCARD");
		req.getCustomerDetails().setFullname("Nguyễn Trường");
		req.getCustomerDetails().setDateOfBirth("2021-12-24");
		req.getCustomerDetails().setGender("Male");
		req.getCustomerDetails().setAddress("Eco space");
		req.getCustomerDetails().setCustomerPhoto("aaaa");
		req.getCustomerDetails().setCustomerDetail("IVA");
		req.getCustomerDetails().setIdDetails("123");
		
		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		// When
		ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		// Then
		assertNotNull(res);
		assertNotNull(res.getBody());
		assertEquals(res.getBody().getIdDetails().getDocumentNumber(), "DOCNO 123");
	}
	
	@Test
	public void testVerifyCustomer_By_CVMockResponse() throws Exception {

		// Given
		CvRequest cvRequest = TestCVUtils.buildCVRequest();
		when(env.getProperty("cv.mockresponse.enable")).thenReturn("false");
		when(idvService.verifyCustomerData(cvRequest)).thenReturn(TestCVUtils.buildCVResponse());

		// When
		ResponseEntity<CvResponse> res = controller.verifyCustomer(cvRequest);

		// Then
		assertNotNull(res);
		assertNotNull(res.getBody());
		assertEquals(res.getBody().getVerificationResult().getOverallStatus(), "Success");
	}
	
	@Test
	public void getDemographicsThirdPartyInfoNullSuccessTest() throws Exception {
		// Given
		DemographicRequest req = TestCommonUtils.buildDemographicReq();
		req.getServiceInfo().setAckReference("ABCD1234");
		req.getInternalInfo().setSourceCountry("VN");
		req.getServiceInfo().setVerificationType("NFC");
		req.getCustomerDetails().setIdentityType("IDV");
		req.getCustomerDetails().setFullname("Nguyễn Trường");
		req.getCustomerDetails().setDateOfBirth("2021-12-24");
		req.getCustomerDetails().setGender("Male");
		req.getCustomerDetails().setAddress("Eco space");
		req.getCustomerDetails().setCustomerPhoto("aaaa");
		req.getCustomerDetails().setCustomerDetail("IDV");
		req.getCustomerDetails().setIdDetails("123");
		req.setThirdpartyInfo(null);
		
		when(idvService.getDemographics(any())).thenReturn(TestCommonUtils.buildDemographicResponse());

		// When
		ResponseEntity<DemographicResponse> res = controller.getDemographics(req);

		// Then
		assertNotNull(res);
		assertNotNull(res.getBody());
		assertEquals(res.getBody().getIdDetails().getDocumentNumber(), "DOCNO 123");
	}
	
	@Test
	public void testInitializeForCustometDetailsNonMandatory() throws Exception {
		// Given
		InitializeRequest req = TestCommonUtils.buildInitializeRequest();
		req.getInternalInfo().setSourceCountry("SG");
		req.getSystemInfo().setSuccessCallBackURL("http://localhost:3001/callback");
		req.setCustomerDetails(null);

		// When
		when(idvService.initialize(req)).thenReturn(TestCommonUtils.buildInitializeResponse());
		ResponseEntity<InitializeResponse> initializeRes = controller.initialize("n", req);

		// Then
		assertNotNull(initializeRes);
		assertNotNull(initializeRes.getBody());
		assertEquals(initializeRes.getBody().getServiceInfo().getTransactionReference(), "TXNREF1002");
		assertEquals(req.getSystemInfo().getSuccessCallBackURL(), "http://localhost:3001/callback");
		assertEquals(req.getCustomerDetails(), null);
	}
	
}

I am getting the bepow error. Please help to resolve it.
java.lang.NullPointerException: Cannot invoke "String.equalsIgnoreCase(String)" because the return value of "com.sc.we.idv.config.IDVConfig.getEnvironment()" is null
	at com.sc.we.idv.controller.IDVController.initialize(IDVController.java:90)
	at com.sc.we.idv.controller.IDVControllerTest.testInitializeMissingMandatoryFieldForNullFields(IDVControllerTest.java:252)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)