package de.otto.edison.togglz.util;

import de.otto.edison.togglz.TestFeatures;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.togglz.core.Feature;

import java.util.Optional;

import static de.otto.edison.testsupport.togglz.FeatureManagerSupport.allEnabledFeatureConfig;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.jupiter.api.Assertions.assertFalse;

class FeatureManagerSupportTest {

    @BeforeEach
    void setUp() {
        allEnabledFeatureConfig(TestFeatures.class);
    }

    @Test
    void shouldReturnTheCorrectFeature() {
        assertThat(FeatureManagerSupport.getFeatureFromName("TEST_FEATURE").get(), is(TestFeatures.TEST_FEATURE));
    }

    @Test
    void shouldReturnTheAnEmptyFeatureIfNameisNotKnown() {
        Optional<Feature> unknwonFeature = FeatureManagerSupport.getFeatureFromName("UNKNWON_FEATURE");
        assertFalse(unknwonFeature.isPresent());
    }
}

@@ -327,104 +327,20 @@
 org.
-hamcrest.Matchers.is;%0Aimport static org.junit.Assert.assertThat;%0Aimport static org.junit.jupiter
+assertj.core
 .api
@@ -357,21 +357,20 @@
 s.assert
-False
+That
 ;%0A%0Aclass
@@ -632,12 +632,19 @@
 et()
-, is
+).isEqualTo
 (Tes
@@ -666,17 +666,16 @@
 FEATURE)
-)
 ;%0A    %7D%0A
@@ -770,26 +770,26 @@
 eature%3E unkn
-w
 o
+w
 nFeature = F
@@ -866,20 +866,19 @@
 sert
-False
+That
 (unkn
-w
 o
+w
 nFea
@@ -894,16 +894,26 @@
 esent())
+.isFalse()
 ;%0A    %7D%0A

fix deprecated usage of assertThat in test of edison-togglz