Skip to content

Commit 7cff542

Browse files
committed
WIP debugging test
1 parent 0e8ba92 commit 7cff542

2 files changed

Lines changed: 34 additions & 13 deletions

File tree

runtime/src/test/java/com/fnproject/fn/runtime/EndToEndInvokeTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,26 @@ public void shouldReadBytesOnDefaultCodec() throws Exception {
211211

212212
}
213213

214+
@Test
215+
public void shouldPrintLogFrame() throws Exception {
216+
fn.setConfig("FN_LOGFRAME_NAME", "containerID");
217+
fn.setConfig("FN_LOGFRAME_HDR", "fnID");
218+
fn.givenEvent().enqueue();
219+
TestFn.setOutput("Hello world");
220+
221+
fn.thenRun(TestFn.class, "setOutput");
222+
assertThat(fn.getOnlyOutputAsString()).isEqualTo("Hello world!");
223+
224+
// fn.getConfig("FN_LOGFRAME_NAME").isE
225+
// fn.thenRun(TestFn.class, "echoInput");
226+
// assertThat(configuration).containsEntry("FN_LOGFRAME_NAME", "containerID");
227+
// assertThat(configuration).containsEntry("FN_LOGFRAME_HDR", "fnID");
228+
229+
// FnResult result = fn.getResults().get(0);
230+
// Assertions.assertThat(result.getBodyAsString()).isEqualTo("containerID=fnID\nHello World");
231+
// assertThat(fn.getOnlyOutputAsString()).isEqualTo("containerID=fnID\nHello World");
232+
}
233+
214234

215235
@Test
216236
public void shouldWriteBytesOnDefaultCodec() throws Exception {

testing-junit4/src/test/java/com/fnproject/fn/testing/FnTestingRuleTest.java

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -250,20 +250,21 @@ public void shouldHandleBodyAsInputStream() throws IOException {
250250
Assertions.assertThat(capturedBodies.get(0)).isEqualTo("FOO BAR".getBytes());
251251
}
252252

253-
@Test
254-
public void shouldPrintLogFrame() throws Exception {
255-
fn.setConfig("FN_LOGFRAME_NAME", "containerID");
256-
fn.setConfig("FN_LOGFRAME_HDR", "fnID");
257-
fn.givenEvent().withBody("Hello World").enqueue();
258-
259-
fn.thenRun(TestFn.class, "copyConfiguration");
260-
Assertions.assertThat(configuration).containsEntry("FN_LOGFRAME_NAME", "containerID");
261-
Assertions.assertThat(configuration).containsEntry("FN_LOGFRAME_HDR", "fnID");
253+
// @Test
254+
// public void shouldPrintLogFrame() throws Exception {
255+
// fn.setConfig("FN_LOGFRAME_NAME", "containerID");
256+
// fn.setConfig("FN_LOGFRAME_HDR", "fnID");
257+
// fn.givenEvent().withBody("Hello World").enqueue();
258+
259+
// fn.thenRun(TestFn.class, "copyConfiguration");
260+
// // fn.thenRun(TestFn.class, "echoInput");
261+
// Assertions.assertThat(configuration).containsEntry("FN_LOGFRAME_NAME", "containerID");
262+
// Assertions.assertThat(configuration).containsEntry("FN_LOGFRAME_HDR", "fnID");
262263

263-
FnResult result = fn.getOnlyResult();
264-
Assertions.assertThat(result.getBodyAsString()).isEqualTo("containerID=fnID\nHello World");
265-
// assertThat(fn.getOnlyOutputAsString()).isEqualTo("containerID=fnID\nHello World");
266-
}
264+
// FnResult result = fn.getResults().get(0);
265+
// Assertions.assertThat(result.getBodyAsString()).isEqualTo("containerID=fnID\nHello World");
266+
// // assertThat(fn.getOnlyOutputAsString()).isEqualTo("containerID=fnID\nHello World");
267+
// }
267268

268269

269270
// TODO move this to HTTP gateway

0 commit comments

Comments
 (0)