Skip to content

Commit

Permalink
Merge pull request #41593 from gsmet/3.12.1-backports-2
Browse files Browse the repository at this point in the history
[3.12] 3.12.1 backports 2
  • Loading branch information
gsmet committed Jul 2, 2024
2 parents 3710bba + b84118f commit 31f58dc
Show file tree
Hide file tree
Showing 42 changed files with 1,111 additions and 428 deletions.
2 changes: 1 addition & 1 deletion bom/application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<logstash-gelf.version>1.15.1</logstash-gelf.version>
<checker-qual.version>3.44.0</checker-qual.version>
<error-prone-annotations.version>2.28.0</error-prone-annotations.version>
<jib-core.version>0.27.1</jib-core.version>
<jib-core.version>0.27.0</jib-core.version>
<google-http-client.version>1.44.2</google-http-client.version>
<scram-client.version>2.1</scram-client.version>
<picocli.version>4.7.6</picocli.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public enum Feature {
JDBC_MSSQL,
JDBC_MYSQL,
JDBC_ORACLE,
JFR,
KAFKA_CLIENT,
KAFKA_STREAMS,
KEYCLOAK_AUTHORIZATION,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public TemplateHtmlBuilder staticResourcePath(String title, String description)
}

public TemplateHtmlBuilder servletMapping(String title) {
return resourcePath(title, false, false, null);
return resourcePath(title, false, true, null);
}

