Questions tagged [dbsetup]

DbSetup is a free, open-source Java API that helps you setup your database data to execute DAO/Repository unit tests.

DbSetup is a free, open-source Java API that helps you setup your database data to execute DAO/Repository unit tests.

It plays in the same league as tools like DBUnit, but is much simpler, and focuses on a single task: populate the database with test data.

Main author of the library: JB Nizet

10 questions
14
votes
4 answers

How to insert UUID into RAW(16) column

I have the RAW(16) PK column in Oracle, and trying to insert into it using JDBC: PreparedStatement stmt = connection.prepareStatement("insert into COUNTRY (id, state, version, code, name, nationality, issuing_entity, country) values (?, ?,…
Serge Iroshnikov
  • 749
  • 1
  • 6
  • 17
2
votes
0 answers

Command 'db:setup' not recognized"

When I try the command, I get below output, also there is an error at the bottom saying Error: Command 'db:setup' not recognized: /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-1.15.3/lib/bundler/shared_helpers.rb:25: warning: Pathname#untaint is…
Daigham
  • 41
  • 3
2
votes
1 answer

DBSetup - How to do a select statement

I was looking in to DBUnit for sometime until a nice chap on here pointed me to some application he made named DBSetup that was more light weight and easy. I must admit 1) I have found it useful so far (only 2 hours in) but testing without xml seems…
Biscuit128
  • 5,218
  • 22
  • 89
  • 149
1
vote
2 answers

Spring data doesn't increment after DBsetup

I have such question. I'm using DBsetup for spring boot tests and postgresql database. And I'm using DBsetup to set user, but when I'm trying to set another user by spring data I have the next exception: Подробности: Key (id)=(1) already…
Daimon
  • 345
  • 1
  • 5
  • 21
0
votes
1 answer

Configuration DbSetup with Kotlin and Spring Boot

I'm developing Kotlin application with gradle Java 11 Spring Boot 2.3.6.RELEASE DbSetup-kotlin:2.1.0 testcontainers:postgresql 1.15.0 After following this guide DbSetup Kotlin I'm facing problem with test configuration when I would setup my db…
ad3luc
  • 192
  • 1
  • 7
  • 22
0
votes
1 answer

@DataJpaTest autowire dataSource

I'm using dbsetup framework to set up my database. I'm trying to test repository level (I'm using Spring data) using annotation @DataJpaTest. To set up a database using "dbsetup" I need to autowire the datasource, but I can't autowire because…
Daimon
  • 345
  • 1
  • 5
  • 21
0
votes
1 answer

DbSetup : multiple SQL Update

How do I add multiple update sql statements? In this example for those with ID 2,3,4,5 public static final Operation INSERT_LANGUAGE_DATA = Operations.sequenceOf(Operations.insertInto("LANGUAGE") .columns("ID","DWH_CODE", "LANGUAGE"…
theresa
  • 11
  • 3
0
votes
0 answers

DBSetup : SQL support

I am trying to use DBSetup for my testing. I was able to make it run with simple Inserts: public static final Operation INSERT_CURRENCY_DATA = Insert.into("CURRENCY") .columns("ID", "CODE", "NAME", "DESCRIPTION") .values(1,…
theresa
  • 11
  • 3
0
votes
1 answer

Rollback changes in test after manual interaction with the datasource?

I'm using dbsetup for my db tests. The problem is I can't manage to get data rolled back after each test using the aproach which have always worked which is annotating the test case (or method) with @Transactional annotation. I suppose this happens…
kboom
  • 2,279
  • 3
  • 28
  • 43
0
votes
1 answer

DbSetup simple example, SQLException occurs

There's very little information about DbSetup so I couldn't find an answer to this question anywhere else. I need to test Data Access Layer and decided to use DbSetup for it. I tried to use DbSetup user guide this example just to see how it works…
Green Fireman
  • 617
  • 1
  • 11
  • 27