Category "junit5"

How to find the selected id in my List<String> ids arraylist?

Here is my code. I am trying to use JUnit to test the deleteUsers() method, but everytime I write my test, it deletes all the users that I have in the database.

How to properly test kafkaTemplate.send() within a function in Junit5?

I'm learning how to write tests and especially tests that have a producer in it. I cannot post all the classes because it's HUGE (and not mine, I should just pr

How to register TestExecutionListener in Junit 5 and detect if all tests are executed

Hi I am trying to implement integration test using JUNIT 5 as a framework and we just want to start all the process once before all the test are executed and st

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/ex

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/ex

@TestPropertySource is not helping to fetch configuration property values

In the following test code snippet, values of number_of_days.last and number_of_months.plan are not getting fetched from the configuration file.Please check and

Does JUnit 5 support test method execution in alphabetical order or any similar functionality? [duplicate]

JUnit 4 has @FixMethodOrder(MethodSorters.NAME_ASCENDING) to support test execution in alphabetical order. Is there any similar functionality

How to combine ExtentReports for multiple JUnit5 test classes into one HTML file?

I'm using ExtentReports (version 5.0.5) with JUnit 5. Here is my BaseTest class snippet. public class BaseTest { protected static ExtentReports extent;

New code is not showing in Sonarqube Coverage on new code

I am trying to cover few lines of the code with junit test case. Though the test case is covering the lines which I found after debugging the test case, but in

Maven not running JUnit 5 tests

I'm trying to get a simple junit test running with maven but it is not detecting any tests. Where am I going wrong? The project directory Project -> src ->

Comparing LocalDate using Hamcrest in Junit Test Case

I am my unit testing my REST Controller, one of whose field is LocalDate in my Test Case. Code below: @Test public void getByExternalTransactionId() throws E

Set the test name for DynamicTest

I'm leveraging the DynamicTest functionality of JUnit 5.3.0-M1 and there's a showstopping point I can't seem to figure out with regards to the test name. My ex

Why isn't @DisplayName working for me in JUnit 5?

For some reason, I'm really having a hard time getting display names to actually be respected in JUnit 5 with Kotlin. Here's a test file I created for the purp

JUnit 5, Test not failing despite @Timeout

I wonder what I am missing, but my JUnit 5 test with @Timeout is not failing when it should. Here is my test class: package tests; import static org.junit.jupi

Gradle problems of adding koin test dependencies

I'm a beginner with gradle and would like to use koin in my Kotlin project. However, I get the following error Execution failed for task ':compileTestKotlin'. &

How to add @AllureId annotation to tests in source code using cli?

Our application is spring boot based project written with kotlin. There is great plugin for JetBrains IntelliJ IDEA for Allure support. The plugin provide a pos

"message":"Head \"https://registry-1.docker.io/v2/testcontainers/ryuk/manifests/0.3.0\": unauthorized: incorrect username or password" when run test

I have added testcontainer in spring boot app import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @Testcont

@CucumberOptions in cucumber-junit-platform-engine

I'm trying to migrate my cucumber tests from cucumber-junit to cucumber-junit-platform-engine to be able to use new platform features. How do I redefine my runn

In JUnit 5, how to run code before all tests

The @BeforeAll annotation marks a method to run before all tests in a class. http://junit.org/junit5/docs/current/user-guide/#writing-tests-annotations But is

JUnit5 - How to get test result in AfterTestExecutionCallback

I write JUnit5 Extension. But I cannot find way how to obtain test result. Extension looks like this: import org.junit.jupiter.api.extension.AfterTestExecutio