Merge pull request #171 from ClaytonWWilson/test-new-lambdas

Test new lambdas
This commit is contained in:
Adam Ding
2020-12-04 12:26:04 -05:00
committed by GitHub
12 changed files with 74 additions and 26 deletions

View File

@@ -9,12 +9,12 @@ public class TestChainGetter {
@Test
public void testChainGetterValid() {
testChainGetter(false);
testChainGetter(true);
}
@Test
public void testChainGetterError() {
testChainGetter(true);
testChainGetter(false);
}
public void testChainGetter(boolean shouldThrow) {
@@ -29,7 +29,7 @@ public class TestChainGetter {
ChainGetter chainGetter = Mockito.spy(new ChainGetter(injector, "cognitoID"));
Map<String, Object> ignore = new HashMap<>();
Map<String, Object> body = TestInputUtils.addBody(ignore);
ignore.put("id", 1); //in ChainGetter.java uses ignore map for id parameter
body.put("id", 1);
try {
Object rawIDReturn = chainGetter.conductAction(body, TestInputUtils.addQueryParams(ignore), "cognitoID");
@@ -38,6 +38,12 @@ public class TestChainGetter {
} catch (SQLException throwables) {
assert shouldThrow;
throwables.printStackTrace();
} catch (NumberFormatException throwables) {
assert shouldThrow;
throwables.printStackTrace();
} catch (ClassCastException throwables) {
assert shouldThrow;
throwables.printStackTrace();
}
}
}