Skip to content

Commit

Permalink
Merge pull request #72 from aVolpe/fix/gnb_and_mercosur
Browse files Browse the repository at this point in the history
fix: GNB and mercosur
  • Loading branch information
aVolpe authored Nov 8, 2023
2 parents 27e9a18 + 422ef82 commit 1f9b2a4
Show file tree
Hide file tree
Showing 6 changed files with 250 additions and 153 deletions.
2 changes: 1 addition & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

gtag('js', new Date());

gtag('config', 'UA-84291651-2');
gtag('config', 'UA-84291651-2', 'auto');
</script>

<meta charset="utf-8">
Expand Down
2 changes: 1 addition & 1 deletion client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<v-spacer></v-spacer>
<span>
<a href="https://www.github.com/avolpe/cotizacion" target="_blank">
&copy; Arturo Volpe 2022
&copy; Arturo Volpe 2023
</a>
</span>
<v-spacer></v-spacer>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/py/com/volpe/cotizacion/gatherer/GNB.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class GNB implements Gatherer {

private final HTTPHelper helper;

private static final String WS_URL = "https://www.bancognbcaminamosjuntos.com.py/Yaguarete/public/quotations";
private static final String WS_URL = "https://www.bancognb.com.py/Yaguarete/public/quotations";

@Override
public List<QueryResponse> doQuery(Place place, List<PlaceBranch> branches) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/py/com/volpe/cotizacion/gatherer/Mercosur.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
@RequiredArgsConstructor
public class Mercosur implements Gatherer {

private static final String BASE_URL = "https://2019.mercosurcambios.com/Sucursale/%s";
private static final String BASE_URL = "https://site.mercosurcambios.com/Sucursale/%s";

private final HTTPHelper helper;

Expand All @@ -55,7 +55,7 @@ private List<QueryResponseDetail> getExchangeOf(String id) {
Document doc = Jsoup.parse(html, "", Parser.htmlParser());
List<QueryResponseDetail> toRet = new ArrayList<>();

for (Element e : doc.select("table.table tbody tr")) {
for (Element e : doc.select("table tbody tr")) {
QueryResponseDetail ed = new QueryResponseDetail();
Elements columns = e.getElementsByTag("th");

Expand Down
16 changes: 8 additions & 8 deletions src/test/java/py/com/volpe/cotizacion/gatherer/MercosurTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ void doQueryTest() throws IOException {
List<QueryResponseDetail> exchanges = data.get(0).getDetails();

QueryResponseDetail usd = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "USD")).findFirst().orElseThrow();
assertEquals(6770, usd.getPurchasePrice());
assertEquals(6890, usd.getSalePrice());
assertEquals(7380, usd.getPurchasePrice());
assertEquals(7440, usd.getSalePrice());
QueryResponseDetail brl = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "BRL")).findFirst().orElseThrow();
assertEquals(1220, brl.getPurchasePrice());
assertEquals(1280, brl.getSalePrice());
assertEquals(1475, brl.getPurchasePrice());
assertEquals(1500, brl.getSalePrice());
QueryResponseDetail eur = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "EUR")).findFirst().orElseThrow();
assertEquals(6870, eur.getPurchasePrice());
assertEquals(7580, eur.getSalePrice());
assertEquals(7550, eur.getPurchasePrice());
assertEquals(8210, eur.getSalePrice());
QueryResponseDetail arg = exchanges.stream().filter(f -> Objects.equals(f.getIsoCode(), "ARS")).findFirst().orElseThrow();
assertEquals(20, arg.getPurchasePrice());
assertEquals(36, arg.getSalePrice());
assertEquals(7, arg.getPurchasePrice());
assertEquals(9, arg.getSalePrice());

}

Expand Down
Loading

0 comments on commit 1f9b2a4

Please sign in to comment.