Skip to content

Commit

Permalink
Make countries' participation to European Economic Area and European …
Browse files Browse the repository at this point in the history
…Free Trade Association available (closes #45)
  • Loading branch information
marcwrobel committed Aug 3, 2020
1 parent de512fe commit f8381d3
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
69 changes: 67 additions & 2 deletions src/main/java/fr/marcwrobel/jbanking/Agreement.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand Down
27 changes: 23 additions & 4 deletions src/test/java/fr/marcwrobel/jbanking/AgreementTest.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
}
}
}

0 comments on commit f8381d3

Please sign in to comment.