예제 #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;
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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);
 }