mirror of
https://github.com/ClaytonWWilson/Listify.git
synced 2026-04-25 22:05:05 +00:00
Lambda unit test infrastructure
Unit test infrastructure for testing GET and POST Lambdas
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -8,8 +9,8 @@ public class BadCallListener extends CallListener {
|
||||
static RuntimeException toThrowRuntime = null;
|
||||
|
||||
|
||||
public BadCallListener(DBConnector connector, String cognitoID) {
|
||||
super(connector, cognitoID);
|
||||
public BadCallListener(Connection connection, String cognitoID) {
|
||||
super(connection, cognitoID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -8,7 +9,7 @@ public class CallListener implements CallHandler {
|
||||
|
||||
static int creates = 0;
|
||||
|
||||
public CallListener(DBConnector connector, String cognitoID) {
|
||||
public CallListener(Connection connection, String cognitoID) {
|
||||
creates++;
|
||||
}
|
||||
|
||||
|
||||
1627
Lambdas/Lists/src/test/java/StatementInjector.java
Normal file
1627
Lambdas/Lists/src/test/java/StatementInjector.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,7 @@ public class TestBasicHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> buildFullSampleMap() {
|
||||
public static Map<String, Object> buildFullSampleMap() {
|
||||
Map<String, Object> testMap = new HashMap<>();
|
||||
TestInputUtils.addBody(testMap);
|
||||
TestInputUtils.addCognitoID(testMap);
|
||||
|
||||
@@ -9,7 +9,7 @@ public class TestInputUtils {
|
||||
@Test
|
||||
public void testGetBody() {
|
||||
Map<String, Object> testMap = new HashMap<>();
|
||||
Map<String, String> bodyMap = addBody(testMap);
|
||||
Map<String, Object> bodyMap = addBody(testMap);
|
||||
assert (InputUtils.getBody(testMap).equals(bodyMap));
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TestInputUtils {
|
||||
return cognitoID;
|
||||
}
|
||||
|
||||
public static Map<String, String> addQueryParams(Map<String, Object> testMap) {
|
||||
public static HashMap<String, String> addQueryParams(Map<String, Object> testMap) {
|
||||
HashMap<String, Object> paramsMap = new HashMap<>();
|
||||
HashMap<String, String> queryMap = new HashMap<>();
|
||||
paramsMap.put("querystring", queryMap);
|
||||
@@ -54,8 +54,8 @@ public class TestInputUtils {
|
||||
return queryMap;
|
||||
}
|
||||
|
||||
public static Map<String, String> addBody(Map<String, Object> testMap) {
|
||||
HashMap<String, String> bodyMap = new HashMap<>();
|
||||
public static Map<String, Object> addBody(Map<String, Object> testMap) {
|
||||
HashMap<String, Object> bodyMap = new HashMap<>();
|
||||
testMap.put("body", bodyMap);
|
||||
return bodyMap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user