Skip to content

Commit

Permalink
fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
thcathy committed Jun 10, 2024
1 parent 98eb228 commit 18a9219
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class Money18LocalIndexQuoteRequest implements HttpParseRequest<List<Stoc
protected static final Logger log = LoggerFactory.getLogger(Money18LocalIndexQuoteRequest.class);
private static final ObjectReader jsonReader = new ObjectMapper().configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true).readerFor(Map.class);

private static final List<String> invalidStockCode = List.of("CSCSHQ", "CSCSZQ");

@Override
public String url() { return URL; }

Expand All @@ -46,7 +48,7 @@ public List<StockQuote> parseResponse(InputStream response) {
String[] indexes = IOUtils.toString(response, StandardCharsets.ISO_8859_1).split(";");
return Arrays.stream(indexes)
.flatMap(Money18LocalIndexQuoteRequest::toStockQuote)
.filter(q -> !q.getStockCode().equals("CSCSHQ") || !q.getStockCode().equals("CSCSZQ"))
.filter(q -> !invalidStockCode.contains(q.getStockCode()))
.collect(Collectors.toList());
} catch (Exception e) {
log.error("cannot parse response", e);
Expand Down

0 comments on commit 18a9219

Please sign in to comment.