use of com.nextdoor.bender.handler.BaseHandler in project bender by Nextdoor.
the class S3HandlerTest method testSourceRegexFail.
@Test
public void testSourceRegexFail() throws Throwable {
BaseHandler.CONFIG_FILE = "/com/nextdoor/bender/handler/config_s3_source.json";
TestContext ctx = new TestContext();
ctx.setFunctionName("unittest");
ctx.setInvokedFunctionArn("arn:aws:lambda:us-east-1:123:function:test-function:staging");
BaseHandler<S3EventNotification> handler = (BaseHandler) getHandler();
handler.init(ctx);
handler.handler(getTestEvent("foo", false), ctx);
assertEquals(0, DummyTransportHelper.BufferedTransporter.output.size());
}
use of com.nextdoor.bender.handler.BaseHandler in project bender by Nextdoor.
the class S3HandlerTest method testSourceRegex.
@Test
public void testSourceRegex() throws Throwable {
BaseHandler.CONFIG_FILE = "/com/nextdoor/bender/handler/config_s3_source.json";
TestContext ctx = new TestContext();
ctx.setFunctionName("unittest");
ctx.setInvokedFunctionArn("arn:aws:lambda:us-east-1:123:function:test-function:staging");
BaseHandler<S3EventNotification> handler = (BaseHandler) getHandler();
handler.init(ctx);
handler.handler(getTestEvent(), ctx);
assertEquals(1, DummyTransportHelper.BufferedTransporter.output.size());
}
Aggregations