Skip to content

Commit

Permalink
Legger til flyway postgresql moduk.
Browse files Browse the repository at this point in the history
Byy feiler fordi graphql client generator ikke støtter Spring Boot 3.3.x enda.
ExpediaGroup/graphql-kotlin#1975
  • Loading branch information
ramrock93 committed Jun 26, 2024
1 parent e0f6e98 commit 0c0c667
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
16 changes: 10 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ plugins {

group = "no.nav"
version = "0.0.1-SNAPSHOT"
java.sourceCompatibility = JavaVersion.VERSION_21

java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

configurations {
compileOnly {
Expand Down Expand Up @@ -107,6 +111,7 @@ dependencies {
// Database
runtimeOnly("org.postgresql:postgresql:$postgresqlVersion")
implementation("org.flywaydb:flyway-core")
implementation("org.flywaydb:flyway-database-postgresql")
testImplementation("org.testcontainers:junit-jupiter:$testContainersVersion")
testImplementation("org.testcontainers:postgresql:$testContainersVersion")

Expand Down Expand Up @@ -159,9 +164,8 @@ tasks.withType<Test> {
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "21"
compilerOptions {
freeCompilerArgs.add("-Xjsr305=strict")
}
}

Expand Down Expand Up @@ -196,13 +200,13 @@ sonarqube {
* For mer info, se lenke under
* https://opensource.expediagroup.com/graphql-kotlin/docs/plugins/gradle-plugin-usage#generating-multiple-clients
*/
val graphqlGenerateClient by tasks.getting(GraphQLGenerateClientTask::class) {
val generateSafGraphqlClient by tasks.getting(GraphQLGenerateClientTask::class) {
queryFileDirectory.set(file("${project.projectDir}/src/main/resources/saf"))
schemaFile.set(file("${project.projectDir}/src/main/resources/saf/saf-api-sdl.graphqls"))
packageName.set("no.nav.sifinnsynapi.saf.generated")
}

val graphqlGenerateOtherClient by tasks.creating(GraphQLGenerateClientTask::class) {
val generateSafSelvbetjeningGraphqlClient by tasks.creating(GraphQLGenerateClientTask::class) {
queryFileDirectory.set(file("${project.projectDir}/src/main/resources/safselvbetjening"))
schemaFile.set(file("${project.projectDir}/src/main/resources/safselvbetjening/saf-selvbetjening-sdl.graphqls"))
packageName.set("no.nav.sifinnsynapi.safselvbetjening.generated")
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/application-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ application-ingress: http://localhost:9999

spring:
datasource:
url: jdbc:tc:postgresql:12:///
url: jdbc:tc:postgresql:14:///
driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
flyway:
enabled: true
jpa:
show-sql: true
database-platform: org.hibernate.dialect.PostgreSQL12Dialect
database-platform: org.hibernate.dialect.PostgreSQL14Dialect

logging:
level:
Expand Down

0 comments on commit 0c0c667

Please sign in to comment.