Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

Precise control of time when testing the Spring test code

I'm trying to write a test code to find out about TDD. I'm trying to avoid using Thread and find out how to calculate the exact time to comply with the fast processing among the FIRST principles. Test ...
NINE's user avatar
  • 659
0 votes
1 answer
46 views

Repeated parameterized test with JUnit 5 / Jupiter

I want to repeatedly execute the following test class: class Test { static Foo foo; @BeforeAll static void setUpAll() { foo = generateRandomFoo(); } @ParameterizedTest ...
Борат Сагдиев's user avatar
0 votes
2 answers
45 views

How can I override super.nested test class?

Say, I have an abstract superclass and an abstract test class for testing subclasses. abstract class Superclass { } @RequiredArgsConstructor abstract class SuperclassTest<T extends Superclass> {...
Jin Kwon's user avatar
  • 22.1k
4 votes
2 answers
295 views

Junit Jupiter failes to discover tests

While updating junit from 5.11.4 to 5.12.1 my Java Program failes to perform tests with the following exception: Mär 31, 2025 1:34:48 PM org.junit.platform.launcher.core.DefaultLauncher ...
Alex's user avatar
  • 333
0 votes
1 answer
39 views

MojoFailureException: No tests were executed! Passes when run in VSCode/Intellij, fails in Maven, other tests pass in Maven

When I run this test from VSCode or Intellij it works fine. When I run it from Maven using the command below it fails. Getting this error: org.apache.maven.plugin.MojoFailureException: No tests were ...
Daltin's user avatar
  • 111
0 votes
0 answers
41 views

SpringBoot 3 + Junit5 + Cucumber : Junit Runner don't see cucumber tests

I have to start integration testing in a new springboot project and I'm struggle with Junit and Cucumber. Java 23 Spring Boot 3.4.3 Gradle Cucumber 7.20.1 Junit 5 I added these dependencies ...
Seshen's user avatar
  • 1
3 votes
2 answers
122 views

Not able to use junit5-system-exit

I'm trying to write some unit tests for a command line application which makes use of System.exit(1) to signal a failed execution. Since we are using Java 21, in order to avoid problems with the ...
Bob Rivers's user avatar
  • 5,489
-1 votes
1 answer
55 views

How do I exclude an ArchUnit rule aiming at interface to impact @interface (annotation)

I would like to write an ArchUnit test which says: "the classes that are interfaces should have a name ending with Interface, but not the @interface ones (they are annotations)". For ...
PatPanda's user avatar
  • 5,098
2 votes
1 answer
45 views

How to add executables of "assertAll()" to a list and execute them at the end of the test method?

The following JUnit Jupiter Tests with Mockito are working fine: @Test void testVerifMethod() { System.out.println("*** Start test verify method ***"); mockedList....
tarekahf's user avatar
  • 1,012
1 vote
0 answers
24 views

LiveData test fails: Expected MyState$Success, but got null in ViewModel test with coroutines [duplicate]

Problem Description: I was expecting the LiveData value to be MyState$Success when the test starts, but the value is already set to null. Questions: Is the LiveData emitting its value asynchronously ...
Kleyton Prestes's user avatar
1 vote
0 answers
36 views

Spring load TestPropertySource OR PropertySource (but not both) based on condition

I have a TestBase class that is extended by all test classes. This class runs locally from IntelliJ if the @PropertySource("classpath:/test.properties") is used on it it runs properly in the ...
Tamás Horváth's user avatar
1 vote
0 answers
44 views

JUnit test suite custom selector

I have a custom annotation that maps my tests to a Jira key. @Jira("jira-T123") I want to create a test suite selector that takes a list of Jira keys as a parameter, it then runs any test ...
asenec4's user avatar
  • 387
0 votes
0 answers
72 views

Spring Rabbit Test - Requeue on AmqpRejectAndDontRequeueException Not Working

I’m trying to execute a test using Spring Boot with the 'spring-rabbit-test' dependency. My application flow involves a calls a service, which processes messages in parallel using RabbitMQ queues. In ...
David Pansardis's user avatar
0 votes
0 answers
423 views

org.junit.jupiter.api.extension.ParameterResolutionException: No ParameterResolver registered for parameter [int arg0] in constructor

I'm migrating our tests from Junit4 to Junit5, one of which is a base test class that's been inherited by 29 other classes with a constructor. I changed it to use Junit5, the structure is like below: ...
Fisher Coder's user avatar
  • 3,628
0 votes
1 answer
319 views

How to fully recreate a Testcontainers container before each test?

I'm looking for a solution to have a new container for each test. My issue is that the data that I insert in the database in my first test will interferer the second test. Every test works ...
faycal's user avatar
  • 3

15 30 50 per page
1
2 3 4 5
20