@@ -0,0 +1,1764 @@
+package io.quarkus.jdbc.postgresql.deployment;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0Aimport static org.junit.jupiter.api.Assertions.assertTrue;%0Aimport static org.junit.jupiter.api.Assertions.fail;%0A%0Aimport java.sql.Connection;%0A%0Aimport javax.inject.Inject;%0Aimport javax.inject.Named;%0A%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.extension.RegisterExtension;%0A%0Aimport io.agroal.api.AgroalDataSource;%0Aimport io.agroal.api.configuration.AgroalConnectionPoolConfiguration;%0Aimport io.quarkus.test.QuarkusUnitTest;%0A%0Apublic class DevServicesPostgresqlDatasourceNamedWithUsernameTestCase %7B%0A%0A    @RegisterExtension%0A    static QuarkusUnitTest test = new QuarkusUnitTest()%0A            .withEmptyApplication()%0A            .overrideConfigKey(%22quarkus.datasource.%5C%22DB2%5C%22.db-kind%22, %22postgresql%22)%0A            .overrideConfigKey(%22quarkus.datasource.%5C%22DB2%5C%22.username%22, %22foo%22)%0A            .overrideConfigKey(%22quarkus.datasource.%5C%22DB2%5C%22.password%22, %22foo%22);%0A%0A    @Inject%0A    @Named(%22DB2%22)%0A    AgroalDataSource dataSource;%0A%0A    @Test%0A    public void testDatasource() throws Exception %7B%0A        AgroalConnectionPoolConfiguration configuration = null;%0A%0A        try %7B%0A            configuration = dataSource.getConfiguration().connectionPoolConfiguration();%0A        %7D catch (NullPointerException e) %7B%0A            // we catch the NPE here as we have a proxycd and we can't test dataSource directly%0A            fail(%22Datasource should not be null%22);%0A        %7D%0A        assertTrue(configuration.connectionFactoryConfiguration().jdbcUrl().contains(%22jdbc:postgresql:%22));%0A        assertEquals(%22foo%22, configuration.connectionFactoryConfiguration().principal().getName());%0A%0A        try (Connection connection = dataSource.getConnection()) %7B%0A        %7D%0A    %7D%0A%7D%0A

Test JDBC Dev services on a named datasource with an explicit username/password