package com.example.accurest;

import com.example.DemoApplication;
import com.example.TransformerConfiguration;
import com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.core.io.Resource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.FileCopyUtils;

import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author Marcin Grzejszczak
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = DemoApplication.class)
public class BaseClass {

	@Autowired TransformerConfiguration transformerConfiguration;

	@Value("classpath:/github-webhook-input/issue-created.json") Resource issueCreatedInput;
	@Value("classpath:/github-webhook-input/hook-created.json") Resource hookCreatedInput;

	@Before
	public void setup() {
		RestAssuredMockMvc.standaloneSetup(transformerConfiguration);
	}

	public void createHook() throws IOException  {
		transformerConfiguration.transform(read(hookCreatedInput));
	}

	public void createHookV2() throws IOException  {
		createHook();
	}

	public void createIssue() throws IOException  {
		transformerConfiguration.transform(read(issueCreatedInput));
	}

	public void createIssueV2() throws IOException  {
		createIssue();
	}

	private String read(Resource resource) throws IOException {
		return FileCopyUtils.copyToString(new InputStreamReader(resource.getInputStream()));
	}
}

@@ -35,147 +35,131 @@
 ort 
-com.example.DemoApplication;%0Aimport com.example.TransformerConfiguration;%0Aimport com.jayway.restassured.module.mockmvc.RestAssuredMockMvc
+java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport javax.inject.Inject
 ;%0A
+%0A
 impo
@@ -579,61 +579,203 @@
 ort 
-java.io.IOException;%0Aimport java.io.InputStreamReader
+com.example.DemoApplication;%0Aimport com.example.TransformerConfiguration;%0Aimport com.jayway.restassured.module.mockmvc.RestAssuredMockMvc;%0A%0Aimport io.codearte.accurest.messaging.AccurestMessaging
 ;%0A%0A/
@@ -1004,16 +1004,54 @@
 uration;
+%0A%09@Inject AccurestMessaging messaging;
 %0A%0A%09@Valu
@@ -1255,16 +1255,16 @@
 tup() %7B%0A
-
 %09%09RestAs
@@ -1319,16 +1319,82 @@
 ation);%0A
+%09%09messaging.receiveMessage(%22output%22, 100, TimeUnit.MILLISECONDS);%0A
 %09%7D%0A%0A%09pub

Trying to clear the output