This is my zolozClient class.
package com.sc.we.idv.plugin.client.zoloz;

import java.io.FileNotFoundException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.net.URLEncoder;
import java.util.Map;
import java.util.stream.Collectors;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.HttpServerErrorException.ServiceUnavailable;
import org.springframework.web.client.RestTemplate;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectWriter;
import com.fasterxml.jackson.databind.json.JsonMapper;
import com.sc.we.idv.common.constants.IDVConstants;
import com.sc.we.idv.common.utils.Utils;
import com.sc.we.idv.config.SharedConfig;
import com.sc.we.idv.controller.IDVController;
import com.sc.we.idv.common.exceptions.DownstreamSystemErrorException;
import com.sc.we.idv.exceptions.TimeoutErrorException;
import com.sc.we.idv.plugin.client.zoloz.model.DeleteCustomerRequest;
import com.sc.we.idv.plugin.client.zoloz.model.DeleteCustomerResponse;
import com.sc.we.idv.plugin.client.zoloz.model.EncryptRequestDTO;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozCheckResultRequest;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozCheckResultResponse;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozInitializeRequest;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozInitializeResponse;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozResponseData;

@Component
public class ZolozClient {

	private Logger log = LoggerFactory.getLogger(ZolozClient.class);

	@Value("${zoloz.url}")
	private String ZOLOZ_URL;

	@Value("${zoloz.client.id}")
	private String clientId;
	
	@Value("${stub.virtual-service-url}")
    private String virtualServiceUrl;

    @Value("${stub.real-service-url}")
    private String realServiceUrl;

	@Autowired
	@Qualifier("RestTemplate")
	RestTemplate restTemplate;

	@Autowired
	private ZolozEncryptAndGenSignService zolozEncryptAndSignService;

	@Autowired
	private ZolozCheckSignAndDecryptService checkSignatureAndDecryptService;
	
	@Autowired
	private SharedConfig sharedConfig;

	public ZolozCheckResultResponse getDemographics(ZolozCheckResultRequest req)
			throws DownstreamSystemErrorException, Exception {
		String res_json = callZolozService(req.getTransactionId(), getRequestJSON(req),
				IDVConstants.GET_DEMOGRAPHIC_ZOLOZ_ENDPOINT);
		log.info("Zoloz Check Request String : " + getRequestJSON(req));
		log.info("Zoloz Check Response String : " + res_json);
		return getResponse(res_json, ZolozCheckResultResponse.class);
	}

	public ZolozInitializeResponse initilize(ZolozInitializeRequest req)
			throws DownstreamSystemErrorException, Exception {

		String res_json = callZolozService(req.getBizId(), getRequestJSON(req),
				IDVConstants.GET_INITIALIZE_ZOLOZ_ENDPOINT);
		log.info("Zoloz Initialize Request String : " + getRequestJSON(req));
		log.info("Zoloz Initialize Response String : " + res_json);
		return getResponse(res_json, ZolozInitializeResponse.class);
	}

	public DeleteCustomerResponse deleteCustomerDataFromVendor(DeleteCustomerRequest req)
			throws DownstreamSystemErrorException, Exception {
		String res_json = callZolozService(req.getTransactionId(), getRequestJSON(req),
				IDVConstants.DELETE_CUSTOMER_ZOLOZ_ENDPOINT);
		log.info("Zoloz Delete Request String : " + getRequestJSON(req));
		log.info("Zoloz Delete Response String : " + res_json);
		return getResponse(res_json, DeleteCustomerResponse.class);
	}

	private String callZolozService(String transactionId, String requestJson, String zolozApiName)
			throws DownstreamSystemErrorException, Exception {
		try {
			log.info("1. ==== Encrypting the request ====");
			EncryptRequestDTO encryptRequestDTO = zolozEncryptAndSignService.encryptService(requestJson);
			log.info("2. ==== Generate signature and add in the request ====");
			encryptRequestDTO = zolozEncryptAndSignService.generateSignature(encryptRequestDTO, zolozApiName);
			log.info("3. ====Call Zoloz API Rest Template ==== ZOLOZ API NAME" + zolozApiName);
			
			ZOLOZ_URL = sharedConfig.isShouldStubInitialize() ? virtualServiceUrl : realServiceUrl;
			System.out.println(sharedConfig.isShouldStubInitialize());
			ZolozResponseData data = doCall(transactionId, generateUrlFromMethodName(ZOLOZ_URL, zolozApiName),
					encryptRequestDTO.getEncryptedkey(), encryptRequestDTO.getReqTime(),
					encryptRequestDTO.getSignature(), encryptRequestDTO.getEncryptedRequest(), clientId);
			log.info("4. ====Check if signature is valid====");
			String resultContent = checkSignatureAndDecryptService.checkSignatureAndReturnData(data, zolozApiName);
			log.info("5. ==== Decrypt and get the response data ====");
			return checkSignatureAndDecryptService.decryptResponse(data, encryptRequestDTO, resultContent);
		} catch (Exception e) {

			if (e.getCause() instanceof SocketTimeoutException) {
				throw new TimeoutErrorException(transactionId, "Time Out" + e.getMessage());
			} else if (e.getCause() instanceof ServiceUnavailable || e.getCause() instanceof ConnectException) {
				throw new DownstreamSystemErrorException(transactionId, "Services Down");
			} else if (e.getCause() instanceof FileNotFoundException) {
				throw new DownstreamSystemErrorException(transactionId, "Endpoint not found");
			} else {
				throw new DownstreamSystemErrorException(transactionId, e.getMessage().toString());
			}
		}
	}

	protected ZolozResponseData doCall(String transactionId, String baseUrl, String encryptKey, String reqTime,
			String signature, String request, String clientId) throws Exception, DownstreamSystemErrorException {
		ZolozResponseData data = new ZolozResponseData();
		try {
			log.info("=========zoloz calling rest template==========");
			HttpHeaders headers = new HttpHeaders();
			if (encryptKey != null) {
				headers.add(HttpHeaders.CONTENT_TYPE, IDVConstants.CONTENT_TYPE_TEXT);
			} else {
				headers.add(HttpHeaders.CONTENT_TYPE, IDVConstants.CONTENT_TYPE_JSON);
			}
			headers.add(IDVConstants.HEADER_CLIENT_ID, clientId);
			headers.add(IDVConstants.HEADER_REQUEST_TIME, reqTime);
			headers.add(IDVConstants.HEADER_CONSUMER_COMPONENT, IDVConstants.RTOB_CHANNELS);
			headers.add(IDVConstants.HEADER_TRACKING_ID, Utils.generateRequestID());
			if (signature != null) {
				headers.add(IDVConstants.HEADER_SIGNATURE,
						IDVConstants.HEADER_ALGO_SIGNATURE + URLEncoder.encode(signature, IDVConstants.UTF8));
			}
			if (encryptKey != null) {
				headers.add(IDVConstants.ENCRYPT,
						IDVConstants.HEADER_ALGO_SYMMETRIC + URLEncoder.encode(encryptKey, IDVConstants.UTF8));
			}

			HttpEntity<String> httpRequest = new HttpEntity<>(request, headers);
			ResponseEntity<String> response = restTemplate.exchange(baseUrl, HttpMethod.POST, httpRequest,
					String.class);
			data.setHeader(response.getHeaders().entrySet().stream()
					.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)));
			data.setContent(response.getBody());
			if (response.getStatusCode().equals(HttpStatus.OK)) {
				if (response.getBody() == null) {
					throw new DownstreamSystemErrorException(transactionId, "No data from the External system");
				}
			} else {
				throw new DownstreamSystemErrorException(transactionId, "No data from the External system");
			}

		} catch (DownstreamSystemErrorException e) {
			log.error("Excepton in ZolozClient doCall ", e);
			throw new DownstreamSystemErrorException(transactionId, e.getMessage().toString());
		}
		return data;
	}

	private String generateUrlFromMethodName(String hostUrl, String zolozApiName) {
		String url = hostUrl + "/" + IDVConstants.API + "/" + zolozApiName.replaceAll("\\.", "/");
		log.info("API URL = " + url);
		return url;
	}

	private <T> T getResponse(String jsonResponse, Class<T> classType)
			throws JsonMappingException, JsonProcessingException {
		ObjectMapper mapper = JsonMapper.builder().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
				.build();
		return mapper.readValue(jsonResponse, classType);
	}

	String getRequestJSON(Object RequestObject) throws JsonProcessingException {
		ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
		return ow.writeValueAsString(RequestObject);
	}
}

This is the JUnit test class for zolozClient.
package com.sc.we.idv.plugin.client.zoloz;

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

