Skip to content

Commit

Permalink
#1223 BNR default eurToRon to 492
Browse files Browse the repository at this point in the history
  • Loading branch information
amihaiemil committed Sep 1, 2021
1 parent 997f979 commit 0030c8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ public BigDecimal euroToRon() {
return readEurFromXml(response.body());
} catch (final Exception ex) {
LOG.error(
"[BNR] Could not get EUR-RON exchange rate: ",
ex.getMessage()
"[BNR] Could not get EUR-RON exchange rate: ", ex
);
LOG.error("[BNR] Returning 487 as default exchange rate.");
return BigDecimal.valueOf(487);
LOG.error("[BNR] Returning 492 as default exchange rate.");
return BigDecimal.valueOf(492);
}
}

Expand Down Expand Up @@ -126,12 +125,12 @@ private BigDecimal readEurFromXml(final String xml) {
.multiply(BigDecimal.valueOf(100));
}
}
LOG.warn("[BNR] EUR-RON not found! Returning 487 as default.");
return BigDecimal.valueOf(487);
LOG.warn("[BNR] EUR-RON not found! Returning 492 as default.");
return BigDecimal.valueOf(492);
} catch (final Exception ex) {
LOG.error("[BNR] Exception while parsing XML: ", ex.getMessage());
LOG.error("[BNR] Returning 487 as default exchange rate.");
return BigDecimal.valueOf(487);
LOG.error("[BNR] Exception while parsing XML: ", ex);
LOG.error("[BNR] Returning 492 as default exchange rate.");
return BigDecimal.valueOf(492);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class XmlBnrTestCase {
public void getsEurToRonFromBnr() {
MatcherAssert.assertThat(
new XmlBnr().euroToRon(),
Matchers.greaterThan(BigDecimal.valueOf(400))
Matchers.greaterThan(BigDecimal.valueOf(490))
);
}

Expand All @@ -57,7 +57,7 @@ public void getsEurToRonFromBnr() {
public void getsFallbackEurToRonFromBnr() {
MatcherAssert.assertThat(
new XmlBnr(URI.create("http://localhost:12345")).euroToRon(),
Matchers.equalTo(BigDecimal.valueOf(487))
Matchers.equalTo(BigDecimal.valueOf(492))
);
}

Expand Down

0 comments on commit 0030c8e

Please sign in to comment.