Skip to content

Commit

Permalink
fix: resolve conflicts and fix tests
Browse files Browse the repository at this point in the history
Resolved merge conflicts with upstream branch and fixed issues in the test cases.
  • Loading branch information
Jeronimo-MZ committed Jul 30, 2024
2 parents 7b047ec + fce3f8c commit 14b0499
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 36 deletions.
65 changes: 35 additions & 30 deletions src/main/java/org/iban4j/bban/BbanStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,63 +333,68 @@ public class BbanStructure {
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(13, 'c')));

structures.put(
CountryCode.MA,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(16, 'n')));

structures.put(
CountryCode.MC,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'c'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MD,
new BbanStructure(
BbanStructureEntry.bankCode(2, 'c'), BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.ME,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.accountNumber(13, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MK,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.accountNumber(10, 'c'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MR,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MT,
new BbanStructure(
BbanStructureEntry.bankCode(4, 'a'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.MR,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MU,
new BbanStructure(
BbanStructureEntry.bankCode(6, 'c'),
BbanStructureEntry.branchCode(2, 'n'),
BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.MD,
new BbanStructure(
BbanStructureEntry.bankCode(2, 'c'), BbanStructureEntry.accountNumber(18, 'c')));

structures.put(
CountryCode.MC,
new BbanStructure(
BbanStructureEntry.bankCode(5, 'n'),
BbanStructureEntry.branchCode(5, 'n'),
BbanStructureEntry.accountNumber(11, 'c'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.ME,
new BbanStructure(
BbanStructureEntry.bankCode(3, 'n'),
BbanStructureEntry.accountNumber(13, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.MZ,
new BbanStructure(
BbanStructureEntry.bankCode(4, 'n'),
BbanStructureEntry.branchCode(4, 'n'),
BbanStructureEntry.accountNumber(11, 'n'),
BbanStructureEntry.nationalCheckDigit(2, 'n')));

structures.put(
CountryCode.NL,
new BbanStructure(
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/org/iban4j/IbanTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,9 @@ public void ibanConstructionRandom() {
@Test
public void ibanConstructionSeeded() {
assertAll(
() -> assertIbanUtilRandomWithSeedEquals("GI33 XNNK KKDA PM6A HNQF XLK", 1),
() -> assertIbanUtilRandomWithSeedEquals("CZ17 0679 0988 8783 6940 3497", 2),
() -> assertIbanUtilRandomWithSeedEquals("NC29 0882 8280 41ER G8WO UQNL Y52", 3));
() -> assertIbanUtilRandomWithSeedEquals("BY38 LPL2 0836 1HJE NISJ S339 QZGT", 1),
() -> assertIbanUtilRandomWithSeedEquals("IE70 QKBB 0988 8722 1186 81", 2),
() -> assertIbanUtilRandomWithSeedEquals("MC38 0882 8280 41ER G8WO UQNL Y52", 3));
}

private void assertIbanUtilRandomWithSeedEquals(
Expand All @@ -321,9 +321,9 @@ private void assertIbanUtilRandomWithSeedEquals(
@Test
public void ibanBuilderConstructionSeeded() {
assertAll(
() -> assertIbanBuilderRandomWithSeedEquals("GI33 XNNK KKDA PM6A HNQF XLK", 1),
() -> assertIbanBuilderRandomWithSeedEquals("CZ17 0679 0988 8783 6940 3497", 2),
() -> assertIbanBuilderRandomWithSeedEquals("NC29 0882 8280 41ER G8WO UQNL Y52", 3));
() -> assertIbanBuilderRandomWithSeedEquals("BY38 LPL2 0836 1HJE NISJ S339 QZGT", 1),
() -> assertIbanBuilderRandomWithSeedEquals("IE70 QKBB 0988 8722 1186 81", 2),
() -> assertIbanBuilderRandomWithSeedEquals("MC38 0882 8280 41ER G8WO UQNL Y52", 3));
}

@Test
Expand Down
9 changes: 9 additions & 0 deletions src/test/java/org/iban4j/TestDataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,15 @@ public static Collection<Object[]> getIbanData() {
.build(),
"LU280019400644750000"
},
{
new Iban.Builder()
.countryCode(CountryCode.MA)
.bankCode("011")
.branchCode("51900")
.accountNumber("0001205000534921")
.build(),
"MA64011519000001205000534921"
},
{
new Iban.Builder()
.countryCode(CountryCode.MF)
Expand Down

0 comments on commit 14b0499

Please sign in to comment.