lundi 30 septembre 2019

replaced return of long value with value + 1 in PIT mutation test

I have this Utils class:

public final class DateUtils {

    private DateUtils() {
    }

    public static long toEpochMilli(OffsetDateTime dateTime) {
        return (dateTime == null) ? null : dateTime.toInstant().toEpochMilli();
    }
}

and this Test class:

public class DateUtilsTest {


    @Test
    public void assertReturnEpochMilliConvertedWithoutException() {
        OffsetDateTime dateTime = OffsetDateTime.now();
        assertThat(DateUtils.toEpochMilli(dateTime)).isNotNull();
    }

    @Test
    public void assertReturnNullWhenDateTimeIsNull() {
        assertThat(DateUtils.toEpochMilli(null)).isNull();
    }

}

but I have a SURVIVED test on the line return dateTime.toInstant().toEpochMilli();

with the mutation:

1. replaced return of long value with value + 1 for io/bendiciones/buenas/noches/DateUtils::toEpochMilli → SURVIVED

but I don't know what else should I test

Aucun commentaire:

Enregistrer un commentaire