diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ed5f9..6577437 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ This new release includes : - Countries' participation to _European Union_ (#44). - Countries' participation to _Single Euro Payments Area_, also known as SEPA (#31). - Countries' participation to _SEPA COM Pacifique_ (#46). +- Countries' participation to _European Economic Area_ (#45). +- Countries' participation to _European Free Trade Association_ (#45). ### Changed - Adjust BBAN structure for Sao Tome and Principe (#36). diff --git a/README.md b/README.md index f2e4356..7df1cca 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,11 @@ jbanking is supporting the following features : numeric code and status - e.g. independent or dependent - according to the [International Organization for Standardization](https://www.iso.org)). * Countries' or territories' participation to economic agreements : + * [European Economic Area (EEA)](https://wikipedia.org/wiki/European_Economic_Area) + * [European Free Trade Association (EFTA)](https://wikipedia.org/wiki/European_Free_Trade_Association) * [European Union (EU)](https://en.wikipedia.org/wiki/European_Union) - * [Single Euro Payments Area (SEPA)](https://wikipedia.org/wiki/Single_Euro_Payments_Area) * [SEPA COM Pacifique](https://www.cfonb.org/Default.aspx?lid=1&rid=122&rvid=239) + * [Single Euro Payments Area (SEPA)](https://wikipedia.org/wiki/Single_Euro_Payments_Area) * [ISO 4217 currencies](http://wikipedia.org/wiki/ISO_4217) (with alphabetic code, numeric code, minor unit and countries using it). * [ISO 9362:2009 BIC](http://wikipedia.org/wiki/Bank_Identifier_Code) handling and validation. diff --git a/src/main/java/fr/marcwrobel/jbanking/Agreement.java b/src/main/java/fr/marcwrobel/jbanking/Agreement.java index fb0d684..d69d447 100644 --- a/src/main/java/fr/marcwrobel/jbanking/Agreement.java +++ b/src/main/java/fr/marcwrobel/jbanking/Agreement.java @@ -68,6 +68,71 @@ */ public enum Agreement { + /** + * The European Economic Area (EEA) was established via the Agreement on the European Economic + * Area, an international agreement which enables the extension of the European Union's single + * market to member states of the European Free Trade Association. + * + * <p>This enum was last updated on 2020-08-03 based on information given on <a + * href="https://wikipedia.org/wiki/European_Economic_Area">Wikipedia - European Economic + * Area</a>. + * + * @see <a + * href="https://ec.europa.eu/eurostat/statistics-explained/index.php/Glossary:European_Economic_Area_(EEA)">europa.eu + * - European Economic Area (EEA)</a> + * @see <a href="https://wikipedia.org/wiki/European_Economic_Area">Wikipedia - European Economic + * Area</a> + * @since 2.1.0 + */ + EUROPEAN_ECONOMIC_AREA( + AUSTRIA, + BELGIUM, + BULGARIA, + CROATIA, + CYPRUS, + CZECH_REPUBLIC, + DENMARK, + ESTONIA, + FINLAND, + FRANCE, + GERMANY, + GREECE, + HUNGARY, + ICELAND, + IRELAND, + ITALY, + LATVIA, + LIECHTENSTEIN, + LITHUANIA, + LUXEMBOURG, + MALTA, + NETHERLANDS, + NORWAY, + POLAND, + PORTUGAL, + ROMANIA, + SLOVAKIA, + SLOVENIA, + SPAIN, + SWEDEN, + SWITZERLAND), + + /** + * The European Free Trade Association (EFTA) is a regional trade organization and free trade + * area. The organization operates in parallel with the European Union (EU), and all member states + * participate in the European Single Market and are part of the Schengen Area. They are not, + * however, party to the European Union Customs Union. + * + * <p>This enum was last updated on 2020-08-03 based on information given on : <a + * href="https://www.efta.int/about-efta/the-efta-states">efta.int - The EFTA States</a>. + * + * @see <a href="https://www.efta.int/about-efta/the-efta-states">efta.int - The EFTA States</a> + * @see <a href="https://wikipedia.org/wiki/European_Free_Trade_Association">Wikipedia - European + * Free Trade Association</a> + * @since 2.1.0 + */ + EUROPEAN_FREE_TRADE_ASSOCIATION(ICELAND, LIECHTENSTEIN, NORWAY, SWITZERLAND), + /** * The European Union (EU) is a political and economic union of states that are located primarily * in Europe. The EU has developed an internal single market through a standardised system of laws @@ -78,8 +143,8 @@ public enum Agreement { * href="https://wikipedia.org/wiki/Special_member_state_territories_and_the_European_Union"> * Special member state territories</a> are not listed in this enum. * - * <p>This enum was last updated on 2020-07-31 based on information given in the europa.eu article - * <a href="https://europa.eu/european-union/about-eu/countries_en">Countries</a>. + * <p>This enum was last updated on 2020-07-31 based on information given on <a + * href="https://europa.eu/european-union/about-eu/countries_en">europa.eu - Countries</a>. * * @see <a href="https://europa.eu/european-union/about-eu/countries_en">europa.eu - Countries</a> * @see <a href="https://wikipedia.org/wiki/European_Union">Wikipedia - European Union</a> diff --git a/src/test/java/fr/marcwrobel/jbanking/AgreementTest.java b/src/test/java/fr/marcwrobel/jbanking/AgreementTest.java index b7d518b..fa30795 100644 --- a/src/test/java/fr/marcwrobel/jbanking/AgreementTest.java +++ b/src/test/java/fr/marcwrobel/jbanking/AgreementTest.java @@ -1,5 +1,10 @@ package fr.marcwrobel.jbanking; +import static fr.marcwrobel.jbanking.Agreement.EUROPEAN_ECONOMIC_AREA; +import static fr.marcwrobel.jbanking.Agreement.EUROPEAN_FREE_TRADE_ASSOCIATION; +import static fr.marcwrobel.jbanking.Agreement.EUROPEAN_UNION; +import static fr.marcwrobel.jbanking.Agreement.SEPA_COM_PACIFIQUE; +import static fr.marcwrobel.jbanking.Agreement.SINGLE_EURO_PAYMENTS_AREA; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -24,15 +29,29 @@ void ensureConsistency() { @Test void sepaComPacifiqueParticipantsAreNotSingleEuroPaymentAreaParticipants() { - for (IsoCountry participant : Agreement.SEPA_COM_PACIFIQUE.getParticipants()) { - assertFalse(participant.isParticipatingTo(Agreement.SINGLE_EURO_PAYMENTS_AREA)); + for (IsoCountry participant : SEPA_COM_PACIFIQUE.getParticipants()) { + assertFalse(participant.isParticipatingTo(SINGLE_EURO_PAYMENTS_AREA), participant::name); } } @Test void europeanUnionParticipantsAreAlsoSingleEuroPaymentAreaParticipants() { - for (IsoCountry participant : Agreement.EUROPEAN_UNION.getParticipants()) { - assertTrue(participant.isParticipatingTo(Agreement.SINGLE_EURO_PAYMENTS_AREA)); + for (IsoCountry participant : EUROPEAN_UNION.getParticipants()) { + assertTrue(participant.isParticipatingTo(SINGLE_EURO_PAYMENTS_AREA), participant::name); + } + } + + @Test + void europeanUnionParticipantsAreEuropeanEconomicAreaParticipants() { + for (IsoCountry participant : EUROPEAN_UNION.getParticipants()) { + assertTrue(participant.isParticipatingTo(EUROPEAN_ECONOMIC_AREA), participant::name); + } + } + + @Test + void europeanFreeTradeAssociationParticipantsAreEuropeanEconomicAreaParticipants() { + for (IsoCountry participant : EUROPEAN_FREE_TRADE_ASSOCIATION.getParticipants()) { + assertTrue(participant.isParticipatingTo(EUROPEAN_ECONOMIC_AREA), participant::name); } } }