8000 TestFeatureManager in JUnit 5 nested class is empty · Issue #1135 · togglz/togglz · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
TestFeatureManager in JUnit 5 nested class is empty #1135
Open
@rrockx-trifork

Description

@rrockx-trifork

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0