import java.io.FileNotFoundException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;

import com.sc.we.idv.IDVBaseTest;
import com.sc.we.idv.TestCommonUtils;
import com.sc.we.idv.common.exceptions.DownstreamSystemErrorException;
import com.sc.we.idv.exceptions.TimeoutErrorException;
import com.sc.we.idv.plugin.client.zoloz.model.DeleteCustomerRequest;
import com.sc.we.idv.plugin.client.zoloz.model.DeleteCustomerResponse;
import com.sc.we.idv.plugin.client.zoloz.model.EncryptRequestDTO;
import com.sc.we.idv.plugin.client.zoloz.model.H5ModeConfig;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozCheckResultRequest;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozCheckResultResponse;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozInitializeRequest;
import com.sc.we.idv.plugin.client.zoloz.model.ZolozInitializeResponse;

public class ZolozClientTest extends IDVBaseTest {

	@InjectMocks
	private ZolozClient zolozClient;

	@Mock
	private RestTemplate restTemplate;

	@Value("${zoloz.url}")
	private String ZOLOZ_URL;

	@Mock
	private ZolozEncryptAndGenSignService zolozEncryptAndSignService;

	@Mock
	private ZolozCheckSignAndDecryptService checkSignatureAndDecryptService;

	@BeforeEach
	public void setup() {
		MockitoAnnotations.openMocks(this);
		ReflectionTestUtils.setField(zolozClient, "ZOLOZ_URL", ZOLOZ_URL);
		ReflectionTestUtils.setField(zolozClient, "clientId", "2188438842658122");
	}

	@Test
	public void testGetDemographics() throws Exception {
		// Given
		ZolozCheckResultRequest req = buildReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenReturn(new ResponseEntity<String>(TestCommonUtils.getDemographyResponseJson(), HttpStatus.OK));
		when(checkSignatureAndDecryptService.checkSignatureAndReturnData(any(), any())).thenReturn("dummy Content");
		when(checkSignatureAndDecryptService.decryptResponse(any(), any(), any()))
				.thenReturn(TestCommonUtils.getDemographyResponseJson());

		// When
		ZolozCheckResultResponse res = zolozClient.getDemographics(req);
		// Then
		assertNotNull(res);
	}

	@Test
	public void testGetDemographicsNoData() throws Exception {
		// Given
		ZolozCheckResultRequest req = buildReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenReturn(new ResponseEntity<>(HttpStatus.NO_CONTENT));
		Exception exception = assertThrows(Exception.class, () -> {
			zolozClient.getDemographics(req);
		});
		// Then
		assertEquals("No data from the External system", exception.getMessage());
	}

