use of com.github.ljtfreitas.julian.Arguments in project julian-http-client by ljtfreitas.
the class FutureResponseTTest method bind.
@Test
void bind(@Mock Promise<Response<String>> promise, @Mock ResponseFn<String, Object> fn) {
Arguments arguments = Arguments.empty();
String content = "hello";
when(fn.run(promise, arguments)).thenReturn(Promise.done(content));
Future<Object> future = responseT.bind(endpoint, fn).join(promise, arguments);
assertThat(future.get(), equalTo(content));
}
use of com.github.ljtfreitas.julian.Arguments in project julian-http-client by ljtfreitas.
the class OptionResponseTTest method bindNullValue.
@Test
void bindNullValue(@Mock Promise<Response<String>> promise, @Mock ResponseFn<String, Object> fn) {
Arguments arguments = Arguments.empty();
when(fn.run(promise, arguments)).thenReturn(Promise.done(null));
Option<Object> option = responseT.bind(endpoint, fn).join(promise, arguments);
assertTrue(option.isEmpty());
}