Guest User

Untitled

a guest
Jul 18th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import com.fnproject.fn.testing.*
  2. import org.junit.*
  3. import org.junit.Assert.*
  4. import kotlin.test.assertEquals
  5.  
  6. class HelloFunctionTest {
  7.  
  8. @Rule @JvmField
  9. val fn = FnTestingRule.createDefault()
  10.  
  11. @Test
  12. fun shouldReturnDefaultGreeting() {
  13.  
  14. fn.givenEvent().enqueue()
  15. fn.thenRun("HelloFunction","hello")
  16. assertEquals("Hello, world!", fn.getOnlyResult().getBodyAsString())
  17.  
  18. }
  19.  
  20. @Test
  21. fun shouldReturnGreeting() {
  22.  
  23. fn.givenEvent().withBody("Jhonny").enqueue()
  24. fn.thenRun("HelloFunction","hello")
  25. assertEquals("Hello, Jhonny", fn.getOnlyResult().getBodyAsString())
  26.  
  27. }
  28.  
  29. }
Add Comment
Please, Sign In to add comment