Having the test case using JUnit 4.12:
import static org.hamcrest.CoreMatchers.nullValue;
import static org.junit.Assert.assertThat;
//...
@Test
public void testShouldReturnNull() {
final Long result = getIdFunction.apply(null);
assertThat(result, is(nullValue()));
}
Sonar says:
Add at least one assertion to this test case.
Why does Sonar says that there are no assertions and how it can be fixed?
SonarQube v6.7