From fceb1ed86f7b2441a9ebf70f785e9cd553afe5fc Mon Sep 17 00:00:00 2001 From: "lauren.mccarthy" Date: Tue, 23 Apr 2019 09:40:01 +0100 Subject: [PATCH] PAS-685 May exchange rates --- conf/resources/xml/exrates-monthly-0519.xml | 1172 +++++++++++++++++ .../ExchangeRateRepositorySpec.scala | 39 + 2 files changed, 1211 insertions(+) create mode 100644 conf/resources/xml/exrates-monthly-0519.xml create mode 100644 test/uk/gov/hmrc/currencyconversion/repositories/ExchangeRateRepositorySpec.scala diff --git a/conf/resources/xml/exrates-monthly-0519.xml b/conf/resources/xml/exrates-monthly-0519.xml new file mode 100644 index 0000000..f08c860 --- /dev/null +++ b/conf/resources/xml/exrates-monthly-0519.xml @@ -0,0 +1,1172 @@ + + + + Argentina + AR + Peso + ARS + 53.97 + + + Australia + AU + Dollar + AUD + 1.8173 + + + Brazil + BR + Real + BRL + 5.1227 + + + Canada + CA + Dollar + CAD + 1.739 + + + Denmark + DK + Krone + DKK + 8.6188 + + + Hong Kong + HK + Dollar + HKD + 10.23 + + + India + IN + Rupee + INR + 90.82 + + + Israel + IL + Shekel + ILS + 4.6654 + + + Japan + JP + Yen + JPY + 146.14 + + + Malaysia + MY + Ringgit + MYR + 5.3951 + + + Mexico + MX + Mexican Peso + MXN + 24.55 + + + New Zealand + NZ + Dollar + NZD + 1.9421 + + + Norway + NO + Norwegian Krone + NOK + 11.06 + + + Philippines + PH + Peso + PHP + 67.54 + + + Saudi Arabia + SA + Riyal + SAR + 4.8935 + + + Singapore + SG + Dollar + SGD + 1.7649 + + + South Africa + ZA + Rand + ZAR + 18.23 + + + South Korea + KR + Won + KRW + 1480.73 + + + Sweden + SE + Krona + SEK + 12.05 + + + Switzerland + CH + Franc + CHF + 1.3166 + + + Taiwan + TW + Dollar + TWD + 40.25 + + + Thailand + TH + Baht + THB + 41.45 + + + USA + US + Dollar + USD + 1.3049 + + + Eurozone + EU + Euro + EUR + 1.1545 + + + Abu Dhabi + DH + Dirham + AED + 4.793 + + + Albania + AL + Lek + ALL + 143.74 + + + Algeria + DZ + Dinar + DZD + 155.49 + + + Angola + AO + Readj Kwanza + AOA + 416.31 + + + Antigua + AG + E Caribbean Dollar + XCD + 3.5232 + + + Armenia + AM + Dram + AMD + 630.79 + + + Aruba + AA + Florin + AWG + 2.3358 + + + Azerbaijan + AZ + New Manat + AZN + 2.2138 + + + Bahamas + BS + Dollar + BSD + 1.3049 + + + Bahrain + BH + Dinar + BHD + 0.4919 + + + Bangladesh + BD + Taka + BDT + 110.09 + + + Barbados + BB + Dollar + BBD + 2.6098 + + + Belarus + BY + Rouble + BYN + 2.7312 + + + Belize + BZ + Dollar + BZD + 2.6098 + + + Benin + BJ + CFA Franc + XOF + 757.31 + + + Bermuda + BM + Dollar (US) + BMD + 1.3049 + + + Bhutan + BT + Ngultrum + BTN + 90.82 + + + Bolivia + BO + Boliviano + BOB + 9.0169 + + + Bosnia- Herzegovinia + BA + Marka + BAM + 2.2581 + + + Botswana + BW + Pula + BWP + 13.79 + + + Brunei + BN + Dollar + BND + 1.7649 + + + Bulgaria + BG + Lev + BGN + 2.2581 + + + Burkina Faso + BK + CFA Franc + XOF + 757.31 + + + Burundi + BI + Franc + BIF + 2387.91 + + + Cambodia + KH + Riel + KHR + 5258.76 + + + Cameroon Republic + CM + CFA Franc + XAF + 757.31 + + + Cape Verde Islands + CV + Escudo + CVE + 127.89 + + + Cayman Islands + KY + Dollar + KYD + 1.07 + + + Central African Republic + CF + CFA Franc + XAF + 757.31 + + + Chad + TD + CFA Franc + XAF + 757.31 + + + Chile + CL + Peso + CLP + 860.54 + + + China + CN + Yuan + CNY + 8.7255 + + + Colombia + CO + Peso + COP + 4121.51 + + + Comoros + KM + Franc + KMF + 567.98 + + + Congo (Brazaville) + CG + CFA Franc + XAF + 757.31 + + + Congo (DemRep) + ZR + Congo Fr + CDF + 2147.21 + + + Costa Rica + CR + Colon + CRC + 777.52 + + + Cote d'Ivoire + CI + CFA Franc + XOF + 757.31 + + + Croatia + HR + Kuna + HRK + 8.588 + + + Cuba + CU + Peso + CUP + 1.3049 + + + Czech Republic + CZ + Koruna + CZK + 29.63 + + + Djibouti + DJ + Franc + DJF + 231.9 + + + Dominica + DM + E Caribbean Dollar + XCD + 3.5232 + + + Dominican Republic + DO + Peso + DOP + 66.05 + + + Dubai + DU + Dirham + AED + 4.793 + + + Ecuador + EC + Dollar + ECS + 1.3049 + + + Egypt + EG + Pound + EGP + 22.51 + + + El Salvador + SV + Colon + SVC + 11.41 + + + Equatorial Guinea + GQ + CFA Franc + XAF + 757.31 + + + Eritrea + ER + Nakfa + ERN + 19.57 + + + Ethiopia + ET + Birr + ETB + 37.45 + + + Fiji Islands + FJ + Dollar + FJD + 2.7821 + + + Fr. Polynesia + PF + CFP Franc + XPF + 137.77 + + + Gabon + GA + CFA Franc + XAF + 757.31 + + + Gambia + GM + Dalasi + GMD + 64.65 + + + Georgia + GE + Lari + GEL + 3.5141 + + + Ghana + GH + Cedi + GHS + 6.7007 + + + Grenada + GD + E Caribbean Dollar + XCD + 3.5232 + + + Guatemala + GT + Quetzal + GTQ + 9.9541 + + + Guinea Bissau + GW + CFA Franc + XOF + 757.31 + + + Guinea Republic + GN + Franc + GNF + 11915.74 + + + Guyana + GY + Dollar + GYD + 273.52 + + + Haiti + HT + Gourde + HTG + 109.71 + + + Honduras + HN + Lempira + HNL + 31.89 + + + Hungary + HU + Forint + HUF + 368.82 + + + Iceland + IS + Krona + ISK + 156.53 + + + Indonesia + ID + Rupiah + IDR + 18379.58 + + + Iraq + IQ + Dinar + IQD + 1552.83 + + + Jamaica + JM + Dollar + JMD + 171.19 + + + Jordan + JO + Dinar + JOD + 0.9252 + + + Kazakhstan + KZ + Tenge + KZT + 494.98 + + + Kenya + KE + Schilling + KES + 132.12 + + + Kuwait + KW + Dinar + KWD + 0.3968 + + + Kyrgyz Republic + KG + Som + KGS + 90.95 + + + Lao People's Dem Rep + LA + Kip + LAK + 11236.52 + + + Lebanon + LB + Pound + LBP + 1967.79 + + + Lesotho + LS + Loti + LSL + 18.23 + + + Liberia + LR + Dollar (US) + LRD + 1.3049 + + + Libya + LY + Dinar + LYD + 1.8073 + + + Macao + MO + Pataca + MOP + 10.54 + + + Macedonia + MK + Denar + MKD + 71.03 + + + Madagascar + MG + Malagasy Ariary + MGA + 4618.36 + + + Malawi + MW + Kwacha + MWK + 958.98 + + + Maldive Islands + MV + Rufiyaa + MVR + 20.14 + + + Mali Republic + ML + CFA Franc + XOF + 757.31 + + + Mauritania + MR + Ouguiya + MRO + 466.24 + + + Mauritius + MU + Rupee + MUR + 45.34 + + + Moldova + MD + Leu + MDL + 23.31 + + + Mongolia + MN + Tugrik + MNT + 3435.81 + + + Montserrat + MS + E Caribbean Dollar + XCD + 3.5232 + + + Morocco + MA + Dirham + MAD + 12.51 + + + Mozambique + MZ + Metical + MZN + 83.77 + + + Myanmar + MM + Kyat + MMK + 1979.99 + + + Nepal + NP + Rupee + NPR + 145.32 + + + New Caledonia + NC + CFP Franc + XPF + 137.77 + + + Nicaragua + NI + Gold Cordoba + NIO + 42.79 + + + Niger Republic + NE + CFA Franc + XOF + 757.31 + + + Nigeria + NG + Naira + NGN + 470.09 + + + Oman + OM + Rial + OMR + 0.5024 + + + Pakistan + PK + Rupee + PKR + 184.44 + + + Panama + PA + Balboa + PAB + 1.3049 + + + Papua New Guinea + PG + Kina + PGK + 4.4039 + + + Paraguay + PY + Guarani + PYG + 8117.04 + + + Peru + PE + New Sol + PEN + 4.2979 + + + Poland + PL + Zloty + PLN + 4.9308 + + + Qatar + QA + Riyal + QAR + 4.7508 + + + Romania + RO + New Leu + RON + 5.4996 + + + Russia + RU + Rouble + RUB + 83.41 + + + Rwanda + RW + Franc + RWF + 1180.81 + + + Saotome & Principe + ST + Dobra + STD + 28316.4 + + + Senegal + SN + CFA Franc + XOF + 757.31 + + + Serbia + XS + Dinar + RSD + 136.21 + + + Seychelles + SC + Rupee + SCR + 18.17 + + + Sierra Leone + SL + Leone + SLL + 11711.52 + + + Soloman Islands + SB + Dollar + SBD + 10.43 + + + Somali Republic + SO + Schilling + SOS + 759.45 + + + Sri Lanka + LK + Rupee + LKR + 227.82 + + + St Christopher & Anguilla + KN + E Caribbean Dollar + XCD + 3.5232 + + + St Lucia + LC + E Caribbean Dollar + XCD + 3.5232 + + + St Vincent + VC + E Caribbean Dollar + XCD + 3.5232 + + + Sudan Republic + SD + Pound + SDG + 62.14 + + + Surinam + SR + Dollar + SRD + 9.732 + + + Swaziland + SZ + Lilangeni + SZL + 18.23 + + + Tanzania + TZ + Schilling + TZS + 3020.85 + + + Togo Republic + TG + CFA Franc + XOF + 757.31 + + + Tonga Islands + TO + Pa'anga (AUS) + TOP + 1.8173 + + + Trinidad/Tobago + TT + Dollar + TTD + 8.8234 + + + Tunisia + TN + Dinar + TND + 3.905 + + + Turkey + TR + Turkish Lira + TRY + 7.4924 + + + Turkmenistan + TM + New Manat + TMT + 4.5672 + + + UAE + AE + Dirham + AED + 4.793 + + + Uganda + UG + Schilling + UGX + 4871.2 + + + Ukraine + UA + Hryvnia + UAH + 34.93 + + + Uruguay + UY + Peso + UYU + 44.59 + + + Uzbekistan + UZ + Sum + UZS + 11033.44 + + + Vanuatu + VU + Vatu + VUV + 148.7 + + + Venezuela + VE + Bolivar Fuerte + VEF + 324009.37 + + + Vietnam + VN + Dong + VND + 30271.84 + + + Wallis & Futuna Islands + WF + CFP Franc + XPF + 137.77 + + + Western Samoa + WS + Tala + WST + 3.3858 + + + Yemen (Rep of) + YE + Rial + YER + 326.68 + + + Zambia + ZM + Kwacha + ZMW + 16.01 + + + Zimbabwe + ZW + Dollar + ZWL + 472.24 + + diff --git a/test/uk/gov/hmrc/currencyconversion/repositories/ExchangeRateRepositorySpec.scala b/test/uk/gov/hmrc/currencyconversion/repositories/ExchangeRateRepositorySpec.scala new file mode 100644 index 0000000..66849a8 --- /dev/null +++ b/test/uk/gov/hmrc/currencyconversion/repositories/ExchangeRateRepositorySpec.scala @@ -0,0 +1,39 @@ +/* + * Copyright 2019 HM Revenue & Customs + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package uk.gov.hmrc.currencyconversion.repositories + +import java.io.File +import java.time.LocalDate + +import org.scalatest.Inspectors._ +import org.scalatest.{Matchers, WordSpec} + +class ExchangeRateRepositorySpec extends WordSpec with Matchers { + + "the rates files stored in memory" should { + + "all have the correct format file name" in { + + val fileNames = new File(getClass.getResource("/resources/xml/").toURI).list().toList + + forAll(fileNames) { fileName => + fileName should fullyMatch regex """exrates-monthly-\d{4}.xml""" + } + } + } +} +