Repository: quarkusio/quarkus
Issue: [reactive-pg-client] NullPointerException in PgPoolRecorder.java

### Describe the bug

When migrating from `2.9.2.Final` to `2.10.1.Final` the tests for one of my applications started failing due to a NullPointerException:
```
java.lang.RuntimeException: Failed to start quarkus
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:237)
	at io.quarkus.test.junit.QuarkusTestExtension.doJavaStart(QuarkusTestExtension.java:250)
	at io.quarkus.test.junit.QuarkusTestExtension.ensureStarted(QuarkusTestExtension.java:609)
	at io.quarkus.test.junit.QuarkusTestExtension.beforeAll(QuarkusTestExtension.java:647)
	... 35 more
Caused by: java.lang.NullPointerException
	at io.quarkus.reactive.pg.client.runtime.PgPoolRecorder.toPgConnectOptions(PgPoolRecorder.java:193)
	at io.quarkus.reactive.pg.client.runtime.PgPoolRecorder.initialize(PgPoolRecorder.java:68)
	at io.quarkus.reactive.pg.client.runtime.PgPoolRecorder.configurePgPool(PgPoolRecorder.java:47)
	at io.quarkus.deployment.steps.ReactivePgClientProcessor$build897843755.deploy_0(Unknown Source)
	at io.quarkus.deployment.steps.ReactivePgClientProcessor$build897843755.deploy(Unknown Source)
	... 51 more
```

The cause seems to be that `dataSourceReactiveRuntimeConfig.additionalProperties` can be null, so when it hits this line it fails:
https://github.com/quarkusio/quarkus/blob/3ad7cd0ec6a2297ccda5759b5acb22741d147d37/extensions/reactive-pg-client/runtime/src/main/java/io/quarkus/reactive/pg/client/runtime/PgPoolRecorder.java#L193

### Expected behavior

The application starts up successfully.

### Actual behavior

The application fails.

### How to Reproduce?

I cannot share a reproducer at this time because the code belongs to my company and it would be difficult to recreate.

However, based on my troubleshooting the issue seems to triggered with this configuration:
```yaml
"%test":
  quarkus:
    datasource:
      app:
        db-kind: postgresql
        devservices:
          enabled: true
          image-name: postgres:14
        username: "quarkus"
        password: "quarkus"
      migration:
        db-kind: postgresql
        # This is an awkward workaround to prevent multiple instances of DevServices running.
        jdbc:
          url: "${quarkus.datasource.\\"app\\".jdbc.url}"
        username: "quarkus"
        password: "quarkus"

     flyway:
       migration:
         # settings
```
> **Aside**: Having two separate datasources is an awkward workaround run Flyway migrations as a separate user from the standard application operations. For tests it doesn't matter.
> 
> Ideally, it'd be possible to specify different credentials in the URL for reactive and JDBC, or make it so reactive/jdbc can be disabled per data source. I'll probably make a separate issue about this...)

When `PgPoolRecorder.configurePgPool` is called for the "app" datasource, `dataSourceReactiveRuntimeConfig.additionalProperties` is empty. However, when it's called for the `migration` datasource,`dataSourceReactiveRuntimeConfig.additionalProperties` is null.

The straightforward solution would be to surround this with a null check. But the fact that it's `null` in the first place may be a bug.

_Edit:_ if it's expected that `additionalProperties` can be null, the null check would need to be added to all pool recorders.
https://github.com/quarkusio/quarkus/commit/dccb8d968a1ba9e387439de187e91aca7d2053c8


### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

11.0.12

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.10.1.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

3.8.5

### Additional information

_No response_

Changed files:
extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcRuntimeConfig.java
extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/DataSourceReactiveRuntimeConfig.java

diff --git a/extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcRuntimeConfig.java b/extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcRuntimeConfig.java
index 9d6601482a5..1c07a501cf7 100644
--- a/extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcRuntimeConfig.java
+++ b/extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSourceJdbcRuntimeConfig.java
@@ -1,6 +1,7 @@
 package io.quarkus.agroal.runtime;
 
 import java.time.Duration;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Optional;
 import java.util.OptionalInt;
@@ -130,18 +131,18 @@ public class DataSourceJdbcRuntimeConfig {
      * validation. Setting this setting to STRICT may lead to failures in those cases.
      */
     @ConfigItem
-    public Optional<AgroalConnectionPoolConfiguration.TransactionRequirement> transactionRequirement;
+    public Optional<AgroalConnectionPoolConfiguration.TransactionRequirement> transactionRequirement = Optional.empty();
 
     /**
      * Other unspecified properties to be passed to the JDBC driver when creating new connections.
      */
     @ConfigItem
-    public Map<String, String> additionalJdbcProperties;
+    public Map<String, String> additionalJdbcProperties = Collections.emptyMap();
 
     /**
      * Enable JDBC tracing.
      */
     @ConfigItem
-    public DataSourceJdbcTracingRuntimeConfig tracing;
+    public DataSourceJdbcTracingRuntimeConfig tracing = new DataSourceJdbcTracingRuntimeConfig();
 
 }
diff --git a/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/DataSourceReactiveRuntimeConfig.java b/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/DataSourceReactiveRuntimeConfig.java
index 831a2bf172e..5a8b6480203 100644
--- a/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/DataSourceReactiveRuntimeConfig.java
+++ b/extensions/reactive-datasource/runtime/src/main/java/io/quarkus/reactive/datasource/runtime/DataSourceReactiveRuntimeConfig.java
@@ -1,6 +1,7 @@
 package io.quarkus.reactive.datasource.runtime;
 
 import java.time.Duration;
+import java.util.Collections;
 import java.util.Map;
 import java.util.Optional;
 import java.util.OptionalInt;
@@ -145,12 +146,12 @@ public class DataSourceReactiveRuntimeConfig {
      * Set the pool name, used when the pool is shared among datasources, otherwise ignored.
      */
     @ConfigItem
-    public Optional<String> name;
+    public Optional<String> name = Optional.empty();
 
     /**
      * Other unspecified properties to be passed through the Reactive SQL Client directly to the database when new connections
      * are initiated.
      */
     @ConfigItem
-    public Map<String, String> additionalProperties;
+    public Map<String, String> additionalProperties = Collections.emptyMap();
 }