0

I coded a test for a method in my service. mvn test command can't find any tests.

Service is under

src/main/java/com/nexus/dynamo

So I put the test file in:

src/test/java/com/nexus/dynamo

Still no chance. What am I missing?

@SpringBootTest
public class DynamoDBTests {
    @Autowired
    DynamoService dynamoService;

    @Test
    public void testConvertIntoDTOList() {
        List<String> tableNames = Arrays.asList("Table1", "Table2", "Table3");
        List<DynamoDTO> result = dynamoService.convertIntoDTOList(tableNames);

    Assertions.assertEquals(tableNames.size(), result.size());

    for (int i = 0; i < tableNames.size(); i++) {
        String expectedName = tableNames.get(i);
        DynamoDTO actualDTO = result.get(i);

        Assertions.assertEquals(expectedName, actualDTO.getName());
    }
}
}
tolga
  • 2,462
  • 4
  • 31
  • 57
  • Does this answer your question? [Maven not running JUnit 5 tests](https://stackoverflow.com/questions/53433663/maven-not-running-junit-5-tests). You are most likely missing the `junit-jupiter-engine` dependency. You can solve this by just adding one single [Aggregator](https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter/5.10.0-RC1) dependency that contains the `junit-jupiter-api` as well as the `junit-jupiter-engine` dependency. – Salvino D'sa Jul 11 '23 at 04:23

0 Answers0