Created
December 5, 2013 09:27
-
-
Save Qkyrie/7802516 to your computer and use it in GitHub Desktop.
AbstractMockedTest. A Basic class where we init the mocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AbstractMockedTest { | |
@Before | |
public void initMockitoAnnotations() { | |
MockitoAnnotations.initMocks(this); | |
} | |
protected void assertEmpty(Collection collection) { | |
Assert.assertTrue("Collection was expected to be empty", collection.isEmpty()); | |
} | |
protected void assertEmptyString(String string) { | |
Assert.assertEquals("String was supposed to be empty", "", string); | |
} | |
protected void assertNotEmpty(Collection collection) { | |
Assert.assertFalse("Collection was not expected to be empty", collection.isEmpty()); | |
} | |
protected void assertSize(int expectedSize, Collection collection) { | |
Assert.assertEquals(expectedSize, collection.size()); | |
} | |
protected void assertSize(Collection collection1, Collection collection2) { | |
Assert.assertEquals(collection1.size(), collection2.size()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment