I'm using TestNG soft assertions in my code like.
public class AssertionTest{
private SoftAssert softAssert = new SoftAssert();
@Test(enabled = true)
public void testSoftAssertion(){
softAssert.assertTrue(false);
softAssert.assertTrue(true);
softAssert.assertEquals("India", "US");
softAssert.assertAll();
}
}
When test execution completes test fails(as expected) but result doesn't give details info, rather it gives info like following which doesn't help to understand which asserts failed.
FAILED: testSoftAssertion
java.lang.AssertionError: The following asserts failed:
null, null
I'm expecting output something which will help to understand the result(This type of output is generated when we use hard assertion i.e with Assert class).
FAILED: testSoftAssertion
java.lang.AssertionError: The following asserts failed:
expected [true] but found [false]
expected [India] but found [US]
Is this known defect/drawback with TestNG soft assertion or there is something, which I'm missing?