Due to the way the plugin sdk operates, the handler's Execute function will call os.Exit by default as part of Execute()
This makes it impossible to test state after Execute() is called from main() in the test used in TestMain.
I've addressed this by changing the testing structure tp test Execute explicitly and setting a non-default exitFunction to capture the exit status integer instead of calling os.Exit
previous TestMain never actually reached the assert.True(requestReceived) statement because main() was calling os.Exit
Due to the way the plugin sdk operates, the handler's Execute function will call
os.Exit
by default as part ofExecute()
This makes it impossible to test state after
Execute()
is called frommain()
in the test used inTestMain
.I've addressed this by changing the testing structure tp test Execute explicitly and setting a non-default exitFunction to capture the exit status integer instead of calling os.Exit
previous TestMain never actually reached the
assert.True(requestReceived)
statement becausemain()
was callingos.Exit