Skip to main content

All Questions

Tagged with
0 votes
0 answers
34 views

Log JUnit ClassOrderer Random Seed with Spring Boot and Logback

I am trying to log the JUnit ClassOrderer random seed using Logback, Spring Boot and Gradle. I found How can I make my JUnit tests run in random order? as related to my problem, but it uses the JUL ...
user2715478's user avatar
  • 1,273
1 vote
1 answer
733 views

jacoco test report configurations from build.gradle file causing build failure

After importing an existing project, gradle build for spring boot is failing in my local. This same project I have been able to build successfully before. The error in console is: Build file 'C:\Users\...
tmanral's user avatar
  • 25
1 vote
1 answer
115 views

Gradle 7.6 'test' target is not including `src/test/resources` in classpath of Spring Boot app

I am working on a Spring Boot 3.0.3 app and using @PropertySource like this: @SpringBootApplication @PropertySource(value = "application-${ENV:LOCAL}.properties", ignoreResourceNotFound = ...
CodeChimp's user avatar
  • 8,084
0 votes
1 answer
200 views

java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual when switching to jakarta dependencies

I am working on upgrading an application to Spring Boot 3.0, which also involves many javax -> jakarta dependency changes. I am still getting a failure compiling a test. I can't seem to hunt down ...
KJ0797's user avatar
  • 233
1 vote
1 answer
360 views

JUnit5 test case on Repository class

I am writing JUnit test cases for the repository layer. I am working on a spring boot gradle project. using the H2 in-memory database for the test cases. This is my Repository layer test cases @...
Anup Panchal's user avatar
0 votes
1 answer
101 views

Mocking is sometimes not applied when running a multi-class testsuite

I am testing a service which heavily relies on project reactor. For many tests I am mocking the return value of the component responsible for API calls. The tests are split over multiple files. When I ...
Anton's user avatar
  • 67
0 votes
1 answer
498 views

java.lang.IllegalStateException: Failed to load ApplicationContext While running gradle clean build

I have 2 Test files but whenever I try to run gradle clean build, I getting java.lang.IllegalStateException: Failed to load ApplicationContext, when i remove the @AutoConfigureMockMvc, then i get an ...
Nishant's user avatar
1 vote
0 answers
851 views

@SpringBootTest context does not load because it cannot find @Autowired Mapstruct @Mapper components

I have a simple RESTful API built with Spring Boot that works perfectly when testing manually at start up. In fact, it also works well when conducting unit tests. However, I'm unfortunately able to ...
Billy Bolton's user avatar
2 votes
1 answer
1k views

test if exception was thrown - java

I have the following code (the part that throws the exception is obviously part of a class but I only put the relevant lines). if (found==null) { log.warn("Got request from source IP - " ...
jenny's user avatar
  • 105
0 votes
2 answers
1k views

Unable to load dataset from "<filePath>" using class com.github.springtestdbunit.dataset.FlatXmlDataSetLoader

I wrote a demo of Spring Boot + JPA, and here I met a question that confused me couple of days when I try to do some tests on repository. The error is **java.lang.IllegalArgumentException: Unable to ...
malcopolocei's user avatar
0 votes
2 answers
4k views

Cannot load driver class: "org.h2.Driver" during spring boot tests when using gradle

My application uses MySQL, but I want to use H2 for testing. I added testImplementation 'com.h2database:h2' to gradle configuration and set spring.datasource.driveClassName="org.h2.Driver" ...
pgreen2's user avatar
  • 3,621
0 votes
1 answer
445 views

How to use local JUnit Jar from Gradle instead of Maven Central?

I'm trying to run my JUnit tests in an environment where I have no internet access but I have SSH access and can sync my local files etc. I thought I could just add my JUnit jar to the project but ...
Charlie's user avatar
  • 2,181
11 votes
3 answers
29k views

TestEngine with ID 'junit-vintage' failed to discover tests - JUnitException: Failed to parse version of junit:junit: 4.13.2

I'm having a very weird issue with my Gradle config and JUnit, I have tried updating to 5.7+ but I'm getting the following exceptions: org/junit/jupiter/api/extension/ScriptEvaluationException java....
David Galvis Sandoval's user avatar
1 vote
0 answers
81 views

Gradle verison updates for cucumber java junit selenuim framework

I would like to update my framework versions to latest, My current build.gradle: dependencies { compile group: 'com.google.guava', name: 'guava', version: '22.0' compile group: 'org.seleniumhq....
Raj's user avatar
  • 21
0 votes
1 answer
409 views

Not test found with gradle and intellij only when press rerun failed tests

When I run a test and the test fail and I press the button Rerun failed tests I get the following error Test events where not received No tests found for given includes, but is weird because the test ...
RdTek's user avatar
  • 101

15 30 50 per page