[java] Update tests for MethodNamingConventions

This commit is contained in:
Cyril
2021-08-06 14:56:19 +02:00
committed by GitHub
parent f76c5eec1a
commit 8acb7dc781

View File

@ -212,9 +212,11 @@ public class TournamentTest {
<expected-messages> <expected-messages>
<message>The JUnit 5 test method name 'testGetBestTeam' doesn't match '[a-z][A-Za-z]*Test'</message> <message>The JUnit 5 test method name 'testGetBestTeam' doesn't match '[a-z][A-Za-z]*Test'</message>
<message>The JUnit 5 test method name 'getBestTeam' doesn't match '[a-z][A-Za-z]*Test'</message> <message>The JUnit 5 test method name 'getBestTeam' doesn't match '[a-z][A-Za-z]*Test'</message>
<message>The JUnit 5 test method name 'getWorstTeam' doesn't match '[a-z][A-Za-z]*Test'</message>
</expected-messages> </expected-messages>
<code><![CDATA[ <code><![CDATA[
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
public class TournamentTest { public class TournamentTest {
@Test // note that this is also a junit 3 test, but the junit 5 rule applies @Test // note that this is also a junit 3 test, but the junit 5 rule applies
@ -225,6 +227,10 @@ public class TournamentTest {
public void getBestTeam() { public void getBestTeam() {
} }
@ParameterizedTest // this is a paramterized junit 5 test
public void getWorstTeam(String param) {
}
// this is ok // this is ok
@Test @Test
public void getBestTeamTest() { public void getBestTeamTest() {