-
Notifications
You must be signed in to change notification settings - Fork 583
Closed
Copy link
Labels
Description
Environment Details
- Helidon Version:
- Helidon SE or Helidon MP
- JDK version:
- OS:
Problem Description
The javadoc of the @io.helidon.microprofile.testing.AddConfig*
annotations states that they imply a dedicated CDI container. However that behavior is effectively not implemented.
Steps to reproduce
@HelidonTest
class Aest {
@Inject
@ConfigProperty(name = "bar", defaultValue = "not-bar")
String bar;
@Test
@AddConfig(key="bar", value="bar1")
public void test1() {
assertThat(bar, is("bar1"));
}
}
Workaround
The @Configuration
annotation can be used to trigger a dedicated CDI container.
@HelidonTest
class Test {
@Inject
@ConfigProperty(name = "bar", defaultValue = "not-bar")
String bar;
@Test
@Configuration
@AddConfig(key="bar", value="bar1")
public void test1() {
assertThat(bar, is("bar1"));
}
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Closed