I am trying to kill a conditional Mutation, below is my code
public String check(Integer value) {
String valueStr = String.valueOf(value);
String value2;
if (valueStr.length() > 2) {
value2 = valueStr.substring(valueStr.length() - 2);
} else {
value2 = valueStr;
}
return value2;
}
My test has
package com.example.demo;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class RunTest {
@Test
public void run(){
Run r=new Run();
Assertions.assertEquals(2,r.check(123).length());
Assertions.assertEquals(2,r.check(12).length());
Assertions.assertEquals(1,r.check(1).length());
}
}
I am not able to kill the mutation.I am getting 1. changed conditional boundary → SURVIVED