Questions tagged [spring-test-dbunit]

Spring DBUnit provides integration between the Spring testing framework and the popular DBUnit project.

Spring DBUnit provides integration between the Spring testing framework and the popular DBUnit project. It allows you to setup and teardown database tables using simple annotations as well as checking expected table contents once a test completes.

91 questions
0
votes
2 answers

"; expected "., ("; running JPA query

I have this jpa query @Query(nativeQuery = true, value = "with\n" + " validBonansasAssignation as (\n" + " select aga.autorisation_bonansas_id, aga.autorisation_bonansa_assign_id as iBonansaAffectation_id,\n" …
0
votes
1 answer

How to inspect database when running with spring-db-unit

We run our tests with spring-db-unit, the forked and maintained one. The tests run just fine and can access and modify the data. But when I was debugging some tests I realized that the database stays empty all the time! My assumption is that the…
dube
  • 4,898
  • 2
  • 23
  • 41
0
votes
0 answers

Failed to collect dependencies from springtestdbunit

I have some issue Dbunit and unable to solve it. The issue is maven unable to collect dependencies form dbunit test. Here is a log error. Java 7 Maven 3.6.1 Could not resolve dependencies for project net.tao:DD-sms-delivery-report:jar:1.1: Failed…
anggor
  • 79
  • 1
  • 10
0
votes
0 answers

How to setup Spring Batch with DbUnit?

I'm trying to test spring batch using dbunit but when batch runs HibernateCursorItemReader it doesn't see temporary created objects in the db. But if I create entities using HibernateDaoSupport everything is fine and I can work with test data. Does…
Arlengur
  • 1
  • 1
0
votes
1 answer

Java DBUnit AmbiguousTableNameException incorrectly thrown

I'm experimenting with DBUnit (2.6.0) and I'm trying to export my full database (PostgreSQL). However the following exception is thrown: Exception in thread "main" org.dbunit.database.AmbiguousTableNameException: FLYWAY_SCHEMA_HISTORY This is…
Tim
  • 445
  • 5
  • 19
0
votes
1 answer

How do I check for null column values with assertionMode = DEFAULT in DBUnit?

I have a table with 2 rows and 34 columns. 3 of the columns should be null. When using assertionMode = NON-STRICT, I can specify 34-3=31 columns in my after.xml file, and DBUnit will realize that the 3 missing columns are supposed to be null. DBUnit…
cptwonton
  • 500
  • 3
  • 16
0
votes
1 answer

spring-test-dbunit can't find @Test annotation

I've set up spring-test-dbunit but I get following exception: testSometing(com.my.package.dbunit.DbUnit) Time elapsed: 13.013 s <<< ERROR! java.lang.NoSuchMethodError: …
Pascal Petruch
  • 344
  • 3
  • 16
0
votes
1 answer

DBunit Circular depedency in dataset.xml

Im trying to create dataset for unit test. Player has reference to Team table and vice versa. So when I run test (no matter what is created first, team or…
flgdev
  • 467
  • 1
  • 6
  • 17
0
votes
2 answers

Spring Boot DBUnit test getting NoSuchBeanDefinitionException

I am trying to create a simple SpringBoot DB Unit repository test but I'm getting a: NoSuchBeanDefinitionException: No qualifying bean of type 'example.ItemRepository' available: expected at least 1 bean which qualifies as autowire candidate.…
Eduardo
  • 6,900
  • 17
  • 77
  • 121
0
votes
0 answers

Spring TestExecutionListeners and execution order

I use Spring + TestNg + Spring Test DBUnit. Right now I ran into the issue that Spring Test DBUnit @DatabaseSetups annotation is executed early than TestNG @BeforeMethod annotation. I need to change this behavior to let methods annotated with TestNG…
alexanoid
  • 24,051
  • 54
  • 210
  • 410
0
votes
1 answer

unit test using spring-test-dbunit

My case is that I have two tables which one table has foreign key constraint to the other, and the reference is the other table's field 'id' which will auto increment with every insert, and cannot be omitted for this reference relation, and when I…
0
votes
1 answer

How to solve foreign key constraint violation issue when using springtestdbunit?

I have two tables, one of table A's fields references table B's field, I use annotation @DatabaseSetup to do the importing of xml file, and I wrote both table A and table B's data in the dataset in the xml file. when I run the unit test, it says…
NullPointer
  • 412
  • 7
  • 17
0
votes
1 answer

Spring Test DBUnit H2Connection Refused

I would like to create an integration test for my project and I am new to Spring Test DB Unit. Unfortunately upon running the test I am encountering an error given below: Error: Connection refused: Connect localhost I also added the the Base Test…
James
  • 211
  • 3
  • 4
  • 12
0
votes
1 answer

Spring Test DB Unit: Failed to load Application Context

Below is the error I encountered while running Spring-Test-DBUnit. Have you encountered the same issue when doing integration test. Do you have any idea on how can this be resolved? Thanks. testCreatePerson(some project file): Failed to load…
James
  • 211
  • 3
  • 4
  • 12
0
votes
1 answer

org.dbunit.database.AmbiguousTableNameException: PROFIL thrown by my integration test

I am working with the following tables (I created a miniture of the DB cause it is so big) In my Integration test I configured DBUnit to work with the following data sources: @DbUnitConfiguration(databaseConnection={"mainDataSource",…