Corrected expected exception checks in tests

This commit is contained in:
Kai Zimmermann
2016-03-29 13:43:18 +02:00
parent a950fa0337
commit f33a8c37e8
11 changed files with 263 additions and 99 deletions

View File

@@ -9,6 +9,7 @@
package org.eclipse.hawkbit.rest.resource.model;
import static org.fest.assertions.Assertions.assertThat;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.List;
@@ -23,10 +24,14 @@ import ru.yandex.qatools.allure.annotations.Stories;
@Stories("Paged List Handling")
public class PagedListTest {
@Test(expected = NullPointerException.class)
@Test
@Description("Ensures that a null payload entitiy throws an exception.")
public void createListWithNullContentThrowsException() {
new PagedList<>(null, 0);
try {
new PagedList<>(null, 0);
fail("as content is null");
} catch (final NullPointerException e) {
}
}
@Test