This is my test class,
package com.sc.we.idv.faceCapture.service.impl;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.sc.we.idv.IDVBaseTest;
import com.sc.we.idv.TestCommonUtils;
import com.sc.we.idv.faceCapture.service.IDVFaceCaptureServiceImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;

import com.sc.we.idv.faceCapture.model.InitializeRequest;
import com.sc.we.idv.faceCapture.model.InitializeResponse;

public class IDVFaceCaptureServiceImplTest extends IDVBaseTest {

    @InjectMocks
    private IDVFaceCaptureServiceImpl service;

    @BeforeEach
    public void setUp() {
        MockitoAnnotations.openMocks(this);
    }

    @Test
    public void testInitialize() throws Exception {
        // Given
        InitializeRequest request = new InitializeRequest();
        request.setInternalInfo(TestCommonUtils.buildInternalInfo()); 
        request.setServiceInfo(TestCommonUtils.buildServiceInfoo());

        // When
        InitializeResponse response = service.initialize(request);

        // Then
        assertNotNull(response);
        assertNotNull(response.getInternalInfo());
        assertEquals(request.getInternalInfo().getServiceType(), response.getInternalInfo().getServiceType());
        assertEquals(request.getInternalInfo().getSourceCountry(), response.getInternalInfo().getSourceCountry());
        assertEquals(request.getInternalInfo().getSystemIdentifier(), response.getInternalInfo().getSystemIdentifier());

        assertNotNull(response.getServiceInfo());
        assertEquals("txn12345", response.getServiceInfo().getTransactionReference());
        assertEquals("app-xyz", response.getServiceInfo().getChannelReference());
        assertEquals("ack-12345", response.getServiceInfo().getAckReference());
        assertEquals("vendor-txn-98765", response.getServiceInfo().getVendorTransactionId());
        assertEquals("segment-abcdef", response.getServiceInfo().getSegmentCode());
        assertEquals("product-123", response.getServiceInfo().getProductIdentifier());

        assertNotNull(response.getThirdpartyInfo());
        assertEquals(1, response.getThirdpartyInfo().size());
        assertEquals("Daon", response.getThirdpartyInfo().get(0).getThirdpartyName());
        assertEquals("uinfin name aliasname", response.getThirdpartyInfo().get(0).getThirdpartyData().get("scope"));
        assertEquals("n5r0t5o4b0", response.getThirdpartyInfo().get(0).getThirdpartyData().get("purpose-id"));
    }
}

This is service impl class,
package com.sc.we.idv.faceCapture.service;

import com.sc.we.idv.config.IDVConfig;
import com.sc.we.idv.config.TokenConfig;
import com.sc.we.idv.entity.IDVTransaction;
import com.sc.we.idv.faceCapture.model.*;
import com.sc.we.idv.model.IDVTransactionBO;
import com.sc.we.idv.plugin.client.zoloz.model.coverter.IDVTransactionResponseToIdvTransactionEntity;
import com.sc.we.idv.plugin.service.IDVExternalPluginService;
import com.sc.we.idv.repository.InitializeRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;

import static com.sc.we.idv.common.constants.IDVConstants.EXTERNAL_PLUGIN_SERVICE_IMPL;

@Component
public class IDVFaceCaptureServiceImpl implements IDVFaceCaptureService {

    private static Logger logger = LoggerFactory.getLogger(IDVFaceCaptureServiceImpl.class);

    @Autowired
    private IDVConfig config;

    @Autowired
    private TokenConfig tokenConfig;

    @Autowired
    private ApplicationContext context;

    @Autowired
    private InitializeRepository repository;

    @Autowired
    private IDVTransactionResponseToIdvTransactionEntity converter;
    
    @Override
    public InitializeResponse initialize(InitializeRequest request) throws Exception {
        IDVTransactionBO transactionBO = new IDVTransactionBO();
        IDVTransaction transaction = repository.getByTransactionRef(request.getServiceInfo().getTransactionReference());
        String source_country = request.getInternalInfo().getSourceCountry();

        if (config.isFaceCaptureInitializeEnabled(source_country)) {
            IDVExternalPluginService service = plugInService(source_country);
            // transactionBO = service.initialize(req); TODO : Make a zolozService call here using INIDVExternalService impl
            buildMockIDVTransactionBO(transactionBO, request);
            persistingIDVTransaction(transactionBO, source_country);
        }
        InitializeResponse response = new InitializeResponse();
        buildInitializeResponse(response, request);
        logger.info("Exiting IDVServiceImpl initialize");
        return response;
        
    }

