you should know that :
@Before from junit4 goes with @Test : "import org.junit.Test"
AND
@BeforeEach from Junit5 goes with : "import org.junit.jupiter.api.Test"
so make sure you are using the imports from the same version of Junit , otherwise it w'ont Work I guess.