Category "junit5"

How to test a repository with a user that have update rights and the test needs tot add records to the database

I use mysql and spring 5, spring-data-jpa and spring-boot and JUnit5. This must be a common problem but I don't see te sollution. I have to test a repository wi

Maven Surefire test failed: Unsupported class file major version 61

I am trying to create a project in IntelliJ using Maven, but when running mvn install or mvn test in order to run the simple JUnit tests I wrote, it fails with

junit vintage failed to discover tests: could not find method with name xxx

Im using spockframework and junit5, below is pom: <!-- https://mvnrepository.com/artifact/org.codehaus.groovy/groovy --> <dependency>

how to write junit for this code service layer in springboot

i am new in junit I want to test this method with junit5 when i try to test this custom exception like this: CustomExceptionMessage exception = assertThrows(Cu

IntellIj not displaying exceptions from @BeforeAll JUnit5

In IntelliJ, with a Springboot project (2.6.6) using JUnit 5, given the following test class, IntelliJ doesn't display exceptions occuring in the @BeforeAll met

NullPointerException using DropwizardAppExtension and JUnit5

My DropWizard JAX-RS project was using the DW's now-deprecated JUnit 4 rule for testing, which at least worked. I recently attempted to change to JUnit 5 and us

Maven surefire plugin + JUnit5 dynamic tests - how to override test naming?

Assume we have a JUnit5 dynamic test like this: public class ProbaTest { @TestFactory public Iterable<DynamicNode> tests() { return Collec

DMN, xml parsing, autogenerating tescase

A simple dmn model is created with one input and a decision for that . How to parse the xml of the dmn model using saxon and autogenerate testcase?

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