This is sharedConfig class:
package com.sc.we.idv.config;

import org.springframework.stereotype.Component;

@Component
public class SharedConfig {
    private boolean shouldStubInitialize;
    private boolean ShouldStubGetDemographics;

    public boolean isShouldStubInitialize() {
        return shouldStubInitialize;
    }

    public void setShouldStubInitialize(boolean shouldStubInitialize) {
        this.shouldStubInitialize = shouldStubInitialize;
    }

	public boolean isShouldStubGetDemographics() {
		return ShouldStubGetDemographics;
	}

	public void setShouldStubGetDemographics(boolean shouldStubGetDemographics) {
		ShouldStubGetDemographics = shouldStubGetDemographics;
	}

}

This is ZolozEncryptAndGenSignService class:
package com.sc.we.idv.plugin.client.zoloz;

import java.io.IOException;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

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.stereotype.Service;

import com.sc.we.idv.common.constants.IDVConstants;
import com.sc.we.idv.config.SharedConfig;
import com.sc.we.idv.plugin.client.zoloz.model.EncryptRequestDTO;
import com.sc.we.idv.plugin.client.zoloz.util.AESUtil;
import com.sc.we.idv.plugin.client.zoloz.util.GenSignUtil;
import com.sc.we.idv.plugin.client.zoloz.util.KeyUtil;
import com.sc.we.idv.plugin.client.zoloz.util.RSAUtil;


@Service
public class ZolozEncryptAndGenSignService {
	
	@Value("${zoloz.client.id}")
	private String clientId;

	@Value("${zoloz.merchant.privkey.path}")
	private String merchantPrivKeyPath;

	@Value("${zoloz.pubkey}")
	private String openApiPublicKey;
	
	private static final Logger logger = LoggerFactory.getLogger(ZolozEncryptAndGenSignService.class);

	@Value("${live.endpoint}")
	private boolean signed;
	
	@Value("${live.endpoint}")
	private boolean encrypted;
	
	@Autowired
	private SharedConfig sharedConfig;

	public EncryptRequestDTO encryptService(String request, String apiName) {
		String encryptKey = null;
		byte[] key = null;
		String encryptedRequest = null;
		encrypted = (apiName.equals(IDVConstants.GET_INITIALIZE_ZOLOZ_ENDPOINT)) ? (sharedConfig.isShouldStubInitialize() ? false : true) : (apiName.equals(IDVConstants.GET_DEMOGRAPHIC_ZOLOZ_ENDPOINT) ? (sharedConfig.isShouldStubGetDemographics() ? false : true) : encrypted);
		try {
			if (encrypted) {
				key = AESUtil.generateKey(128);
				encryptedRequest = AESUtil.encrypt(key, request);
				encryptKey = RSAUtil.encrypt(openApiPublicKey, key);
			} else {
				encryptedRequest = request;
			}
		} catch (Exception e) {
			logger.info("ENCRYPTION ERROR" + e.getMessage());
		}
		EncryptRequestDTO encryptRequestDTO = new EncryptRequestDTO();
		encryptRequestDTO.setKey(key);
		encryptRequestDTO.setEncryptedRequest(encryptedRequest);
		encryptRequestDTO.setEncryptedkey(encryptKey);
        return encryptRequestDTO;
		
	}
	
	public EncryptRequestDTO generateSignature(EncryptRequestDTO encryptRequestDTO,String apiName) throws Exception{
		String reqTime = ZonedDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssZ"));
		String signature = null;
		signed = (apiName.equals(IDVConstants.GET_INITIALIZE_ZOLOZ_ENDPOINT)) ? (sharedConfig.isShouldStubInitialize() ? false : true) : (apiName.equals(IDVConstants.GET_DEMOGRAPHIC_ZOLOZ_ENDPOINT) ? (sharedConfig.isShouldStubGetDemographics() ? false : true) : signed);
		if (signed) {
			signature = sign(loadPrivateKeyFromFile(merchantPrivKeyPath), apiName, clientId, reqTime, encryptRequestDTO.getEncryptedRequest());
		}
		logger.info("signature generated"+signature);
		encryptRequestDTO.setSignature(signature);
		encryptRequestDTO.setReqTime(reqTime);
		return encryptRequestDTO;
	}
	
