<commit_before>package org.sanelib.ils.api.converters.holiday;

import org.junit.Test;
import org.sanelib.ils.api.dto.holiday.HolidayDto;
import org.sanelib.ils.common.utils.DateHelper;
import org.sanelib.ils.core.commands.ProcessCommand;
import org.sanelib.ils.core.commands.holiday.DeleteHoliday;
import org.sanelib.ils.core.exceptions.ProcessError;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class DeleteHolidayConverterTest {

    @Test
    public void testDeleteHolidaySuccessExecute() throws Exception{

        HolidayDto dto = new HolidayDto();

        dto.setLibraryId("2");
        dto.setFiscalYearId("20152016");
        dto.setStartDate("2016/02/09");
        dto.setEndDate("2016/02/11");

        ProcessError processError = new ProcessError();

        DeleteHolidayConverter converter = new DeleteHolidayConverter();
        ProcessCommand command = converter.convert(dto , processError);

        assertTrue("Conversion error occurred", processError.isValid());
        assertTrue("Wrong output " + command, command instanceof DeleteHoliday);

        DeleteHoliday deleteHoliday = (DeleteHoliday) command;

        assertEquals("Library Id is not mapped", dto.getLibraryId(), String.valueOf(deleteHoliday.getLibraryId()));
        assertEquals("FiscalYear Id is not mapped", dto.getFiscalYearId(), String.valueOf(deleteHoliday.getFiscalYearId()));
        assertEquals("Start Date is not mapped ", DateHelper.fromDateString(dto.getStartDate()), deleteHoliday.getStartDate());
        assertEquals("End Date is not mapped ", DateHelper.fromDateString(dto.getEndDate()), deleteHoliday.getEndDate());<commit_msg>FIX: Delete Holiday Converter test for insufficient data.<commit_after>package org.sanelib.ils.api.converters.holiday;

import org.junit.Test;
import org.sanelib.ils.api.dto.holiday.HolidayDto;
import org.sanelib.ils.common.utils.DateHelper;
import org.sanelib.ils.core.commands.ProcessCommand;
import org.sanelib.ils.core.commands.holiday.DeleteHoliday;
import org.sanelib.ils.core.enums.HolidayType;
import org.sanelib.ils.core.exceptions.ProcessError;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class DeleteHolidayConverterTest {

    @Test
    public void testDeleteHolidaySuccessExecute() throws Exception{

        HolidayDto dto = new HolidayDto();

        dto.setLibraryId("2");
        dto.setFiscalYearId("20152016");
        dto.setStartDate("2016/02/09");
        dto.setEndDate("2016/02/11");
        dto.setHolidayType("Specific");

        ProcessError processError = new ProcessError();

        DeleteHolidayConverter converter = new DeleteHolidayConverter();
        ProcessCommand command = converter.convert(dto , processError);

        assertTrue("Conversion error occurred", processError.isValid());
        assertTrue("Wrong output " + command, command instanceof DeleteHoliday);

        DeleteHoliday deleteHoliday = (DeleteHoliday) command;

        assertEquals("Library Id is not mapped", dto.getLibraryId(), String.valueOf(deleteHoliday.getLibraryId()));
        assertEquals("FiscalYear Id is not mapped", dto.getFiscalYearId(), String.valueOf(deleteHoliday.getFiscalYearId()));
        assertEquals("Start Date is not mapped ", DateHelper.fromDateString(dto.getStartDate()), deleteHoliday.getStartDate());
        assertEquals("End Date is not mapped ", DateHelper.fromDateString(dto.getEndDate()), deleteHoliday.getEndDate());
        assertEquals("Holiday Type is not mapped ", HolidayType.Specific, deleteHoliday.getHolidayType());
{'fraction_non_alphanumeric': 0.1107103218645949, 'fraction_numerical': 0.013873473917869035, 'mean_word_length': 4.563271604938271, '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': '6965375', 'n_tokens_mistral': 1061, 'n_tokens_neox': 1015, 'n_words': 198}