Permalink
Browse files

#289: Improving test coverage for scan package

  • Loading branch information...
1 parent 781f0b1 commit ce27622f74fd8a8ef8a30d30a87efb4561a89c07 @garcia-jj garcia-jj committed Sep 19, 2012
@@ -2,7 +2,6 @@
import static java.util.Arrays.asList;
import static java.util.Collections.emptyList;
-import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
@@ -41,14 +40,10 @@ public void shouldNotDoAnythingIfHasNoClasses() {
verify(registry, never()).deepRegister(any(Class.class));
}
- @Test
+ @Test(expected=ScannerException.class)
public void shouldThrowScannerExceptionIfClassNotExists() {
Collection<String> classNames = asList("a.resource.that.NotExists");
- try {
- new DynamicWebAppBootstrap(classNames).configure(registry);
- fail("If a class don't exists, a ScannerException should throw");
- } catch (ScannerException e) {
- }
+ new DynamicWebAppBootstrap(classNames).configure(registry);
}
}

0 comments on commit ce27622

Please sign in to comment.