    private void buildMockIDVTransactionBO(IDVTransactionBO transactionBO, InitializeRequest request) {
        transactionBO.setIdvTransactionId(1L);
        buildInternalInfo(transactionBO, request.getInternalInfo());
        buildServiceInfo(transactionBO, request.getServiceInfo());
    }

    private void buildServiceInfo(IDVTransactionBO transactionBO, ServiceInfo serviceInfo) {
        transactionBO.setTransactionReference(serviceInfo.getTransactionReference());
        transactionBO.setChannelReference(serviceInfo.getChannelReference());
        transactionBO.setAckReferenceNo(serviceInfo.getAckReference());
        transactionBO.setVendorTransactionId(serviceInfo.getVendorTransactionId());
        transactionBO.setSegmentCode(serviceInfo.getSegmentCode());
        transactionBO.setProductIdentifier(serviceInfo.getProductIdentifier());
    }

    private void buildInternalInfo(IDVTransactionBO transactionBO, InternalInfo internalInfo) {
        transactionBO.setServiceType(internalInfo.getServiceType());
        transactionBO.setSourceCountry(internalInfo.getSourceCountry());
        transactionBO.setSystemIdentifier(internalInfo.getSystemIdentifier());
    }

    private IDVExternalPluginService plugInService(String country) {
        IDVExternalPluginService service = (IDVExternalPluginService) context
                .getBean(country + EXTERNAL_PLUGIN_SERVICE_IMPL);
        return service;
    }

    private IDVTransaction persistingIDVTransaction(IDVTransactionBO transactionBO, String sourceCountry) throws Exception {
        IDVTransaction transaction = converter.idvTransactionConverter(transactionBO);
        transaction.setTokenExpiryDate(setExpiryDate(sourceCountry));
        repository.save(transaction);
        return transaction;
    }

    private Timestamp setExpiryDate(String source_country) {
        return new Timestamp(System.currentTimeMillis()
                + TimeUnit.MINUTES.toMillis(Long.valueOf(tokenConfig.getExpiry().get(source_country))));
    }
    
    private void buildInitializeResponse(InitializeResponse response, InitializeRequest request) {
        // Set internal info (could be coming from the logic above)
        InternalInfo internalInfo = new InternalInfo();
        internalInfo.setServiceType(request.getInternalInfo().getServiceType());
        internalInfo.setSourceCountry(request.getInternalInfo().getSourceCountry());
        internalInfo.setSystemIdentifier(request.getInternalInfo().getSystemIdentifier());
        response.setInternalInfo(internalInfo);

        // Set service info in the response (mocked or processed data)
        ServiceInfo serviceInfo = new ServiceInfo();
        serviceInfo.setTransactionReference("txn12345");
        serviceInfo.setChannelReference("app-xyz");
        serviceInfo.setAckReference("ack-12345");
        serviceInfo.setVendorTransactionId("vendor-txn-98765");
        serviceInfo.setSegmentCode("segment-abcdef");
        serviceInfo.setProductIdentifier("product-123");
        List<String> ekycPurpose = new ArrayList<>();
        ekycPurpose.add("identity-verification");
        serviceInfo.setEkycPurpose(ekycPurpose);
        response.setServiceInfo(serviceInfo);

        List<ThirdpartyInfo> thirdPartyInfoList = new ArrayList<>();

        ThirdpartyInfo thirdPartyInfo = new ThirdpartyInfo();
        thirdPartyInfo.setThirdpartyName("Daon");

        HashMap<String, String> thirdPartyData = new HashMap<>();
        thirdPartyData.put("scope", "uinfin name aliasname");
        thirdPartyData.put("purpose-id", "n5r0t5o4b0");
        thirdPartyInfo.setThirdpartyData(thirdPartyData);
        thirdPartyInfoList.add(thirdPartyInfo);

        response.setThirdpartyInfo(thirdPartyInfoList);
    }
}


This is the errror I am getting,
java.lang.NullPointerException: Cannot invoke "com.sc.we.idv.repository.InitializeRepository.getByTransactionRef(String)" because "this.repository" is null

	at com.sc.we.idv.faceCapture.service.IDVFaceCaptureServiceImpl.initialize(IDVFaceCaptureServiceImpl.java:48)
	at com.sc.we.idv.faceCapture.service.impl.IDVFaceCaptureServiceImplTest.testInitialize(IDVFaceCaptureServiceImplTest.java:35)
	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)