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

I’m using Payara 7.2025.1 with payara-micro-managed, Arquillian, and JUnit 5. When I run my tests, a Payara Micro instance starts and deploys correctly, but it seems that the tests themselves are ...
Albert Albatros's user avatar
0 votes
0 answers
56 views

I am using Mockito 5.20.0 to mock a static method, but the mock is not correctly closing / the mocked behavior is leaking outside of the tests it is intended to apply to. This is only a problem if ...
PunDefeated's user avatar
2 votes
0 answers
39 views

I have the following integration test which is setting up the database with @DatabaseSetup and checking that after doStuffThatAffectsTheDb() executes, the db has been modified as expected with @...
elcye's user avatar
  • 413
2 votes
1 answer
121 views

I'm organizing my tests using JUnit 5's @Suite and @SelectClasses, but need to control the execution sequence of the test classes. According to the documentation, @SelectClasses doesn't guarantee ...
Abhiram Reddy Milkuri's user avatar
-1 votes
0 answers
65 views

Disclaimer: There are a couple of questions for this exact exception, sadly none of those match my environment or circumstances (thus i think this question is unique) In my case i have a: working ...
Eugen Mayer's user avatar
1 vote
1 answer
115 views

I'm working on a user-related service that handles personal information. While writing unit tests with Mockito, I ran into dependency issues with Byte Buddy, which prevented me from using the latest ...
Apurva Agarwal's user avatar
1 vote
0 answers
72 views

I am trying to create a fat JAR that includes my application and its tests to run them externally using the JUnit Console Launcher. The build succeeds, and the JAR is created. However, when I execute ...
novengail's user avatar
1 vote
0 answers
98 views

I’m using the latest version of Android Studio (Narwhal | 2024.3.1 Patch 3) with Android Gradle Plugin 8.13.0, and I’m getting the following error when building my project: 6 files found with path '...
Tugba's user avatar
  • 21
0 votes
1 answer
110 views

@ActiveProfiles("it") @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ContextConfiguration(classes = ServiceApplication.class) @AutoConfigureWireMock(port = 0) @...
emoleumassi's user avatar
  • 5,179
1 vote
1 answer
78 views

For my JUnit 4 tests, a handful of database inserts have to be performed by code. However, the application framework has some overhead, which makes this step really slow. To save time, I tried to run ...
mjn's user avatar
  • 36.7k
-1 votes
0 answers
57 views

Basically i have a ktor exposed web app and i am trying to write this test and client.get("assets") fails to see the asset created in the outer transaction block. It tried to use what is ...
laiboonh's user avatar
  • 1,465
0 votes
0 answers
28 views

I have a mobile application built with Kotlin and linked with firebase firestore, I have a 'LoginOnline' method which call Firebase Authentication to check the user credentials. I need to know how to ...
Ali Alnader's user avatar
0 votes
1 answer
78 views

I'm making a JUnit test class for a java class in Eclipse and I'm unsure of what steps to take to fix it. I tried to add the JUnit 5 Library to the build path as part of "Fix project setup",...
Aspen's user avatar
  • 11
0 votes
0 answers
55 views

