Skip to content

Commit

Permalink
make it build
Browse files Browse the repository at this point in the history
  • Loading branch information
dcdh committed Mar 8, 2024
1 parent 5538afd commit 7260173
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
4 changes: 4 additions & 0 deletions docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<artifactId>quarkus-shedlock-provider-jdbc-deployment</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.shedlock</groupId>
<artifactId>quarkus-shedlock-provider-mongo-deployment</artifactId>
Expand Down
2 changes: 2 additions & 0 deletions docs/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
quarkus.datasource.db-kind=h2
quarkus.datasource.master.db-kind=h2
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.version>3.8.1</quarkus.version>
<quarkus.version>3.8.2</quarkus.version>
<shedlock.version>5.11.0</shedlock.version>
</properties>
<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
package io.quarkiverse.shedlock.providers.jdbc.deployment;

import io.agroal.api.AgroalDataSource;
import io.quarkus.builder.Version;
import io.quarkus.maven.dependency.Dependency;
import io.quarkus.test.QuarkusUnitTest;
import jakarta.inject.Inject;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import static org.assertj.core.api.Assertions.assertThat;

import java.sql.Connection;
import java.sql.PreparedStatement;
Expand All @@ -18,16 +9,27 @@
import java.util.ArrayList;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
import jakarta.inject.Inject;

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.agroal.api.AgroalDataSource;
import io.quarkus.builder.Version;
import io.quarkus.maven.dependency.Dependency;
import io.quarkus.test.QuarkusUnitTest;

public class ShouldNotCreateTheTableWhenNotWantedTest {
@RegisterExtension
static final QuarkusUnitTest unitTest = new QuarkusUnitTest()
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
.addClasses(LockableService.class)
.addAsResource(new StringAsset("quarkus.shedlock.defaults-lock-at-most-for=PT30S\n" +
"quarkus.shedlock.jdbc.enable-table-creation=false\n" +
"quarkus.shedlock.jdbc.table-name=shouldNotExists"),
"quarkus.shedlock.jdbc.enable-table-creation=false\n" +
"quarkus.shedlock.jdbc.table-name=shouldNotExists"),
"application.properties"))
.setForcedDependencies(List.of(
Dependency.of("io.quarkus", "quarkus-jdbc-postgresql", Version.getVersion())));
Expand All @@ -39,8 +41,8 @@ public class ShouldNotCreateTheTableWhenNotWantedTest {
public void shouldUseSpecifiedTableName() {
final List<String> tablesName = new ArrayList<>();
try (final Connection connection = defaultAgroalDataSource.getConnection();
final PreparedStatement selectTablesNameStatement = connection.prepareStatement(
"SELECT table_name FROM information_schema.tables")) {
final PreparedStatement selectTablesNameStatement = connection.prepareStatement(
"SELECT table_name FROM information_schema.tables")) {
final ResultSet tablesNameResultSet = selectTablesNameStatement.executeQuery();
while (tablesNameResultSet.next()) {
tablesName.add(tablesNameResultSet.getString("table_name"));
Expand Down

0 comments on commit 7260173

Please sign in to comment.