use of com.amazonaws.services.lambda.invoke.LambdaFunctionException in project aws-athena-query-federation by awslabs.
the class ExampleMetadataHandlerTest method doGetTableFail.
@Test(expected = LambdaFunctionException.class)
public void doGetTableFail() {
try {
logger.info("doGetTableFail - enter");
GetTableRequest req = new GetTableRequest(IdentityUtil.fakeIdentity(), "queryId", "default", new TableName("lambda", "fake"));
metadataHandler.doGetTable(allocator, req);
} catch (Exception ex) {
logger.info("doGetTableFail: ", ex);
throw new LambdaFunctionException(ex.getMessage(), false, "repackaged");
}
}
use of com.amazonaws.services.lambda.invoke.LambdaFunctionException in project aws-athena-query-federation by awslabs.
the class LambdaFunctionExceptionSerDeTest method deserialize.
@Test
public void deserialize() throws IOException {
logger.info("deserialize: enter");
InputStream input = new ByteArrayInputStream(expectedSerDeText.getBytes());
LambdaFunctionException actual = mapper.readValue(input, LambdaFunctionException.class);
logger.info("deserialize: deserialized[{}]", actual.toString());
assertEquals(expected.getType(), actual.getType());
assertEquals(expected.getMessage(), actual.getMessage());
assertEquals(expected.getCause(), actual.getCause());
expected.fillInStackTrace();
actual.fillInStackTrace();
assertEquals(expected.getStackTrace().length, actual.getStackTrace().length);
logger.info("deserialize: exit");
}
Aggregations