89 questions
1
vote
1
answer
187
views
DBRider(DBUnit) won't insert data into test container in spring boot
Can anyone using DBRider / Test Container in spring boot give advice ?
I've been using DBRider/Testcontainer without any issue, but at some point , it doesn't work out.
It seesm ...
0
votes
1
answer
622
views
How to represent a bytes array with DB Rider in YAML configuration
I have a series of test cases using Spring Jdbc, Database Rider, and H2 — with Java 17.x. Everything works fine, but I can't find a way to represent a byte array in the YAML configuration file :/
This ...
-1
votes
1
answer
4k
views
How to set current date in yaml file
I am creating a dataset in yml format to initialize a table in a postgresql database
- id : 5
description : "test5"
is_deleted : false
last_redaction_date : 2021-12-13 15:09:52....
0
votes
1
answer
2k
views
Configure SQL Server in memory (embedded) database for testing purpose in Spring
How do I configure my Spring Boot application so that when I run unit tests it will use embedded SQL Server so that stored procedures can be executed?
0
votes
2
answers
142
views
"; expected "., ("; running JPA query
I have this jpa query
@Query(nativeQuery = true, value = "with\n"
+ " validBonansasAssignation as (\n"
+ " select aga....
0
votes
0
answers
196
views
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 ...
0
votes
0
answers
404
views
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 ...
4
votes
5
answers
16k
views
DBUnit: NoSuchColumnException Non-uppercase input column in ColumnNameToIndexes cache map. map's column names are NOT case sensitive
My java application stores your information in MySql database version 8. The user information and password are stored in this database. I am implementing an integration test to test the method that ...
4
votes
0
answers
406
views
Why does my UUID column result in a "Bad Base64 Input Character" with DBUnit?
I have a Hibernate DAO class with a UUID column, works fine when i run it on my server against mySQL. However, i am trying to write an integration test using DBUnit, and i get a strange error message: ...
2
votes
1
answer
2k
views
DBUnit insists on inserting null for unspecified values, but I want the DB default value to be used
I'm having this problem with DBUnit causing a SQL insert error. Say I have this in my dbunit testdata.xml file:
<myschema.mytable id="1" value1="blah" value2="foo" />
I have a table like this (...
2
votes
1
answer
478
views
Problems using dbunit with Spring (without spring-test-dbunit)
I'm trying to use dbunit to test my DAOs. We use Spring in a version that is not compatible with spring-test-dbunit. I can't autowire my dao beans into my test class, because then I would have to use @...
7
votes
2
answers
6k
views
org.dbunit.dataset.NoSuchColumnException
I'm getting the following error when I run my tests:
org.dbunit.dataset.NoSuchColumnException: myTable.MYFIELD - (Non-uppercase input column: myfield) in ColumnNameToIndexes cache map. Note that the ...
0
votes
2
answers
1k
views
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 ...
0
votes
1
answer
153
views
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 ...
0
votes
1
answer
1k
views
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 ...
1
vote
1
answer
2k
views
SpringTest DBUnit: Failed to Load Application Context cause by Unable to locate keycloak.json
Hi I am new to spring mvc and would like to create an integration test using spring test dbunit but I am encountering an error. Keycloak.json file was not found but it exists under the test folder. ...
1
vote
0
answers
2k
views
Spring Test DBUnit does not create a dataset
I use SpringBoot, Spring Test DBUnit.
I wrote a test:
ShortenerAppTest:
@TestPropertySource(locations = "classpath:application-test.properties")
@RunWith(SpringJUnit4ClassRunner.class)
@...
0
votes
1
answer
2k
views
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(...
1
vote
2
answers
2k
views
DBUnit order for dataset
I have the following quite strange dataset for DBUnit:
<persons id = "1"
first_name ="TestName99"
second_name = "TestSecondName"
father_name = "TestFatherName"
...
1
vote
1
answer
2k
views
the object is already closed in integration test
I am using spring-test-dbunit to run integration tests. I want to use different datasets inside one class.
I have BaseRepositoryTest class
@RunWith(SpringJUnit4ClassRunner.class)
@...
3
votes
0
answers
995
views
DbUnit row order in data verification
I'm trying to do a DbUnit data verification in an insert operation between a table in XML file and a table in the database. I´ve sorted both tables by "ID" and then ignored it in the comparison ...
0
votes
1
answer
649
views
Why am I receiving DbUnit ComparsionFailure Exception?
I am stuck with update test for my DAO. Update method works just fine, but at the end I get an exception:
junit.framework.ComparisonFailure: value (table=theme, row=0, col=Id) expected:<[1]> but ...
2
votes
1
answer
2k
views
org.dbunit.dataset.NoSuchTableException: localized_values
I am trying to using spring test dbunit.
https://springtestdbunit.github.io/spring-test-dbunit/
As I am using spring 4.1.x I decided to use version 1.2.1 for spring-test-dbunit and 2.5.2 for core ...
0
votes
1
answer
189
views
Constraint identification with DBUnit / Constraint names
When some database constraint fails during the run of dbunit tests, its name is printed out with the exception, e.g.
Caused by: org.hsqldb.HsqlException: integrity constraint violation: foreign key ...
1
vote
2
answers
2k
views
How to ignore existing elements of tables when testing database with DBUnit
I'm using DBUnit for testing my database.
My database is not empty, So what I want is to ignore existing elements and to test just data inserted by my test.
This is an example of how test is run:
...