Skip to content

Commit

Permalink
Fix checkstyles
Browse files Browse the repository at this point in the history
  • Loading branch information
olegz committed Oct 25, 2023
1 parent 640bcf0 commit 43e6dc4
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,23 @@ public static Message<byte[]> generateMessage(byte[] payload, Type inputType, bo
}

@SuppressWarnings({ "unchecked", "rawtypes" })
public static Message<byte[]> generateMessage(byte[] payload, Type inputType, boolean isSupplier, JsonMapper jsonMapper, Context context) {
public static Message<byte[]> generateMessage(byte[] payload, Type inputType, boolean isSupplier,
JsonMapper jsonMapper, Context context) {
if (logger.isInfoEnabled()) {
logger.info("Received: " + new String(payload, StandardCharsets.UTF_8));
}


Object structMessage = jsonMapper.fromJson(payload, Object.class);
boolean isApiGateway = structMessage instanceof Map
&& (((Map<String, Object>) structMessage).containsKey("httpMethod") ||
(((Map<String, Object>) structMessage).containsKey("routeKey") && ((Map) structMessage).containsKey("version")));
&& (((Map<String, Object>) structMessage).containsKey("httpMethod")
|| (((Map<String, Object>) structMessage).containsKey("routeKey")
&& ((Map) structMessage).containsKey("version")));

Message<byte[]> requestMessage;

MessageBuilder builder = MessageBuilder.withPayload(structMessage instanceof Map msg && msg.containsKey("payload")
? ((String) msg.get("payload")).getBytes(StandardCharsets.UTF_8)

MessageBuilder builder = MessageBuilder
.withPayload(structMessage instanceof Map msg && msg.containsKey("payload")
? ((String) msg.get("payload")).getBytes(StandardCharsets.UTF_8)
: payload);
if (isApiGateway) {
builder.setHeader(AWSLambdaUtils.AWS_API_GATEWAY, true);
Expand Down

0 comments on commit 43e6dc4

Please sign in to comment.