Search in sources :

Example 1 with QuarkusTestResource

use of io.quarkus.test.common.QuarkusTestResource in project quarkus by quarkusio.

the class QuarkusTestProfileAwareClassOrdererTest method quarkusDescriptorMock.

private ClassDescriptor quarkusDescriptorMock(Class<?> testClass, Class<? extends QuarkusTestResourceLifecycleManager> managerClass, boolean restrictToAnnotatedClass) {
    ClassDescriptor mock = descriptorMock(testClass);
    when(mock.isAnnotated(QuarkusTest.class)).thenReturn(true);
    QuarkusTestResource resourceMock = Mockito.mock(QuarkusTestResource.class, withSettings().lenient());
    doReturn(managerClass).when(resourceMock).value();
    when(resourceMock.restrictToAnnotatedClass()).thenReturn(restrictToAnnotatedClass);
    when(mock.findRepeatableAnnotations(QuarkusTestResource.class)).thenReturn(List.of(resourceMock));
    return mock;
}
Also used : ClassDescriptor(org.junit.jupiter.api.ClassDescriptor) QuarkusTestResource(io.quarkus.test.common.QuarkusTestResource)

Aggregations

QuarkusTestResource (io.quarkus.test.common.QuarkusTestResource)1 ClassDescriptor (org.junit.jupiter.api.ClassDescriptor)1