Skip to content

Instantly share code, notes, and snippets.

@appkr
Last active August 8, 2019 06:08
Show Gist options
  • Save appkr/12043697c04855ff413f136e62b8e79b to your computer and use it in GitHub Desktop.
Save appkr/12043697c04855ff413f136e62b8e79b to your computer and use it in GitHub Desktop.
use h2 database in file
# config/application.yml

spring:
    application:
        name: deliverybundler
    datasource:
        type: com.zaxxer.hikari.HikariDataSource
        url: jdbc:h2:file:./build/h2db/deliverybundler;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MULTI_THREADED=FALSE
        name:
        username: sa
        password: secret
        hikari:
            auto-commit: false

# to keep the database
    jpa:
        hibernate:
            ddl-auto: create

To keep the populated data during test

@Test
@Rollback(value = false)
public void testSort() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment