Package org.openbravo.test.base
Class MockableBaseTest
- java.lang.Object
-
- org.openbravo.test.base.MockableBaseTest
-
- Direct Known Subclasses:
OAuth2AccessTokenTest
,OBBaseTest
,SynchronizationEventTest
public class MockableBaseTest extends Object
Enables the use of Mockito annotations by default and provides some mocking utilities.
-
-
Constructor Summary
Constructors Constructor Description MockableBaseTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> void
mockStatic(Class<T> clz, Consumer<org.mockito.MockedStatic<T>> test)
Utility method to enable the mocking of static invocations of the given class within the current thread.void
setUp()
void
testDone()
-
-
-
Method Detail
-
mockStatic
public static <T> void mockStatic(Class<T> clz, Consumer<org.mockito.MockedStatic<T>> test)
Utility method to enable the mocking of static invocations of the given class within the current thread.- Parameters:
clz
- The class whose static invocations can be mockedtest
- The testing logic to be executed with the static mock which is the input argument of theConsumer
. This way it can be used to stub the mock methods required by the test.
-
-