forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AgroalVaultITCase.java
52 lines (39 loc) · 1.54 KB
/
AgroalVaultITCase.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package io.quarkus.vault;
import static io.quarkus.vault.test.VaultTestExtension.testDataSource;
import java.sql.SQLException;
import javax.inject.Inject;
import org.jboss.logging.Logger;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.extension.RegisterExtension;
import io.agroal.api.AgroalDataSource;
import io.quarkus.agroal.DataSource;
import io.quarkus.test.QuarkusUnitTest;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.vault.test.VaultTestLifecycleManager;
@DisabledOnOs(OS.WINDOWS) // https://github.com/quarkusio/quarkus/issues/3796
@QuarkusTestResource(VaultTestLifecycleManager.class)
public class AgroalVaultITCase {
private static final Logger log = Logger.getLogger(AgroalVaultITCase.class.getName());
@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer(
() -> ShrinkWrap.create(JavaArchive.class)
.addAsResource("application-vault-datasource.properties", "application.properties"));
@Inject
@DataSource("staticDS")
AgroalDataSource staticDS;
@Inject
@DataSource("dynamicDS")
AgroalDataSource dynamicDS;
@Test
public void staticDS() throws SQLException {
testDataSource(staticDS);
}
@Test
public void dynamicDS() throws SQLException {
testDataSource(dynamicDS);
}
}