@Test @Ignore public void should_generate_one_quote_in_euro_for_one_quote_in_dollar() { Observable<String> quoteSource = hot("--g----", of("g", new Quote("GOOGL", 1300).toJson())); Observable<String> forexSource = hot("--f-x--", of("f", new Quote("EUR/USD", 1.3).toJson(), "x", new Quote("EUR/USD", 1.4).toJson())); StockQuoteServer stockQuoteServer = createServer(quoteSource, forexSource); HttpRequest request = createRequest("code", "GOOGL"); expectObservable(stockQuoteServer.getEvents(request).map(q -> q.quote)) .toBe("--v----", of("v", 1000d)); }
@Override protected Observable<Quote> getEvents(HttpRequest request) { String stockCode = request.getParameter("code"); return stockQuoteEventStreamClient .readServerSideEvents() .map(Quote::fromJson); }
StockQuoteServer extends RxNettyEventServer<Quote> { @Override protected Observable<Quote> getEvents(HttpRequest request) { String stockCode = request.getParameter("code"); return stockQuoteEventStreamClient .readServerSideEvents() .map(Quote::fromJson); } }
StockQuoteServer extends RxNettyEventServer<Quote> { @Override protected Observable<Quote> getEvents(HttpRequest request) { String stockCode = request.getParameter("code"); return stockQuoteEventStreamClient .readServerSideEvents() .map(Quote::fromJson); } StockQuoteServer(int port,
                            EventStreamClient stockQuoteEventStreamClient,
                            EventStreamClient forexEventStreamClient,
                            Scheduler scheduler); }
StockQuoteServer extends RxNettyEventServer<Quote> { @Override protected Observable<Quote> getEvents(HttpRequest request) { String stockCode = request.getParameter("code"); return stockQuoteEventStreamClient .readServerSideEvents() .map(Quote::fromJson); } StockQuoteServer(int port,
                            EventStreamClient stockQuoteEventStreamClient,
                            EventStreamClient forexEventStreamClient,
                            Scheduler scheduler);  }
StockQuoteServer extends RxNettyEventServer<Quote> { @Override protected Observable<Quote> getEvents(HttpRequest request) { String stockCode = request.getParameter("code"); return stockQuoteEventStreamClient .readServerSideEvents() .map(Quote::fromJson); } StockQuoteServer(int port,
                            EventStreamClient stockQuoteEventStreamClient,
                            EventStreamClient forexEventStreamClient,
                            Scheduler scheduler);   }