use of org.finos.symphony.toolkit.koreai.response.KoreAIResponseBuilderImpl in project spring-bot by finos.
the class KoreAIResponseHandlerImplTest method setup.
@BeforeEach
public void setup() throws Exception {
om = new ObjectMapper();
ObjectMapperFactory.initialize(om, ObjectMapperFactory.extendedSymphonyVersionSpace(new VersionSpace(KoreAIResponse.class)));
this.builder = new KoreAIResponseBuilderImpl(new ObjectMapper(), JsonNodeFactory.instance);
this.output = new KoreAIResponseHandlerImpl(api, rl, true, true, om, "classpath:/test-templates");
Mockito.when(api.v4StreamSidMessageCreatePost(Mockito.isNull(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.isNull(), Mockito.isNull(), Mockito.isNull(), Mockito.isNull())).then((a) -> {
streamId.add(a.getArgument(1));
messageMLResponse.add(a.getArgument(2));
jsonResponse.add(a.getArgument(3));
return null;
});
jsonResponse = new ArrayList<String>();
messageMLResponse = new ArrayList<String>();
streamId = new ArrayList<String>();
}
use of org.finos.symphony.toolkit.koreai.response.KoreAIResponseBuilderImpl in project spring-bot by finos.
the class KoreAIRequesterImplTest method setupWireMock.
@BeforeEach
public void setupWireMock() throws Exception {
String response = StreamUtils.copyToString(KoreAIRequesterImplTest.class.getResourceAsStream("ans1.json"), Charsets.UTF_8);
wireMockRule.stubFor(post(urlEqualTo("/kore")).withHeader("Authorization", new EqualToPattern("Bearer some-jwt")).willReturn(aResponse().withHeader("Content-Type", "application/json").withBody(response)));
requester = new KoreAIRequesterImpl(responseHandler, new KoreAIResponseBuilderImpl(om, JsonNodeFactory.instance), "http://localhost:9998/kore", JsonNodeFactory.instance, "some-jwt");
((KoreAIRequesterImpl) requester).afterPropertiesSet();
wireMockRule.start();
}
Aggregations