	protected String sign(String merchantPrivateKey, String api, String clientId, String reqTime, String request)
			throws Exception {
		StringBuffer sb = new StringBuffer(request.length() + 256);
		sb.append("POST ").append("/api/").append(api.replaceAll("\\.", "/")).append("\n");
		sb.append(clientId).append(".").append(reqTime).append(".").append(request);
		String str = sb.toString();
		return GenSignUtil.sign(merchantPrivateKey, str);
	}
	
	private String loadPrivateKeyFromFile(String merchantPrivKeyPath) {
		String merchantPrivateKey = null;
		try {
			merchantPrivateKey = KeyUtil.loadKeyContentFromPath(merchantPrivKeyPath);
			logger.info("======== private ket loaded from file classpath ========");
		} catch (IOException e) {
			logger.debug("XXXXXXXXXXXXXXXXERROR LOADING PRIVATE KEYXXXXXXXXXXXXXXXXXXXXX");
		}
		return merchantPrivateKey;
	}


}

This is the jUnit test class which is having null pointer exception:
package com.sc.we.idv.plugin.client.zoloz;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.ArgumentMatchers.any;

import java.security.NoSuchAlgorithmException;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
import org.springframework.test.util.ReflectionTestUtils;

import com.sc.we.idv.IDVBaseTest;
import com.sc.we.idv.TestCipherUtil;
import com.sc.we.idv.config.SharedConfig;
import com.sc.we.idv.plugin.client.zoloz.model.EncryptRequestDTO;
import com.sc.we.idv.plugin.client.zoloz.util.GenSignUtil;

public class ZolozEncryptAndGenSignServiceTest extends IDVBaseTest {
	
	@InjectMocks
	ZolozEncryptAndGenSignService service;
	
	@Mock
    private SharedConfig sharedConfig;
	
	String[] key;
	
	@BeforeEach
	public void setup() throws NoSuchAlgorithmException {
		key = TestCipherUtil.getPublicPrivateKey();
		ReflectionTestUtils.setField(service, "clientId", "2188438842658122");
		ReflectionTestUtils.setField(service, "merchantPrivKeyPath", "dummy.txt");
		ReflectionTestUtils.setField(service, "openApiPublicKey", key[0]);
		ReflectionTestUtils.setField(service, "encrypted", true);
		ReflectionTestUtils.setField(service, "signed", true);
	}

	
	@Test
	public void testEncryptService() {
		//Given
		String request = "Sample Req";
		
		//When
		EncryptRequestDTO dto = service.encryptService(request, "v1.zoloz.realid.initialize");
		
		//Then
		assertNotNull(dto);
		assertNotNull(dto.getKey());
		assertNotNull(dto.getEncryptedRequest());
		assertNotNull(dto.getEncryptedkey());
		
	}
	
	@Test
	public void testGenerateSignature() throws Exception {
		//Given
		String request = "Sample Req";
		EncryptRequestDTO dto = service.encryptService(request, "v1.zoloz.realid.initialize");
		MockedStatic<GenSignUtil> util =  Mockito.mockStatic(GenSignUtil.class);
		
		//When
		util.when(() -> GenSignUtil.sign(any(), any())).thenReturn("Sign");
		dto = service.generateSignature(dto, "v1.zoloz.realid.initialize");
		
		//Then
		assertNotNull(dto);
		assertNotNull(dto.getSignature());
		assertNotNull(dto.getReqTime());
	}
}
The error is java.lang.NullPointerException: Cannot invoke "com.sc.we.idv.config.SharedConfig.isShouldStubInitialize()" because "this.sharedConfig" is null
	at com.sc.we.idv.plugin.client.zoloz.ZolozEncryptAndGenSignService.encryptService(ZolozEncryptAndGenSignService.java:49)
	at com.sc.we.idv.plugin.client.zoloz.ZolozEncryptAndGenSignServiceTest.testGenerateSignature(ZolozEncryptAndGenSignServiceTest.java:58)
	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)

How to fix it