<commit_before>package com.mv.hr;

import com.mv.hr.dto.CandidateInviteResponseDTO;
import com.mv.hr.dto.CandidateReportDTO;
import com.mv.hr.dto.StatusNotificationDTO;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.text.IsEmptyString.isEmptyOrNullString;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;

public class HireRightServiceTest {
    private static HireRightTestConfiguration configuration;

    private HireRightService service;

    private CandidateInviteFactory.ExtendedCandidateInviteDTO inviteDTO;
    private CandidateInviteResponseDTO inviteResponseDTO;

    private String passportReference;
    private String investigationReference;

    @BeforeClass
    public static void createConfiguration() throws Exception {
        configuration = new HireRightTestConfiguration();
    }

    @Before
    public void setUp() throws Exception {
        service = new HireRightService(configuration);

        inviteDTO = CandidateInviteFactory.randomInvite();
        passportReference = inviteDTO.getPassportReference();

        inviteResponseDTO = service.startCandidateInvite(inviteDTO, passportReference);
        investigationReference = inviteResponseDTO.InvestigationReference;
    }

    @Test
    public void startCandidateInviteTest() throws Exception {
        assertThat(inviteResponseDTO.PassportReference, is(equalTo(inviteDTO.getPassportReference())));
        assertThat(inviteResponseDTO.ExternalReferenceId, is(equalTo(inviteDTO.getExternalReferenceId())));

        assertThat(inviteResponseDTO.InvestigationReference, is(not(isEmptyOrNullString())));
        assertThat(inviteResponseDTO.CaseNumber, is(not(isEmptyOrNullString())));
        assertThat(inviteResponseDTO.CandidateInviteURL, is(not(isEmptyOrNullString())));
        assertThat(inviteResponseDTO.CandidateInviteCode, is(not(isEmptyOrNullString())));
    }

    @Test
    public void testGetInvestigationStatus() throws Exception {
        StatusNotificationDTO statusNotificationDTO = service.getInvestigationStatus(passportReference, investigationReference);

        assertThat(statusNotificationDTO.ExternalPackageReference, is(inviteDTO.getExternalPackageReference()));
        assertThat(statusNotificationDTO.IsComplete, is(false));

        assertThat(statusNotificationDTO.DivisionName, is(not(isEmptyOrNullString())));
        assertThat(statusNotificationDTO.ServiceLevelName, is(not(isEmptyOrNullString())));
        assertThat(statusNotificationDTO.OrderStatus, is(not(isEmptyOrNullString())));

        assertThat(statusNotificationDTO.DateCreated, is(notNullValue()));
        assertThat(statusNotificationDTO.ScreeningStartDate, is(notNullValue()));
        assertThat(statusNotificationDTO.DateDelivered, is(notNullValue()));

        assertThat(statusNotificationDTO.PercentageComplete, is(greaterThanOrEqualTo(0)));
        assertThat(statusNotificationDTO.TaskCount, is(greaterThanOrEqualTo(0)));
        assertThat(statusNotificationDTO.DiscrepancyCount, is(greaterThanOrEqualTo(0)));
    }

    @Test
    public void testGetCandidateReport() throws Exception {
        CandidateReportDTO candidateReport = service.getCandidateReport(passportReference, investigationReference);

        assertThat(candidateReport.PassportReference, is(inviteDTO.getPassportReference()));
        assertThat(candidateReport.ExternalReferenceId, is(inviteDTO.getExternalReferenceId()));
        assertThat(candidateReport.InvestigationReference, is(investigationReference));

        assertThat(candidateReport.CaseNumber, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.MimeType, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.FileType, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.ContentEncodingMethod, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.Content, is(not(isEmptyOrNullString())));
    }
}<commit_msg>HBM-650 Run and verify the assertions.<commit_after>package com.mv.hr;

