I have this doubt about JUnit logic.
I have implemented this simple method:
@Test
public void testBasic() {
System.out.println("testBasic() START");
assert(true);
System.out.println("testBasic() END");
}
And, as expected, it is green because the assert() condition is setted to true.
Then I change it using:
assert(false);
And running the test it is green again also if the condition is false.
Reading the documentation I know that I also have the assertTrue() to test if a condition is true or false so I can use it.
But then: what is the exact purpose of the simple assert() method? When have I to use it and how is used?