This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ralf Ueberfuhr
committed
Jun 21, 2024
1 parent
2e4e274
commit 2a93333
Showing
6 changed files
with
228 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...c/test/java/de/schulung/sample/quarkus/persistence/PersistenceJdbcCustomersSinkTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package de.schulung.sample.quarkus.persistence; | ||
|
||
import de.schulung.sample.quarkus.domain.Customer; | ||
import de.schulung.sample.quarkus.domain.CustomersSink; | ||
import io.quarkus.test.TestTransaction; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.junit.TestProfile; | ||
import jakarta.inject.Inject; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@QuarkusTest | ||
@TestTransaction | ||
@TestProfile(UseJdbcImplementation.class) | ||
public class PersistenceJdbcCustomersSinkTests { | ||
|
||
@Inject | ||
CustomersSink sink; | ||
|
||
@Test | ||
void shouldFindByState() { | ||
var result = sink.findByState(Customer.CustomerState.ACTIVE); | ||
assertThat(result).isNotNull(); | ||
} | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
...rc/test/java/de/schulung/sample/quarkus/persistence/PersistenceJpaCustomersSinkTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package de.schulung.sample.quarkus.persistence; | ||
|
||
import de.schulung.sample.quarkus.domain.Customer; | ||
import de.schulung.sample.quarkus.domain.CustomersSink; | ||
import io.quarkus.test.TestTransaction; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import io.quarkus.test.junit.TestProfile; | ||
import jakarta.inject.Inject; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
@QuarkusTest | ||
@TestTransaction | ||
@TestProfile(UseJpaImplementation.class) | ||
public class PersistenceJpaCustomersSinkTests { | ||
|
||
@Inject | ||
CustomersSink sink; | ||
|
||
@Test | ||
void shouldFindByState() { | ||
var result = sink.findByState(Customer.CustomerState.ACTIVE); | ||
assertThat(result).isNotNull(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...-provider/src/test/java/de/schulung/sample/quarkus/persistence/UseJdbcImplementation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.schulung.sample.quarkus.persistence; | ||
|
||
import io.quarkus.test.junit.QuarkusTestProfile; | ||
|
||
import java.util.Map; | ||
|
||
public class UseJdbcImplementation implements QuarkusTestProfile { | ||
|
||
@Override | ||
public Map<String, String> getConfigOverrides() { | ||
return Map.of( | ||
"persistence.sink.implementation", "jdbc" | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
...i-provider/src/test/java/de/schulung/sample/quarkus/persistence/UseJpaImplementation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.schulung.sample.quarkus.persistence; | ||
|
||
import io.quarkus.test.junit.QuarkusTestProfile; | ||
|
||
import java.util.Map; | ||
|
||
public class UseJpaImplementation implements QuarkusTestProfile { | ||
|
||
@Override | ||
public Map<String, String> getConfigOverrides() { | ||
return Map.of( | ||
"persistence.sink.implementation", "jpa" | ||
); | ||
} | ||
} |