	@Test
	public void testGetDemographicsTimeoutException() throws Exception {
		// Given
		ZolozCheckResultRequest req = buildReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Timeout", new TimeoutErrorException(ZOLOZ_URL, ZOLOZ_URL)));
		;
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.getDemographics(req);
		});

		// Then
		assertEquals("Timeout", exception.getMessage());
	}

	@Test
	public void testGetDemographicsServiceUnavailalbleException() throws Exception {
		// Given
		ZolozCheckResultRequest req = buildReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Services Unavailable", new ConnectException()));
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.getDemographics(req);
		});

		// Then
		assertEquals("Services Down", exception.getMessage());
	}

	@Test
	public void testGetDemographicsEndpointNotFoundException() throws Exception {
		// Given
		ZolozCheckResultRequest req = buildReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Endpoint not found", new FileNotFoundException()));
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.getDemographics(req);
		});

		// Then
		assertEquals("Endpoint not found", exception.getMessage());
	}

	@Test
	public void testGetDemographicsOtherException() throws Exception {
		// Given
		ZolozCheckResultRequest req = buildReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Unknown exception"));
		Exception exception = assertThrows(Exception.class, () -> {
			// When
			zolozClient.getDemographics(req);
		});

		// Then
		assertEquals("Unknown exception", exception.getMessage());
	}

	@Test
	public void testInitialize() throws Exception {
		// Given
		ZolozInitializeRequest req = buildZolozInitializeReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenReturn(new ResponseEntity<String>(TestCommonUtils.getInitializeResponseJson(), HttpStatus.OK));
		when(checkSignatureAndDecryptService.checkSignatureAndReturnData(any(), any())).thenReturn("dummy Content");
		when(checkSignatureAndDecryptService.decryptResponse(any(), any(), any()))
				.thenReturn(TestCommonUtils.getInitializeResponseJson());
		// When
		ZolozInitializeResponse res = zolozClient.initilize(req);
		// Then
		assertNotNull(res);
	}

	@Test
	public void testInitializeNoData() throws Exception {
		// Given
		ZolozInitializeRequest req = buildZolozInitializeReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenReturn(new ResponseEntity<>(HttpStatus.NO_CONTENT));
		Exception exception = assertThrows(Exception.class, () -> {
			zolozClient.initilize(req);
		});
		// Then
		assertEquals("No data from the External system", exception.getMessage());
	}

	@Test
	public void testInitializeTimeoutException() throws Exception {
		// Given
		ZolozInitializeRequest req = buildZolozInitializeReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("", new SocketTimeoutException()));
		;
		Exception exception = assertThrows(TimeoutErrorException.class, () -> {
			// When
			zolozClient.initilize(req);
		});

		// Then
		assertEquals("Time Out", exception.getMessage());
	}

	@Test
	public void testInitializeServiceUnavailalbleException() throws Exception {
		// Given
		ZolozInitializeRequest req = buildZolozInitializeReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Services Unavailable", new ConnectException()));
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.initilize(req);
		});

		// Then
		assertEquals("Services Down", exception.getMessage());
	}

	@Test
	public void testInitializeEndpointNotFoundException() throws Exception {
		// Given
		ZolozInitializeRequest req = buildZolozInitializeReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Endpoint not found", new FileNotFoundException()));
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.initilize(req);
		});

		// Then
		assertEquals("Endpoint not found", exception.getMessage());
	}

	@Test
	public void testInitializeOtherException() throws Exception {
		// Given
		ZolozInitializeRequest req = buildZolozInitializeReq();
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Unknown exception"));
		Exception exception = assertThrows(Exception.class, () -> {
			// When
			zolozClient.initilize(req);
		});

		// Then
		assertEquals("Unknown exception", exception.getMessage());
	}

	@Test
	public void testDeleteCustomerDataFromVendor() throws Exception {
		String vendorTrasactionId = "XXXXXXXXXXXXXXXXXXXXX1223";
		DeleteCustomerRequest req = new DeleteCustomerRequest(vendorTrasactionId);
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenReturn(new ResponseEntity<String>(TestCommonUtils.getInitializeResponseJson(), HttpStatus.OK));
		when(checkSignatureAndDecryptService.checkSignatureAndReturnData(any(), any())).thenReturn("dummy Content");
		when(checkSignatureAndDecryptService.decryptResponse(any(), any(), any()))
				.thenReturn(TestCommonUtils.getInitializeResponseJson());
		// When
		DeleteCustomerResponse res = zolozClient.deleteCustomerDataFromVendor(req);

		// Then
		assertNotNull(res);

	}

	@Test
	public void testDeleteCustomerDataFromVendorNoData() throws Exception {

		// Given
		EncryptRequestDTO dto = new EncryptRequestDTO();
		String vendorTrasactionId = "XXXXXXXXXXXXXXXXXXXXX1223";
		DeleteCustomerRequest req = new DeleteCustomerRequest(vendorTrasactionId);
		dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenReturn(new ResponseEntity<>(HttpStatus.NO_CONTENT));
		Exception exception = assertThrows(Exception.class, () -> {
			zolozClient.deleteCustomerDataFromVendor(req);
		});
		// Then
		assertEquals("No data from the External system", exception.getMessage());
	}

	@Test
	public void testDeleteCustomerDataFromVendorTimeoutException() throws Exception {
		// Given
		String vendorTrasactionId = "XXXXXXXXXXXXXXXXXXXXX1223";
		DeleteCustomerRequest req = new DeleteCustomerRequest(vendorTrasactionId);
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class))).thenThrow(
				new RestClientException("Timeout", new TimeoutErrorException(vendorTrasactionId, vendorTrasactionId)));
		;
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.deleteCustomerDataFromVendor(req);
		});

		// Then
		assertEquals("Timeout", exception.getMessage());
	}

	@Test
	public void testDeleteCustomerDataFromVendorServiceUnavailalbleException() throws Exception {
		// Given
		String vendorTrasactionId = "XXXXXXXXXXXXXXXXXXXXX1223";
		DeleteCustomerRequest req = new DeleteCustomerRequest(vendorTrasactionId);
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Services Unavailable", new ConnectException()));
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.deleteCustomerDataFromVendor(req);
		});

		// Then
		assertEquals("Services Down", exception.getMessage());
	}

	@Test
	public void testDeleteCustomerDataFromVendorEndpointNotFoundException() throws Exception {
		// Given
		String vendorTrasactionId = "XXXXXXXXXXXXXXXXXXXXX1223";
		DeleteCustomerRequest req = new DeleteCustomerRequest(vendorTrasactionId);
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Endpoint not found", new FileNotFoundException()));
		Exception exception = assertThrows(DownstreamSystemErrorException.class, () -> {
			// When
			zolozClient.deleteCustomerDataFromVendor(req);
		});

		// Then
		assertEquals("Endpoint not found", exception.getMessage());
	}

	@Test
	public void testDeleteCustomerDataFromVendorOtherException() throws Exception {
		// Given
		String vendorTrasactionId = "XXXXXXXXXXXXXXXXXXXXX1223";
		DeleteCustomerRequest req = new DeleteCustomerRequest(vendorTrasactionId);
		EncryptRequestDTO dto = new EncryptRequestDTO();
		when(zolozEncryptAndSignService.encryptService(any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(zolozEncryptAndSignService.generateSignature(any(), any())).thenReturn(dto);
		when(restTemplate.exchange(anyString(), any(), any(), any(Class.class)))
				.thenThrow(new RestClientException("Unknown exception"));
		Exception exception = assertThrows(Exception.class, () -> {
			// When
			zolozClient.deleteCustomerDataFromVendor(req);
		});

		// Then
		assertEquals("Unknown exception", exception.getMessage());
	}

	private ZolozInitializeRequest buildZolozInitializeReq() {
		ZolozInitializeRequest req = new ZolozInitializeRequest();
		H5ModeConfig config = new H5ModeConfig();
		config.setCompleteCallbackUrl("http://xxx.html");
		config.setIsIframe("http://xxx.html");
		req.setBizId("TXNREF1001");
		req.setH5ModeConfig(config);
		return req;
	}

	private ZolozCheckResultRequest buildReq() {
		ZolozCheckResultRequest req = new ZolozCheckResultRequest();
		req.setBizId("BIZID");
		req.setTransactionId("TXN1001");
		return req;
	}

}

I am getting the below error.
[ERROR] [1;31mFailures: [m
[ERROR] [1;31m  ZolozClientTest.testDeleteCustomerDataFromVendorEndpointNotFoundException:389 expected: <Endpoint not found> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testDeleteCustomerDataFromVendorNoData:328 expected: <No data from the External system> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testDeleteCustomerDataFromVendorOtherException:409 expected: <Unknown exception> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testDeleteCustomerDataFromVendorServiceUnavailalbleException:369 expected: <Services Down> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testDeleteCustomerDataFromVendorTimeoutException:349 expected: <Timeout> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testGetDemographicsEndpointNotFoundException:155 expected: <Endpoint not found> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testGetDemographicsNoData:97 expected: <No data from the External system> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testGetDemographicsOtherException:174 expected: <Unknown exception> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testGetDemographicsServiceUnavailalbleException:136 expected: <Services Down> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testGetDemographicsTimeoutException:117 expected: <Timeout> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testInitializeEndpointNotFoundException:268 expected: <Endpoint not found> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testInitializeNoData:210 expected: <No data from the External system> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testInitializeOtherException:287 expected: <Unknown exception> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testInitializeServiceUnavailalbleException:249 expected: <Services Down> but was: <Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null>[m
[ERROR] [1;31m  ZolozClientTest.testInitializeTimeoutException:224 Unexpected exception type thrown, expected: <com.sc.we.idv.exceptions.TimeoutErrorException> but was: <com.sc.we.idv.common.exceptions.DownstreamSystemErrorException>[m
[ERROR] [1;31mErrors: [m
[ERROR] [1;31m  ZolozClientTest.testDeleteCustomerDataFromVendor:304 » DownstreamSystemError Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null[m
[ERROR] [1;31m  ZolozClientTest.testGetDemographics:78 » DownstreamSystemError Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null[m
[ERROR] [1;31m  ZolozClientTest.testInitialize:191 » DownstreamSystemError Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null

How to resolve it?