Search in sources :

Example 1 with DummyHandler

use of com.nextdoor.bender.handler.BaseHandlerTest.DummyHandler in project bender by Nextdoor.

the class BaseHandlerS3Test method testS3Config.

@Test
public void testS3Config() throws HandlerException {
    BaseHandler handler = new DummyHandler();
    handler.CONFIG_FILE = null;
    handler.s3ClientFactory = this.clientFactory;
    List<DummyEvent> events = new ArrayList<DummyEvent>(1);
    TestContext context = new TestContext();
    context.setInvokedFunctionArn("arn:aws:lambda:us-east-1:123:function:test");
    handler.handler(events, context);
    assertEquals("s3://" + S3_BUCKET + "/bender/config.json", handler.config.getConfigFile());
    assertEquals("Test Events", handler.config.getSources().get(0).getName());
}
Also used : DummyHandler(com.nextdoor.bender.handler.BaseHandlerTest.DummyHandler) TestContext(com.nextdoor.bender.aws.TestContext) ArrayList(java.util.ArrayList) DummyEvent(com.nextdoor.bender.handler.BaseHandlerTest.DummyEvent) Test(org.junit.Test)

Aggregations

TestContext (com.nextdoor.bender.aws.TestContext)1 DummyEvent (com.nextdoor.bender.handler.BaseHandlerTest.DummyEvent)1 DummyHandler (com.nextdoor.bender.handler.BaseHandlerTest.DummyHandler)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1