I would like to create a ParametrizedTest that tests a bunch of different AIs at the same time, making sure that the don't take too long to do their calculations. However, I cannot create new Objects in the ValueSource, so I'm unsure how to proceed.
The problem is that I need to pass constant values to ValueSource, which is where I get stuck. How can I make my objects constant?
@ParameterizedTest
@ValueSource(ais = {new AdvancedAI(), new blabla})
public void moveCalculatedInTimeBy(AI TestAI) {
long startTime = System.currentTimeMillis();
Turn turn = Turn.initialTurn();
Move calculatedMove = TestAI.calculateMove(Optional.empty(), turn);
long endTime = System.currentTimeMillis() - startTime;
assertTrue(endTime <= 8000);
}