Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
13 views

I'm trying to work testcode about Java Spring Boot 6.x Websocket code with STOMP but in trouble

public class WebSocketIntegrationTest { @LocalServerPort private int port; @Autowired private MockMvc mockMvc; @Autowired private ObjectMapper objectMapper; private ...
Buddhaman's user avatar
0 votes
1 answer
42 views

Group (or merge) @Unroll tests from Spock in JUnit XML result file

I have a Spock @Unroll test like this: @Unroll def 'A session uses the TLS protocol #enabledProtocolsOfSocket #protocolOfSession'() { given: // ... expect: // ... where: ...
crusy's user avatar
  • 1,492
0 votes
0 answers
23 views

ParameterizedTest JUNIT5 with suspend functions

I'm trying to clean a little bit my code and when testing my datasource I'm repeating a lot the test that returns connection and service error, and I'd like to have a bunch of code that tests ...
StuartDTO's user avatar
  • 891
0 votes
1 answer
24 views

JUnit 5 - Migration - Custom test annotation no longer detected?

I had the following custom test annotation that worked in JUnit4 that IntelliJ and JUnit no longer wants to recognize: @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE }) @Retention(RUNTIME) ...
David S's user avatar
  • 177
1 vote
1 answer
23 views

Java unit test failing due to null KeyHolder

I'm creating new unit tests for an application and I'm stuck because the KeyHolder is not returning a valid object. For context, here are my classes: ScriptDao class: @Repository public class ...
Thiago Apolinario Billieri's user avatar
0 votes
1 answer
46 views

junit 5 runs specific cucumber feature twice

Running Cucumber with JUnit 5 works ok as long as all feature files are run. @Suite @IncludeEngines("cucumber") @ConfigurationParameter(key = Constants.FEATURES_PROPERTY_NAME, value = "...
tbeernot's user avatar
  • 2,574
0 votes
1 answer
32 views

Error occurred prior to updating JUnit 4 to JUnit 5

Before the update, don't run my class RunTest, get a error in execution package automation; import org.junit.FixMethodOrder; import org.junit.runner.RunWith; import org.junit.runners.MethodSorters; ...
Lucas Tenório's user avatar
-1 votes
1 answer
32 views

Mocking the new instance creation call inside a void method without using PowerMock

I have a class where inside a void method it does a new instance creation public class BaseDao { protected void setDataSource(DataSource dataSource) { this.defaultTemplate = new ...
Plainsage's user avatar
  • 145
0 votes
1 answer
28 views

No error message provided by the last invocation of @RetryingTest

I have a test like this (language is Kotlin): @TestInstance(TestInstance.Lifecycle.PER_CLASS) class MyTest { private var i: Int = 0 @RetryingTest(3) fun go() { Assertions....
Boris's user avatar
  • 1,116
0 votes
0 answers
30 views

Get current test method in JUnit 5 using a static mehtod

Is there a way to identify currently running test method (or that the code is not running as part of a test method) in JUnit 5 using a static method (i.e. no matter from where it's called)?. I'm not ...
czerny's user avatar
  • 16.1k
1 vote
0 answers
52 views

Tests execution order: JUnit 5 vs Maven Surefire Plugin documentation

I know that tests should not rely on the order in which they are executed but sometimes bad things happen. I have just fixed a Maven project whose tests were passing when executed by Jenkins but not ...
Pino's user avatar
  • 9,093
-1 votes
3 answers
83 views

doNothing when on abstract class method but should work when called from concreate class instance

I have following structure: class Sample { private Map<String A> serviceMap; @Autowired private List<A> services; @PostConstruct public void init() { this.serviceMap = this....
Rohit Raj's user avatar
0 votes
1 answer
49 views

How can I make a multiple level of mock object

Here is my example of object @Service public class UserSshKeyService { private final RecordEventService eventService; private final UserSshKeyRepository repository; public ...
seunggyu lee's user avatar
-3 votes
1 answer
69 views

Unable to perform Junit Parameterized test execution getting java.lang.Exception: No public static parameters method on class

Getting the following error when running Parameterized test. Please help. @RunWith(Parameterized.class) public class ParsingUtilTest { @Test @Parameters public List<String[]> ...
kanna's user avatar
  • 463
0 votes
0 answers
30 views

I am running into an error related to a junit.jar file not found in <classpath> or <modulepath> when trying to run my tests in NetBeans

I have created Unit Tests for a project of mine and when I click "run test" on my test file, the system return this: C:\Users\Justin Fussell\AppData\Local\NetBeans\Cache\20\executor-snippets\...
Justin Fussell's user avatar

15 30 50 per page
1
2 3 4 5
68