Fixed failing tests

This commit is contained in:
Adam Ding
2020-12-04 12:08:19 -05:00
parent 21277e1f76
commit 6ed94ea4e5
12 changed files with 74 additions and 26 deletions

View File

@@ -1,6 +1,7 @@
import org.junit.Test;
import org.mockito.Mockito;
import java.security.AccessControlException;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
@@ -9,12 +10,12 @@ public class TestListDuplicate {
@Test
public void testListDuplicateValid() {
testListDuplicaterMock(false);
testListDuplicaterMock(true);
}
@Test
public void testListDuplicateError() {
testListDuplicaterMock(true);
testListDuplicaterMock(false);
}
public void testListDuplicaterMock(boolean shouldThrow) {
@@ -38,6 +39,9 @@ public class TestListDuplicate {
} catch (SQLException throwables) {
assert shouldThrow;
throwables.printStackTrace();
} catch(AccessControlException throwables) {
assert !shouldThrow;
throwables.printStackTrace();
}
}
}