Skip to content

Commit 5b58491

Browse files
committed
Quick fix..?
1 parent 7cff542 commit 5b58491

2 files changed

Lines changed: 7 additions & 16 deletions

File tree

runtime/src/main/java/com/fnproject/fn/runtime/MethodFunctionInvoker.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ public class MethodFunctionInvoker implements FunctionInvoker {
2222
*/
2323
public void logFramer(FunctionRuntimeContext rctx, InputEvent evt) {
2424
String framer = rctx.getConfigurationByKey("FN_LOGFRAME_NAME").orElse("");
25-
25+
2626
if (framer != "") {
2727
String valueSrc = rctx.getConfigurationByKey("FN_LOGFRAME_HDR").orElse("");
28-
28+
2929
if (valueSrc != "") {
3030
String id = evt.getHeaders().get(valueSrc).orElse("");
3131
if (id != "") {
@@ -34,10 +34,9 @@ public void logFramer(FunctionRuntimeContext rctx, InputEvent evt) {
3434
}
3535
}
3636
}
37-
3837
}
39-
40-
38+
39+
4140
/**
4241
* Invoke the function wrapped by this loader
4342
*

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

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -215,20 +215,12 @@ public void shouldReadBytesOnDefaultCodec() throws Exception {
215215
public void shouldPrintLogFrame() throws Exception {
216216
fn.setConfig("FN_LOGFRAME_NAME", "containerID");
217217
fn.setConfig("FN_LOGFRAME_HDR", "fnID");
218-
fn.givenEvent().enqueue();
219-
TestFn.setOutput("Hello world");
218+
fn.givenEvent().withHeader("fnID", "uhfieuwfhieuwh").withBody( "Hello world!").enqueue();
220219

221-
fn.thenRun(TestFn.class, "setOutput");
220+
fn.thenRun(TestFn.class, "fnEcho");
222221
assertThat(fn.getOnlyOutputAsString()).isEqualTo("Hello world!");
222+
assertThat(fn.getStdErrAsString()).isEqualTo("");
223223

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");
232224
}
233225

234226

0 commit comments

Comments
 (0)