diff --git a/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java b/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java index 7f32c0dd79b8d..9cc82062f702b 100644 --- a/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java +++ b/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java @@ -27,6 +27,11 @@ public class MSSQLDevServicesProcessor { private static final Logger LOG = Logger.getLogger(MSSQLDevServicesProcessor.class); + /** + * Using SA doesn't work with all collations so let's use the lowercase version instead. + */ + private static final String DEFAULT_USERNAME = "sa"; + @BuildStep DevServicesDatasourceProviderBuildItem setupMSSQL( List devServicesSharedNetworkBuildItem) { @@ -63,7 +68,7 @@ public RunningDevServicesDatasource startDatabase(Optional username, Opt return new RunningDevServicesDatasource(container.getContainerId(), container.getEffectiveJdbcUrl(), container.getReactiveUrl(), - container.getUsername(), + DEFAULT_USERNAME, container.getPassword(), new ContainerShutdownCloseable(container, "Microsoft SQL Server")); } diff --git a/extensions/jdbc/jdbc-mssql/deployment/src/test/java/io/quarkus/jdbc/mssql/deployment/DevServicesMsSQLDatasourceTestCase.java b/extensions/jdbc/jdbc-mssql/deployment/src/test/java/io/quarkus/jdbc/mssql/deployment/DevServicesMsSQLDatasourceTestCase.java index 397da3a1e828a..d580858a70909 100644 --- a/extensions/jdbc/jdbc-mssql/deployment/src/test/java/io/quarkus/jdbc/mssql/deployment/DevServicesMsSQLDatasourceTestCase.java +++ b/extensions/jdbc/jdbc-mssql/deployment/src/test/java/io/quarkus/jdbc/mssql/deployment/DevServicesMsSQLDatasourceTestCase.java @@ -41,7 +41,7 @@ public class DevServicesMsSQLDatasourceTestCase { public void testDatasource() throws Exception { AgroalConnectionPoolConfiguration configuration = dataSource.getConfiguration().connectionPoolConfiguration(); assertTrue(configuration.connectionFactoryConfiguration().jdbcUrl().contains("jdbc:sqlserver:")); - assertEquals("SA", configuration.connectionFactoryConfiguration().principal().getName()); + assertEquals("sa", configuration.connectionFactoryConfiguration().principal().getName()); assertEquals(20, configuration.maxSize()); assertThat(configuration.exceptionSorter()).isInstanceOf(MSSQLExceptionSorter.class);