I have this Junit test: @RunWith(MockitoJUnitRunner.class) class NotificationServiceTest { private static final Long EMAIL_ID = 1L; private static final Long ORGANISATION_ID = 1L; private ...
Nunyet Calçada's user avatar
0 votes
0 answers
30 views

I am working with junit tests and I have a timeout on them (300s). But when the test timeout I get the information on class level. But I want information on individual test method on how much time it ...
Binary_Beast's user avatar
-2 votes
1 answer
64 views

Trying to mock a constructor of FileWriter so that I can test the catch block. Here is my sample code: public void write01() throws IOException { BufferedWriter bufferedWriter = null; try { ...
Oxnard's user avatar
  • 418
2 votes
1 answer
83 views

I'm using the relatively new test suite plugin from Gradle: https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html. I assumed that the different test suites, including the default test ...
Kevin's user avatar
  • 1,861
0 votes
1 answer
133 views

I´d been running tests for my application with mockito and junit and they were fine, but all of a sudden, the tests stopped working without any error message, the tests appear in the left botton ...
F Rafael Alvarez's user avatar
0 votes
2 answers
133 views

I need to disable some unit tests depending on a string variable defined in my src/app/test/resources/application.yml. ENVIRONMENT: local I'm using Spring's @DisabledIf which takes a single ...
gene b.'s user avatar
  • 12.7k
0 votes
0 answers
17 views

I am facing difficulty in running Junit test cases. I am writing a test case for startUpdateRootEmailAddress. After adding below statement: import software.amazon.awssdk.services.account.model....
Vinanti Kalangutkar's user avatar
0 votes
1 answer
159 views

I want to run tests on my app using h2 as a database but every time I attempt to run a test it shows me an exception saying that h2 db is empty. None of the related questions I`ve read helped me. This ...
Horacio García Magallanes's user avatar
0 votes
1 answer
55 views

I have this situation with my Spring Boot application and the management of tests: The application is running correctly. But for its unit tests, regular tests are OK, while integration tests are ...
coriuser's user avatar
0 votes
0 answers
36 views

I have a problem with reading application.properties by @SpringBootTest when I start it with a command: java "-Dfile.encoding=UTF-8" "-Dallure.results.directory=config/reports/allure&...
Adam Jędrzejko's user avatar
2 votes
3 answers
222 views

I have this import in intelliJ IDEA: import static org.junit.jupiter.api.Assertions.*; and it says cannot resolve symbol 'api' package com.programming.techie; import static org.junit.jupiter.api....
F Rafael Alvarez's user avatar
0 votes
1 answer
102 views

I'm writing a small app and have encountered the following issue: @Test public void givenSkiExists_whenAddingNewSki_thenThrowEntityAlreadyPresentException () { skiManager.addEntity(new Ski(new ...
JustSightseeing's user avatar
1 vote
1 answer
52 views

Spring beginner here. I am making two custom annotations @Satisfy and @Verify, meant to be used to track requirements in code. @Satisfy denotes where the requirement is implemented @Verify denotes ...
Kurt Andersen's user avatar
0 votes
2 answers
58 views

This is part of my pom.xml: <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>3.5.3</version> <configuration> <excludedGroups>slow<...
yegor256's user avatar
  • 106k
1 vote
2 answers
185 views

In my Spring Boot app, I have some tests that look like this @ExtendWith(MockitoExtension.class) class InviteServiceTests { @Mock private UserService userService; @Mock private ...
Dónal's user avatar
  • 188k
-3 votes
1 answer
381 views

I want to test a method which asynchronously calls an API. Somewhat like below - private void callExternalAPI(){ CompletableFuture.runAsync(() -> { try{ //Calling the API }...
Prachi Srivastava's user avatar
0 votes
1 answer
86 views

I'm working with Kotlin Multiplatform in a multi-module setup. I want to create a dedicated module that defines reusable test setup and teardown logic—similar to JUnit rules—in the commonMain source ...
J. Hegg's user avatar
  • 2,273
0 votes
1 answer
43 views

Suppose if you are going for the creation of test cases in VS code then how to build the test file for that by commands or built-in options ?
Kunal Bindra's user avatar
1 vote
1 answer
653 views

I have a junit test suite which uses some AutoCloseable resources, which I take care of closing after all the tests has been executed using org.junit.jupiter.api.AfterAll annotation, see the example: ...
pochopsp's user avatar
  • 1,149
-1 votes
1 answer
48 views

I got some problem with Junit (Spring Security 6.5), I have an API Register to testing which already work well when test with Postman (fully output), When test with Junit, I got test fail with error ...
phuc luu's user avatar
9 votes
2 answers
5k views

I cannot build my project after upgrading Spring Boot from 3.4.6 to 3.5 When I try to, Gradle says there were failing tests: Execution failed for task ':core:test'. > There were failing tests. See ...
Pandab's user avatar
  • 351
0 votes
0 answers
55 views

Since I migrated to Hibernate 6.x+ I started having problems with shared sessions in unit sessions. I have a problem where I have the following structure: I have a test that first creates a record (...
Igor Dutra's user avatar
1 vote
0 answers
86 views

I am trying out unit testing in Java with JUnit for an assignment. Previously, we were tasked with creating a generic puzzle-solving algorithm using graph searching algorithms. The important part is ...
Nir'sCousin's user avatar
2 votes
1 answer
153 views

I have a Springboot API that includes a model class Payment, a @Service class PaymentService, as well as a JPA repository, controller, and some utility classes. I have integration tests that mostly ...
user30553141's user avatar
0 votes
0 answers
43 views

I'm trying to write some unit tests for a many to many relationship with an association table with a couple extra columns. Realistically if I try to delete an ingredient and then flush the db it ...
kirsten's user avatar
2 votes
1 answer
79 views

When running a test program in an unnamed module under JUnit the ResourceBundleControlProvider.getControl() method is not invoked. I have this implementation of ResourceBundleControlProvider: ...
Clyde Gerber's user avatar
0 votes
0 answers
37 views

I am running my 2 test suites using Ant build, both contain arround 30 test cases. In the error it not giving any information which test case making this issue. I run with detaled log (-v option) and ...
Sun's user avatar
  • 3,594
0 votes
1 answer
50 views

Goal: TC need to pass Using: junit 4.12 jmockit 1.54 Adopt JDK 21 test case Code: public class UTBOMRetrievalDAO { @Tested BOMRetrievalDAO bomRetrievalDAO; @Injectable ServerContext ...
Sun's user avatar
  • 3,594
0 votes
1 answer
63 views

I have a cucumber suite project which runs on top of Junit. I have updated the version from junit 4 to 5 and cucumber 4 to 7 both are BOM dependencies. In Junit-4 I was using cucumber-jvm-parallel-...
Azarudeen Asraff's user avatar
0 votes
1 answer
203 views

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
1 answer
57 views

I am trying to write a JUnit test for a relatively basic class that is responsible for persisting an object with a Spring Data CrudRepository, then extracting the generated ID from the object and ...
kickd16's user avatar
2 votes
1 answer
92 views

My JUnit tests simply aren't running. When I tried, nothing happened. JUnit displayed 0/0 tests run, and there were no logs nor errors in the console I checked the different possible causes in this ...
Lucas Brélivet's user avatar
-3 votes
1 answer
502 views

I have a class method that updates the state of the object in a thread-safe manner. I want to add some basic unit testing to show that upon concurrent execution certain invariants still hold in order ...
Jim's user avatar
  • 4,529
0 votes
0 answers
69 views

We are using Teamcity Kotlin DSL to create our buildings in TeamCity and writing some unit tests for the build types. In the build.gradle.kts , we have added the dependencies as followed: dependencies ...
fzhurd's user avatar
  • 179
0 votes
0 answers
30 views

I want to add a listener for instrumented tests (the src/androidTest subrirectory). I added this, and I see that the test listeners listen only to unit tests. (############### is printed always, but ...
18446744073709551615's user avatar
0 votes
1 answer
345 views

I'm trying to run JUnit tests in Visual Studio Code without using Maven or Gradle, just using plain .java files and .jar libraries. Project Setup: I'm using VS Code with the Java Extension Pack, and ...
Crescenzo De Marco's user avatar
0 votes
0 answers
54 views

I have created a library using Spring to send message using Kafka Template. I am using the library in Spring boot application. The configuration fields are fetched from application.yml in Sprint boot ...
Thiagarajan Ramanathan's user avatar

1
2 3 4 5
562