private TemplateHtmlBuilder resourcePath(String title, boolean withListStart, boolean withAnchor, String description) {
Expand Down
120 changes: 112 additions & 8 deletions docs/src/main/asciidoc/flyway.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ In your build file, add the following dependencies:

* the Flyway extension
* your JDBC driver extension (`quarkus-jdbc-postgresql`, `quarkus-jdbc-h2`, `quarkus-jdbc-mariadb`, ...)
* the MariaDB/MySQL support is now in a separate dependency, MariaDB/MySQL users need to add the `flyway-mysql` dependency from now on.
* the Microsoft SQL Server support is now in a separate dependency, Microsoft SQL Server users need to add the `flyway-sqlserver` dependency from now on.
* the Oracle support is now in a separate dependency, Oracle users need to add the `flyway-database-oracle` dependency from now on.
* unless you're using in-memory or file databases (such as H2 or SQLite), you need to add a flyway module dependency corresponding to the database you're using. (https://github.com/flyway/flyway/issues/3780[for more details])

[source,xml,role="primary asciidoc-tabs-target-sync-cli asciidoc-tabs-target-sync-maven"]
.pom.xml
Expand All @@ -41,6 +39,12 @@ In your build file, add the following dependencies:
<artifactId>quarkus-flyway</artifactId>
</dependency>
<!-- JDBC driver dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<!-- Flyway SQL Server specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
Expand All @@ -59,26 +63,126 @@ In your build file, add the following dependencies:
<artifactId>flyway-database-oracle</artifactId>
</dependency>
<!-- JDBC driver dependencies -->
<!-- Flyway Postgres specific dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
</dependency>
<!-- Flyway DB2 specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-db2</artifactId>
</dependency>
<!-- Derby specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-derby</artifactId>
</dependency>
<!-- HSQLDB specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-hsqldb</artifactId>
</dependency>
<!-- Informix specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-informix</artifactId>
</dependency>
<!-- Redshift specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-redshift</artifactId>
</dependency>
<!-- Saphana specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-saphana</artifactId>
</dependency>
<!-- Snowflake specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-snowflake</artifactId>
</dependency>
<!-- Sybasease specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-sybasease</artifactId>
</dependency>
<!-- Firebird specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-firebird</artifactId>
</dependency>
<!-- BigQuery specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-gcp-bigquery</artifactId>
</dependency>
<!-- Spanner specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-gcp-spanner</artifactId>
</dependency>
<!-- Singlestore specific dependencies -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-singlestore</artifactId>
</dependency>
----

[source,gradle,role="secondary asciidoc-tabs-target-sync-gradle"]
.build.gradle
----
// Flyway specific dependencies
implementation("io.quarkus:quarkus-flyway")
// JDBC driver dependencies
implementation("io.quarkus:quarkus-jdbc-postgresql")
// Flyway SQL Server specific dependencies
implementation("org.flywaydb:flyway-sqlserver")
// Flyway MariaDB/MySQL specific dependencies
implementation("org.flywaydb:flyway-mysql")
// Flyway Oracle specific dependencies
implementation("org.flywaydb:flyway-database-oracle")
// JDBC driver dependencies
implementation("io.quarkus:quarkus-jdbc-postgresql")
// Flyway Postgres specific dependencies
implementation("org.flywaydb:flyway-database-postgresql")
// Flyway DB2 specific dependencies
implementation("org.flywaydb:flyway-database-db2")
// Flyway Derby specific dependencies
implementation("org.flywaydb:flyway-database-derby")
// HSQLDB specific dependencies
implementation("org.flywaydb:flyway-database-hsqldb")
// Informix specific dependencies
implementation("org.flywaydb:flyway-database-informix")
// Redshift specific dependencies
implementation("org.flywaydb:flyway-database-redshift")
// Saphana specific dependencies
implementation("org.flywaydb:flyway-database-saphana")
// Snowflake specific dependencies
implementation("org.flywaydb:flyway-database-snowflake")
// Sybasease specific dependencies
implementation("org.flywaydb:flyway-database-sybasease")
// Firebird specific dependencies
implementation("org.flywaydb:flyway-firebird")
// BigQuery specific dependencies
implementation("org.flywaydb:flyway-gcp-bigquery")
// Spanner specific dependencies
implementation("org.flywaydb:flyway-gcp-spanner")
// Singlestore specific dependencies
implementation("org.flywaydb:flyway-singlestore:10.15.0")
----

Flyway support relies on the Quarkus datasource config.
Expand Down
31 changes: 30 additions & 1 deletion docs/src/main/asciidoc/getting-started-testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1682,7 +1682,8 @@ Finally, the CDI request context is activated and terminated per each test metho

Test class fields annotated with `@jakarta.inject.Inject` and `@io.quarkus.test.InjectMock` are injected after a test instance is created.
Dependent beans injected into these fields are correctly destroyed before a test instance is destroyed.
Parameters of a test method for which a matching bean exists are resolved unless annotated with `@io.quarkus.test.component.SkipInject`.
Parameters of a test method for which a matching bean exists are resolved unless annotated with `@io.quarkus.test.component.SkipInject` or `@org.mockito.Mock`.
There are also some JUnit built-in parameters, such as `RepetitionInfo` and `TestInfo`, which are skipped automatically.
Dependent beans injected into the test method arguments are correctly destroyed after the test method completes.

NOTE: Arguments of a `@ParameterizedTest` method that are provided by an `ArgumentsProvider`, for example with `@org.junit.jupiter.params.provider.ValueArgumentsProvider`, must be annotated with `@SkipInject`.
Expand All @@ -1695,6 +1696,34 @@ The bean has the `@Singleton` scope so it's shared across all injection points w
The injected reference is an _unconfigured_ Mockito mock.
You can inject the mock in your test using the `io.quarkus.test.InjectMock` annotation and leverage the Mockito API to configure the behavior.

[NOTE]
====
`@InjectMock` is not intended as a universal replacement for functionality provided by the Mockito JUnit extension.
It's meant to be used for configuration of unsatisfied dependencies of CDI beans.
You can use the `QuarkusComponentTest` and `MockitoExtension` side by side.
[source, java]
----
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;
@ExtendWith(MockitoExtension.class)
@QuarkusComponentTest
public class FooTest {
@TestConfigProperty(key = "bar", value = "true")
@Test
public void testPing(Foo foo, @InjectMock Charlie charlieMock, @Mock Ping ping) {
Mockito.when(ping.pong()).thenReturn("OK");
Mockito.when(charlieMock.ping()).thenReturn(ping);
assertEquals("OK", foo.ping());
}
}
----
====

=== Custom Mocks For Unsatisfied Dependencies

Sometimes you need the full control over the bean attributes and maybe even configure the default mock behavior.
Expand Down
Loading

0 comments on commit 31f58dc

Please sign in to comment.