Exemplo n.º 1
0
 @After
 public final void onTestEnd() throws Throwable {
   ComponentAccessor.initialiseWorker(null);
   // so did they come out of the test without replaying or verifying
   mockController.onTestEnd();
   mockController = null;
 }
Exemplo n.º 2
0
 /**
  * A synonym for {@link com.atlassian.jira.mock.controller.MockController#instantiate(Class)}
  *
  * @param implementationClass the class under test
  * @return an instance of the class under test
  */
 protected final <T> T instantiate(Class<T> implementationClass) {
   return mockController.instantiate(implementationClass);
 }
Exemplo n.º 3
0
 /**
  * A simple wrapper function for mockController.reset()
  *
  * @param easyMockedCreatedObjects any EasyMocks created via {@link
  *     org.easymock.EasyMock#createMock(Class)} that you also want to verify
  */
 protected final void reset(Object... easyMockedCreatedObjects) {
   mockController.reset(easyMockedCreatedObjects);
 }
Exemplo n.º 4
0
 /**
  * A simple wrapper function for mockController.verify()
  *
  * @param easyMockedCreatedObjects any EasyMocks created via {@link
  *     org.easymock.EasyMock#createMock(Class)} that you also want to verify
  */
 protected final void verify(Object... easyMockedCreatedObjects) {
   mockController.verify(easyMockedCreatedObjects);
 }
Exemplo n.º 5
0
 /**
  * A synonym for {@link
  * com.atlassian.jira.mock.controller.MockController#addObjectInstance(Object)}
  *
  * @param objectInstance the object instance to add into the mix
  * @return that same objectInstance
  */
 @SuppressWarnings({"unchecked"})
 protected final <T> T addObjectInstance(final T objectInstance) {
   return mockController.addObjectInstance(objectInstance);
 }
Exemplo n.º 6
0
 /**
  * A synonym for {@link com.atlassian.jira.mock.controller.MockController#getMock(Class)} that
  * aligns with the name {@link org.easymock.EasyMock#createMock(Class)}
  *
  * @param aClassToMock a class to mock out
  * @return a mock instance of the class
  */
 protected final <T> T createMock(Class<T> aClassToMock) {
   return mockController.getMock(aClassToMock);
 }