Open
Description
When using the org.togglz.testing.TestFeatureManager
in a org.junit.jupiter.api.Nested
test class, the feature manager is empty.
For example:
package example;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import example.TestFeatureManagerTest.SomeFeatures;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
import org.togglz.core.Feature;
import org.togglz.junit5.AllEnabled;
@AllEnabled(SomeFeatures.class)
class TestFeatureManagerTest {
@Test
void someTest(org.togglz.testing.TestFeatureManager featureManager) {
assertThat(featureManager, is(notNullValue()));
}
@Nested
class someNestedClass {
@Test
void someTest(org.togglz.testing.TestFeatureManager featureManager) {
assertThat(featureManager, is(notNullValue()));
}
}
public enum SomeFeatures implements Feature {
}
}
The method example.TestFeatureManagerTest#someTest
succeeds, however example.TestFeatureManagerTest.someNestedClass#someTest
fails because featureManager
is null
.
I would expect that this would work in a nested class as well.
Metadata
Metadata
Assignees
Labels
No labels