From 18a92191c784f3cccf96b71623393cbbd169c56d Mon Sep 17 00:00:00 2001 From: thcathy Date: Mon, 10 Jun 2024 18:19:17 +0800 Subject: [PATCH] fix test cases --- .../thc/parser/finance/Money18LocalIndexQuoteRequest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/thc/parser/finance/Money18LocalIndexQuoteRequest.java b/src/main/java/thc/parser/finance/Money18LocalIndexQuoteRequest.java index ee9e911..bf3dcbb 100644 --- a/src/main/java/thc/parser/finance/Money18LocalIndexQuoteRequest.java +++ b/src/main/java/thc/parser/finance/Money18LocalIndexQuoteRequest.java @@ -30,6 +30,8 @@ public class Money18LocalIndexQuoteRequest implements HttpParseRequest invalidStockCode = List.of("CSCSHQ", "CSCSZQ"); + @Override public String url() { return URL; } @@ -46,7 +48,7 @@ public List 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);