Как запустить IntegrationFlow в приведенном ниже классе JUnit? В настоящее время наступает исключение
java.lang.AssertionError: Further request(s) expected leaving 1 unsatisfied expectation(s). 0 request(s) executed.
потому что поток интеграции не запущен.
Класс JUnit:
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@DirtiesContext
public class FlowTest {
private final RestTemplate restTemplate = new RestTemplate();
private MockRestServiceServer mockServer;
@Before
public void setup() {
mockServer = MockRestServiceServer.createServer(restTemplate);
}
@Test
public void test() {
mockServer.expect(requestTo("http://localhost:8080/data"));
final IntegrationFlow integrationFlow = f -> f
.handle(Http.outboundGateway("http://localhost:8080/data", restTemplate).httpMethod(HttpMethod.GET)
.expectedResponseType(String.class));
mockServer.verify();
}
}