Skip to content

Commit

Permalink
Create minimal proof-of-concept for lambda missing fields bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Smith committed Aug 5, 2022
0 parents commit 5053fc6
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea/
/target/
15 changes: 15 additions & 0 deletions build_and_run_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
mvn clean verify

echo "Java 8:"
docker run \
-e DOCKER_LAMBDA_DEBUG=true \
-v "$PWD/target/classes:/var/task:ro,delegated" \
lambci/lambda:java8 \
"com.garethdanielsmith.TestLambda" "null"

echo "Java 11:"
docker run \
-e DOCKER_LAMBDA_DEBUG=true \
-v "$PWD/target/classes:/var/task:ro,delegated" \
lambci/lambda:java11 \
"com.garethdanielsmith.TestLambda" "null"
24 changes: 24 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.garethdanielsmith</groupId>
<artifactId>java-11-lambda-missing-fields-poc</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>

</project>
6 changes: 6 additions & 0 deletions src/main/java/com/garethdanielsmith/TestChild.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.garethdanielsmith;

public class TestChild extends TestParent {

public String testChild = "_testChild";
}
12 changes: 12 additions & 0 deletions src/main/java/com/garethdanielsmith/TestLambda.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.garethdanielsmith;

import com.amazonaws.services.lambda.runtime.Context;
import com.amazonaws.services.lambda.runtime.RequestHandler;

public class TestLambda implements RequestHandler<String,TestParent> {

@Override
public TestParent handleRequest(String input, Context context) {
return new TestChild();
}
}
6 changes: 6 additions & 0 deletions src/main/java/com/garethdanielsmith/TestParent.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.garethdanielsmith;

public class TestParent {

public String parentField = "_parentField";
}

0 comments on commit 5053fc6

Please sign in to comment.