I am currently learning spring integration framework. So please forgive and correct me if my question is absurd. how to or is there a way to mock an http outbound gateway to run my unit tastcase?
public IntegrationFlow sendSms() {
final ObjectMapper objectMapper = new ObjectMapper();
objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_PROPERTIES, true);
final JsonObjectMapper<?, ?> mapper = new Jackson2JsonObjectMapper(objectMapper);
return IntegrationFlows.from("sendSmsGatewayRequestChannel")
.handle(Http
.outboundGateway(environment.getProperty("integration.sms.endpoint")
+ "?ProductType={ProductType}&MobleNo={MobleNo}&smsType={smsType}&Message={Message}")
.expectedResponseType(String.class).httpMethod(HttpMethod.GET)
.uriVariableExpressions(createExpressionMap()))
.transform(Transformers.fromJson(SmsResponseDto.class, mapper)).get();
}
this is my integration flow.
Also, can we use mockmvc for testing inbound gateway?