Skip to content

Commit 5b06b87

Browse files
committed
Refactored
1 parent 18e38fd commit 5b06b87

File tree

3 files changed

+14
-18
lines changed

3 files changed

+14
-18
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<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">
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>in.erail</groupId>
5-
<artifactId>api-framwork-amazon-lambda</artifactId>
5+
<artifactId>api-framework-amazon-lambda</artifactId>
66
<version>1.0-SNAPSHOT</version>
77
<packaging>jar</packaging>
88
<dependencies>
@@ -18,12 +18,12 @@
1818
</dependency>
1919
<dependency>
2020
<groupId>in.erail</groupId>
21-
<artifactId>api-framwork</artifactId>
21+
<artifactId>api-framework</artifactId>
2222
<version>1.0-SNAPSHOT</version>
2323
</dependency>
2424
<dependency>
2525
<groupId>in.erail</groupId>
26-
<artifactId>api-framwork</artifactId>
26+
<artifactId>api-framework</artifactId>
2727
<version>1.0-SNAPSHOT</version>
2828
<classifier>common-config</classifier>
2929
<type>zip</type>

src/main/java/in/erail/amazon/lambda/AWSLambda.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.concurrent.ExecutionException;
1919
import java.util.logging.Level;
2020
import java.util.logging.Logger;
21+
import static in.erail.common.FrameworkConstants.RoutingContext.Json.*;
2122

2223
/**
2324
*
@@ -67,23 +68,23 @@ public JsonObject handleMessage(JsonObject pJsonObject) {
6768

6869
public JsonObject transform(JsonObject pMsg) {
6970

70-
if (!pMsg.containsKey("isBase64Encoded")) {
71-
pMsg.put("isBase64Encoded", Boolean.FALSE);
71+
if (!pMsg.containsKey(IS_BASE64_ENCODED)) {
72+
pMsg.put(IS_BASE64_ENCODED, Boolean.FALSE);
7273
}
7374

74-
if (!pMsg.containsKey("statusCode")) {
75-
pMsg.put("statusCode", "200");
75+
if (!pMsg.containsKey(STATUS_CODE)) {
76+
pMsg.put(STATUS_CODE, "200");
7677
}
7778

78-
if (!pMsg.containsKey("headers")) {
79-
pMsg.put("headers", new JsonObject());
79+
if (!pMsg.containsKey(HEADERS)) {
80+
pMsg.put(HEADERS, new JsonObject());
8081
}
8182

82-
if (!pMsg.containsKey("body")) {
83-
pMsg.put("body", new JsonObject().toString());
83+
if (!pMsg.containsKey(BODY)) {
84+
pMsg.put(BODY, new JsonObject().toString());
8485
} else {
85-
String body = pMsg.getValue("body").toString();
86-
pMsg.put("body", body);
86+
String body = pMsg.getValue(BODY).toString();
87+
pMsg.put(BODY, body);
8788
}
8889

8990
return pMsg;

target/maven-archiver/pom.properties

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)