@Test
public void should_lifecycle_post_hello_msg() throws Exception {
LifecycleListenerFilter filter = new LifecycleListenerFilter();
Factory.LocalMachines.overrideComponents().set("LifecycleListenerFilter", filter);
HttpRequest httpRequest = server.client().authenticatedAs("admin").POST(
"/api/core/hellomsg").send("{\"msg\": \"restx\"}");
assertThat(httpRequest.code()).isEqualTo(200);
assertThat(httpRequest.body().trim()).isEqualTo("{\n \"msg\" : \"hello restx\"\n}");
assertLifecycleMethods(filter, "[Optional.of(Message{msg='restx'})]", "[Optional.of(Message{msg='hello restx'})]");
}