#306 Create tests for CommandService and PlayerCommand

This commit is contained in:
ljacqu
2015-12-26 20:58:05 +01:00
parent 27fee3ca64
commit 47e97244a7
5 changed files with 277 additions and 7 deletions
@@ -83,14 +83,13 @@ public class WrapperMock extends Wrapper {
return mocks.get(mockClass) != null;
}
@SuppressWarnings("unchecked")
private <T> T getMock(Class<?> clazz) {
private <T> T getMock(Class<T> clazz) {
Object o = mocks.get(clazz);
if (o == null) {
o = Mockito.mock(clazz);
mocks.put(clazz, o);
}
return (T) o;
return clazz.cast(o);
}