@Test @Ignore public void should_filter_quotes_for_requested_stock() { Observable<String> quoteSource = hot("--(ga)--", of("g", new Quote("GOOGL", 705.8673).toJson(), "a", new Quote("APPLE", 98.18).toJson())); Observable<String> forexSource = hot("--f--", of("f", new Quote("EUR/USD", 1).toJson())); StockQuoteServer stockQuoteServer = createServer(quoteSource, forexSource); HttpRequest request = createRequest("code", "GOOGL"); expectObservable(stockQuoteServer.getEvents(request).map(q -> q.code)) .toBe("--v--", of("v", "GOOGL")); }
@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);   }