<commit_before>package com.worth.ifs.organisation.controller;

import com.worth.ifs.BaseControllerIntegrationTest;
import com.worth.ifs.organisation.resource.CompanyHouseBusiness;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

import static org.junit.Assert.*;

public class CompanyHouseControllerIntegrationTest extends BaseControllerIntegrationTest<CompanyHouseController> {

    private String COMPANY_ID = "08241216";
    private String COMPANY_NAME = "NETWORTHNET LTD";

    @Override
    @Autowired
    protected void setControllerUnderTest(CompanyHouseController controller) {
        this.controller = controller;
    }

    @Test
    public void testCheckInternetConnection() throws Exception {
        List<CompanyHouseBusiness> companies = controller.searchCompanyHouse("");
        assertEquals(0, companies.size());
    }

    @Test
    public void testSearchCompanyHouse() throws Exception {
        List<CompanyHouseBusiness> companies = controller.searchCompanyHouse("<NAME>");
        assertEquals(1, companies.size());

    }

    @Test
    public void testGetCompanyHouse() throws Exception {
        CompanyHouseBusiness company = controller.getCompanyHouse(COMPANY_ID);
        assertNotNull(company);
        assertEquals(COMPANY_NAME, company.getName());
        assertEquals(COMPANY_ID, company.getCompanyNumber());

    }
<commit_msg>INFUND-887 unit test coverage.<commit_after>package com.worth.ifs.organisation.controller;

import com.worth.ifs.BaseControllerIntegrationTest;
import com.worth.ifs.organisation.resource.CompanyHouseBusiness;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

import static org.junit.Assert.*;

public class CompanyHouseControllerIntegrationTest extends BaseControllerIntegrationTest<CompanyHouseController> {

    private String COMPANY_ID = "08241216";
    private String COMPANY_NAME = "NETWORTHNET LTD";

    @Override
    @Autowired
    protected void setControllerUnderTest(CompanyHouseController controller) {
        this.controller = controller;
    }

    @Test
    public void testCheckInternetConnection() throws Exception {
        List<CompanyHouseBusiness> companies = controller.searchCompanyHouse("");
        assertEquals(0, companies.size());
    }

    @Test
    public void testSearchCompanyHouse() throws Exception {
        List<CompanyHouseBusiness> companies = controller.searchCompanyHouse("<NAME>");
        assertEquals(1, companies.size());

    }

    @Test
    public void testGetCompanyHouse() throws Exception {
        CompanyHouseBusiness company = controller.getCompanyHouse(COMPANY_ID);
        assertNotNull(company);
        assertEquals(COMPANY_NAME, company.getName());
        assertEquals(COMPANY_ID, company.getCompanyNumber());
        assertEquals("ltd", company.getType());
        assertEquals("Montrose House", company.getOfficeAddress().getAddressLine1());
        assertEquals("Clayhill Park", company.getOfficeAddress().getAddressLine2());
        assertEquals("Neston", company.getOfficeAddress().getLocality());
        assertEquals("Cheshire", company.getOfficeAddress().getRegion());
        assertEquals("CH64 3RU", company.getOfficeAddress().getPostalCode());

    }

{'fraction_non_alphanumeric': 0.09764207980652963, 'fraction_numerical': 0.008464328899637243, 'mean_word_length': 4.46039603960396, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3878959', 'n_tokens_mistral': 873, 'n_tokens_neox': 812, 'n_words': 164}