import com.mv.hr.dto.CandidateInviteResponseDTO;
import com.mv.hr.dto.CandidateReportDTO;
import com.mv.hr.dto.StatusNotificationDTO;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.*;
import static org.hamcrest.text.IsEmptyString.isEmptyOrNullString;
import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;

public class HireRightServiceTest {
    private static HireRightTestConfiguration configuration;

    private HireRightService service;

    private CandidateInviteFactory.ExtendedCandidateInviteDTO inviteDTO;
    private CandidateInviteResponseDTO inviteResponseDTO;

    private String passportReference;
    private String investigationReference;

    @BeforeClass
    public static void createConfiguration() throws Exception {
        configuration = new HireRightTestConfiguration();
    }

    @Before
    public void setUp() throws Exception {
        service = new HireRightService(configuration);

        inviteDTO = CandidateInviteFactory.randomInvite();
        passportReference = inviteDTO.getPassportReference();

        inviteResponseDTO = service.startCandidateInvite(inviteDTO, passportReference);
        investigationReference = inviteResponseDTO.InvestigationReference;
    }

    @Test
    public void startCandidateInviteTest() throws Exception {
        assertThat(inviteResponseDTO.PassportReference, is(equalTo(inviteDTO.getPassportReference())));
        assertThat(inviteResponseDTO.ExternalReferenceId, is(equalTo(inviteDTO.getExternalReferenceId())));

        assertThat(inviteResponseDTO.InvestigationReference, is(not(isEmptyOrNullString())));
        assertThat(inviteResponseDTO.CaseNumber, is(not(isEmptyOrNullString())));
        assertThat(inviteResponseDTO.CandidateInviteURL, is(not(isEmptyOrNullString())));
        assertThat(inviteResponseDTO.CandidateInviteCode, is(not(isEmptyOrNullString())));
    }

    @Test
    public void testGetInvestigationStatus() throws Exception {
        StatusNotificationDTO statusNotificationDTO = service.getInvestigationStatus(passportReference, investigationReference);

        assertThat(statusNotificationDTO.ExternalPackageReference, is(inviteDTO.getExternalPackageReference()));
        assertThat(statusNotificationDTO.IsComplete, is(false));

        assertThat(statusNotificationDTO.DivisionName, is(inviteDTO.getDivisionName()));
        assertThat(statusNotificationDTO.ServiceLevelName, is(not(isEmptyOrNullString())));
        assertThat(statusNotificationDTO.OrderStatus, is(not(isEmptyOrNullString())));

        assertThat(statusNotificationDTO.DateCreated, is(notNullValue()));
        assertThat(statusNotificationDTO.ScreeningStartDate, is(notNullValue()));
        assertThat(statusNotificationDTO.DateDelivered, is(notNullValue()));

        assertThat(statusNotificationDTO.PercentageComplete, is(greaterThanOrEqualTo(0)));
        assertThat(statusNotificationDTO.TaskCount, is(greaterThanOrEqualTo(0)));
        assertThat(statusNotificationDTO.DiscrepancyCount, is(greaterThanOrEqualTo(0)));
    }

    @Test
    public void testGetCandidateReport() throws Exception {
        CandidateReportDTO candidateReport = service.getCandidateReport(passportReference, investigationReference);

        assertThat(candidateReport.PassportReference, is(inviteDTO.getPassportReference()));
        assertThat(candidateReport.ExternalReferenceId, is(inviteDTO.getExternalReferenceId()));
        assertThat(candidateReport.InvestigationReference, is(investigationReference));

        assertThat(candidateReport.CaseNumber, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.MimeType, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.FileType, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.ContentEncodingMethod, is(not(isEmptyOrNullString())));
        assertThat(candidateReport.Content, is(not(isEmptyOrNullString())));
    }
}
{'fraction_non_alphanumeric': 0.09235120511559272, 'fraction_numerical': 0.0011067388096409247, 'mean_word_length': 5.628361858190709, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1556133', 'n_tokens_mistral': 2069, 'n_tokens_neox': 2145, 'n_words': 309}