Created
August 12, 2019 16:57
-
-
Save recursivecodes/876570b1b3f46eb4ad9f7a79afee5d05 to your computer and use it in GitHub Desktop.
HelloFunctionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.fn; | |
import com.fnproject.fn.testing.*; | |
import org.junit.*; | |
import static org.junit.Assert.*; | |
public class HelloFunctionTest { | |
@Rule | |
public final FnTestingRule testing = FnTestingRule.createDefault(); | |
@Test | |
public void shouldReturnGreeting() { | |
String event = "[your test image event JSON]"; | |
testing.givenEvent().withBody(event).enqueue(); | |
testing.thenRun(HelloFunction.class, "handleRequest"); | |
FnResult result = testing.getOnlyResult(); | |
assertTrue(result.isSuccess()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment