Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions extensions/agroal/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<runOrder>alphabetical</runOrder>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,21 @@ BeanContainerListenerBuildItem build(

@Record(ExecutionTime.RUNTIME_INIT)
@BuildStep
DataSourceInitializedBuildItem configureRuntimeProperties(AgroalTemplate template) {
void configureRuntimeProperties(AgroalTemplate template,
BuildProducer<DataSourceInitializedBuildItem> dataSourceInitialized) {
if (!agroalBuildTimeConfig.defaultDataSource.driver.isPresent() && agroalBuildTimeConfig.namedDataSources.isEmpty()) {
// No datasource has been configured so bail out
return;
}

// TODO @dmlloyd
// Here we have the first issue:
// - things are working well for the default database
// - we have the datasource1 and datasource2 elements in the map but the values are not injected
// - as mentioned above, it doesn't seem to be an issue for the build time config I use in the above method...
template.configureRuntimeProperties(agroalRuntimeConfig);

return new DataSourceInitializedBuildItem();
dataSourceInitialized.produce(new DataSourceInitializedBuildItem());
}

@BuildStep
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package io.quarkus.agroal.test;

import java.sql.SQLException;

import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;

public class NoConfigTest {

@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer(
() -> ShrinkWrap.create(JavaArchive.class));

@Test
public void testNoConfig() throws SQLException {
// we should be able to start the application, even with no configuration at all
}
}