Skip to content

Commit

Permalink
Fixed Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
akumar074 committed Oct 6, 2022
1 parent c036999 commit 0bc4e2c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
*/
package org.acme.deals;

import org.flywaydb.core.Flyway;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.kie.kogito.testcontainers.quarkus.PostgreSqlQuarkusTestResource;

Expand All @@ -30,6 +32,19 @@
@QuarkusTestResource(PostgreSqlQuarkusTestResource.class)
public class DealsRestIT {

private static final String QUARKUS_DATASOURCE_USERNAME = "quarkus.datasource.username";
private static final String QUARKUS_DATASOURCE_PASSWORD = "quarkus.datasource.password";
private static final String QUARKUS_DATASOURCE_URL = "quarkus.datasource.jdbc.url";

@BeforeAll
public static void initFlywaySchema() {
String username = System.getProperty(QUARKUS_DATASOURCE_USERNAME);
String password = System.getProperty(QUARKUS_DATASOURCE_PASSWORD);
String url = System.getProperty(QUARKUS_DATASOURCE_URL);
Flyway flyway = Flyway.configure().dataSource(url, username, password).load();
flyway.migrate();
}

@Test
public void testDealsRest() {
// test adding new deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ kogito.persistence.type=postgresql
kogito.persistence.postgresql.connection.uri=postgresql://kogito-user:kogito-pass@localhost:5432/kogito

#run create tables scripts during the application startup
kogito.persistence.auto.ddl=true
spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true


0 comments on commit 0bc4e2c

Please sign in to comment.