@Test public void testCommandToAsync() throws Exception { GenericCommand<InputStream> command = new CommandHelperTestCommand(); final ResponseEntity<?> responseEntity = CommandHelper.async(command); assertEquals(HttpStatus.NO_CONTENT, responseEntity.getStatusCode()); }
public static ResponseEntity<Void> async(final GenericCommand<?> command) { final Observable<?> stream = command.toObservable(); return stream.map(is -> { final MultiValueMap<String, String> headers = new HttpHeaders(); HttpStatus status = command.getStatus(); for (Header header : command.getCommandResponseHeaders()) { headers.put(header.getName(), Collections.singletonList(header.getValue())); } return new ResponseEntity<Void>(null, headers, status); }).toBlocking().first(); }
CommandHelper { public static ResponseEntity<Void> async(final GenericCommand<?> command) { final Observable<?> stream = command.toObservable(); return stream.map(is -> { final MultiValueMap<String, String> headers = new HttpHeaders(); HttpStatus status = command.getStatus(); for (Header header : command.getCommandResponseHeaders()) { headers.put(header.getName(), Collections.singletonList(header.getValue())); } return new ResponseEntity<Void>(null, headers, status); }).toBlocking().first(); } }
CommandHelper { public static ResponseEntity<Void> async(final GenericCommand<?> command) { final Observable<?> stream = command.toObservable(); return stream.map(is -> { final MultiValueMap<String, String> headers = new HttpHeaders(); HttpStatus status = command.getStatus(); for (Header header : command.getCommandResponseHeaders()) { headers.put(header.getName(), Collections.singletonList(header.getValue())); } return new ResponseEntity<Void>(null, headers, status); }).toBlocking().first(); } private  CommandHelper(); }
CommandHelper { public static ResponseEntity<Void> async(final GenericCommand<?> command) { final Observable<?> stream = command.toObservable(); return stream.map(is -> { final MultiValueMap<String, String> headers = new HttpHeaders(); HttpStatus status = command.getStatus(); for (Header header : command.getCommandResponseHeaders()) { headers.put(header.getName(), Collections.singletonList(header.getValue())); } return new ResponseEntity<Void>(null, headers, status); }).toBlocking().first(); } private  CommandHelper(); static StreamingResponseBody toStreaming(final HystrixCommand<InputStream> command); static ResponseEntity<Void> async(final GenericCommand<?> command); static ResponseEntity<StreamingResponseBody> toStreaming(final GenericCommand<InputStream> command); static Publisher<T> toPublisher(final Class<T> clazz, final ObjectMapper mapper,
            final HystrixCommand<InputStream> command); static Stream<T> toStream(Class<T> clazz, ObjectMapper mapper, HystrixCommand<InputStream> command); }
CommandHelper { public static ResponseEntity<Void> async(final GenericCommand<?> command) { final Observable<?> stream = command.toObservable(); return stream.map(is -> { final MultiValueMap<String, String> headers = new HttpHeaders(); HttpStatus status = command.getStatus(); for (Header header : command.getCommandResponseHeaders()) { headers.put(header.getName(), Collections.singletonList(header.getValue())); } return new ResponseEntity<Void>(null, headers, status); }).toBlocking().first(); } private  CommandHelper(); static StreamingResponseBody toStreaming(final HystrixCommand<InputStream> command); static ResponseEntity<Void> async(final GenericCommand<?> command); static ResponseEntity<StreamingResponseBody> toStreaming(final GenericCommand<InputStream> command); static Publisher<T> toPublisher(final Class<T> clazz, final ObjectMapper mapper,
            final HystrixCommand<InputStream> command); static Stream<T> toStream(Class<T> clazz, ObjectMapper mapper, HystrixCommand<InputStream> command);  }