Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: add new test checking old/new serialization
added a new test that checks a case that would have been serialized on
input on GSON.
  • Loading branch information
darklight3it committed Sep 30, 2026
commit 3b539c82936739d526ce84f53b39ebbb3b235db9
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ void PojoHandler_outputSerializer_ignoresClientContextPlatform() throws Exceptio
"caller ClientContext must not switch serialization to field-based (Gson), got: " + result);
}

@Test
void PojoHandler_inputSerializer_bindsOnlyBeanProperties() throws Exception {
LambdaRequestHandler handler =
getLambdaRequestHandler("test.lambda.handlers.POJOHanlderImpl::pojoInputHandler");

InvocationRequest request = getTestInvocationRequest();
request.setClientContext("{\"env\":{\"platform\":\"Android\"}}");
request.setContent("{\"name\":\"x\",\"locked\":true}".getBytes());

assertEquals("false", handler.call(request).toString());
}

private LambdaRequestHandler getLambdaRequestHandler(String handler) throws ClassNotFoundException {
ClassLoader cl = this.getClass().getClassLoader();
HandlerInfo handlerInfo = HandlerInfo.fromString(handler, cl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,27 @@ public String getBeanProperty() {
return "property-based-value";
}
}

@SuppressWarnings("unused")
public boolean pojoInputHandler(PojoInput input) {
return input.isLocked();
}

@SuppressWarnings("unused")
public static class PojoInput {
private boolean locked = false;
private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public boolean isLocked() {
return locked;
}
}
}