<commit_before>package com.worth.ifs.sil.experian.controller;

import com.worth.ifs.BaseControllerMockMVCTest;
import org.junit.Test;
import org.springframework.test.web.servlet.MvcResult;

import static com.worth.ifs.sil.experian.controller.ExperianEndpointController.validationErrors;
import static com.worth.ifs.util.JsonMappingUtil.toJson;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * Tests around the SIL email stub
 */
public class ExperianEndpointControllerMockMvcTest extends BaseControllerMockMVCTest<ExperianEndpointController> {

    @Override
    protected ExperianEndpointController supplyControllerUnderTest() {
        return new ExperianEndpointController();
    }

    @Test
    public void testExperianValidate() throws Exception {
        validationErrors.keySet().forEach(bankDetails -> {
            String requestBody = toJson(bankDetails);
            try {
                MvcResult result = mockMvc.
                        perform(
                                post("/silstub/experianValidate").
                                        header("Content-Type", "application/json").
                                        header("IFS_AUTH_TOKEN", "<PASSWORD>").
                                        content(requestBody)
                        ).
                        andExpect(status().isOk()).
                        andReturn();
                result.getResponse();
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }
}<commit_msg>Add mock mvc test for experian verify<commit_after>package com.worth.ifs.sil.experian.controller;

import com.worth.ifs.BaseControllerMockMVCTest;
import org.junit.Test;
import org.springframework.test.web.servlet.MvcResult;

import static com.worth.ifs.sil.experian.controller.ExperianEndpointController.validationErrors;
import static com.worth.ifs.sil.experian.controller.ExperianEndpointController.verificationResults;
import static com.worth.ifs.util.JsonMappingUtil.toJson;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

/**
 * Tests around the SIL email stub
 */
public class ExperianEndpointControllerMockMvcTest extends BaseControllerMockMVCTest<ExperianEndpointController> {

    @Override
    protected ExperianEndpointController supplyControllerUnderTest() {
        return new ExperianEndpointController();
    }

    @Test
    public void testExperianValidate() throws Exception {
        validationErrors.keySet().forEach(bankDetails -> {
            String requestBody = toJson(bankDetails);
            try {
                MvcResult result = mockMvc.
                        perform(
                                post("/silstub/experianValidate").
                                        header("Content-Type", "application/json").
                                        header("IFS_AUTH_TOKEN", "123abc").
                                        content(requestBody)
                        ).
                        andExpect(status().isOk()).
                        andReturn();
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }

    @Test
    public void testExperianVerify() throws Exception {
        verificationResults.keySet().forEach(accountDetails -> {
            String requestBody = toJson(accountDetails);
            try{
                MvcResult result = mockMvc.perform(
                        post("/silstub/experianVerify").
                                header("Content-Type", "application/json").
                                header("IFS_AUTH_TOKEN", "123abc").
                                content(requestBody)
                ).andExpect(status().isOk()).andReturn();
            } catch (Exception e){
                e.printStackTrace();
            }
        });
    }
}
{'fraction_non_alphanumeric': 0.09146640510053948, 'fraction_numerical': 0.0014713094654242277, 'mean_word_length': 1.962236746550472, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6208553', 'n_tokens_mistral': 954, 'n_tokens_neox': 938, 'n_words': 165}