use of org.junit.jupiter.api.Test in project intellij-community by JetBrains.
the class JUnit5AcceptanceTest method testFactoryMethods.
@Test
void testFactoryMethods() {
doTest(() -> {
PsiClass aClass = myFixture.addClass("class MyTest {@org.junit.jupiter.api.TestFactory java.util.List<org.junit.jupiter.api.DynamicTest> tests() {return null;}}");
PsiMethod factoryMethod = aClass.getMethods()[0];
assertNotNull(factoryMethod);
assertTrue(JUnitUtil.isTestAnnotated(factoryMethod));
});
}
use of org.junit.jupiter.api.Test in project intellij-community by JetBrains.
the class JUnit5AcceptanceTest method recognizedInnerClassesWithTestMethods.
@Test
void recognizedInnerClassesWithTestMethods() {
doTest(() -> {
PsiClass aClass = myFixture.addClass("import org.junit.jupiter.api.*; class MyTest {@Nested class NTest { @Test void method() {}}}");
assertTrue(JUnitUtil.isTestClass(aClass, false, false));
PsiClass innerClass = aClass.getInnerClasses()[0];
assertTrue(JUnitUtil.isTestClass(innerClass));
assertTrue(JUnitUtil.isTestMethod(MethodLocation.elementInClass(innerClass.getMethods()[0], innerClass)));
});
}
use of org.junit.jupiter.api.Test in project spring-framework by spring-projects.
the class DisabledIfConditionTestCase method unsupportedStringEvaluationValue.
@Test
void unsupportedStringEvaluationValue() {
String methodName = "stringExpressionThatIsNeitherTrueNorFalse";
IllegalStateException exception = assertThrows(IllegalStateException.class, () -> condition.evaluate(buildExtensionContext(methodName)));
Method method = ReflectionUtils.findMethod(getClass(), methodName);
assertThat(exception.getMessage(), is(equalTo("@DisabledIf(\"#{'enigma'}\") on " + method + " must evaluate to \"true\" or \"false\", not \"enigma\"")));
}
use of org.junit.jupiter.api.Test in project Malai by arnobl.
the class BaseWIMPWidgetTest method testProcessEventGoodDataOnStart.
@Test
void testProcessEventGoodDataOnStart() {
interaction.getFsm().addHandler(new InteractionHandlerStub() {
@Override
public void fsmStarts() {
assertEquals(wimpWidget, interaction.getWidget());
}
});
interaction.processEvent(new ActionEvent(wimpWidget, null));
sleep();
}
use of org.junit.jupiter.api.Test in project Malai by arnobl.
the class TestClick method testClickOnUnregWidget.
@Test
void testClickOnUnregWidget() throws CancelFSMException {
Pane pane = new Pane();
interaction.registerToNodes(Collections.singletonList(pane));
interaction.unregisterFromNodes(Collections.singletonList(pane));
pane.fireEvent(createMouseClickEvent(11, 23, MouseButton.MIDDLE, pane));
Mockito.verify(handler, Mockito.never()).fsmStarts();
}
Aggregations