Our project has few Unit Tests in which the asserts are passed as a lambda or consumer to the test class. Example as below. How to write a cypher rule constraint such the asserts are identified and the method is not flagged as without assert. Currently using junit4:TestMethodWithoutAssertion
Test Method :
@Test
public void testSuccessfulIdempotency(){
transportConsumerFlow.accept(Mockito.mock(TransRequest.class),
(t)->{
assertEquals(t, expectedResponseMessage);
});
}
In the sample above, the assert is actually present and valid. But the concept junit4:AssertMethod could not detected may be because it is present as a consumer instead of a direct invocation in Test method.