diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index f002ec949..2f4388b96 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,7 +4,7 @@ on: push: branches: [ "main", "CU-*", "SRU*" ] pull_request: - branches: [ "main", "SRU*" ] + branches: [ "main" ] schedule: - cron: "59 12 * * 2" diff --git a/CHANGELOG.md b/CHANGELOG.md index 70037e0a4..d1787fb04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Prowide Core - CHANGELOG #### 9.5.2 - SNAPSHOT - * Added new FieldEnum with all the available field names + * Added new `FieldEnum` with all the available field names #### 9.5.1 - June 2024 * (PW-1913) Added IBAN validation for Egypt local account structure diff --git a/src/generated/java/com/prowidesoftware/swift/model/field/FieldEnum.java b/src/generated/java/com/prowidesoftware/swift/model/field/FieldEnum.java index 5b8655553..b92fae492 100644 --- a/src/generated/java/com/prowidesoftware/swift/model/field/FieldEnum.java +++ b/src/generated/java/com/prowidesoftware/swift/model/field/FieldEnum.java @@ -61,9 +61,6 @@ public enum FieldEnum { F14N, F14O, F14J, - F14P, - F14Q, - F14R, F14S, F15A, F15B, @@ -83,10 +80,8 @@ public enum FieldEnum { F15P, F16A, F16C, - F16D, F16R, F16S, - F16W, F17A, F17B, F17C, @@ -147,6 +142,7 @@ public enum FieldEnum { F22F, F22G, F22H, + F22J, F22K, F22L, F22M, @@ -208,6 +204,7 @@ public enum FieldEnum { F29H, F29I, F29J, + F29K, F29L, F29M, F29N, @@ -216,14 +213,11 @@ public enum FieldEnum { F29S, F29T, F29U, - F29Q, - F29W, F30F, F30G, F30H, F30I, F30J, - F30K, F30M, F30N, F30P, @@ -326,7 +320,9 @@ public enum FieldEnum { F37L, F37M, F37N, + F37P, F37R, + F37U, F37V, F38A, F38D, @@ -337,6 +333,7 @@ public enum FieldEnum { F39A, F39B, F39C, + F39D, F39E, F39F, F39M, @@ -363,6 +360,7 @@ public enum FieldEnum { F44D, F44E, F44F, + F44H, F44J, F45A, F45B, diff --git a/src/test/java/com/prowidesoftware/swift/model/field/FieldEnumTest.java b/src/test/java/com/prowidesoftware/swift/model/field/FieldEnumTest.java index 389a7384e..153dea682 100644 --- a/src/test/java/com/prowidesoftware/swift/model/field/FieldEnumTest.java +++ b/src/test/java/com/prowidesoftware/swift/model/field/FieldEnumTest.java @@ -3,23 +3,21 @@ import static org.junit.jupiter.api.Assertions.*; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; -class FieldEnumTest { +class FieldEnu5mTest { - @Test - void testfieldName() { - // Validate that fieldName returns the correct value - assertEquals("11A", FieldEnum.F11A.fieldName()); - assertEquals("14P", FieldEnum.F14P.fieldName()); - assertEquals("30K", FieldEnum.F30K.fieldName()); + @ParameterizedTest + @CsvSource({"F11A,11A", "F22J,22J", "F44H,44H"}) + void testFieldName(FieldEnum field, String expectedName) { + assertEquals(expectedName, field.fieldName()); } - @Test - void testfromFieldNameValid() { - // Validate that fromFieldName returns the correct enum when a valid code is provided - assertEquals(FieldEnum.F11A, FieldEnum.fromFieldName("11A")); - assertEquals(FieldEnum.F14R, FieldEnum.fromFieldName("14R")); - assertEquals(FieldEnum.F30K, FieldEnum.fromFieldName("30K")); + @ParameterizedTest + @CsvSource({"11A,F11A", "22J,F22J", "44H,F44H"}) + void testFromFieldNameValid(String fieldName, FieldEnum expectedEnum) { + assertEquals(expectedEnum, FieldEnum.fromFieldName(fieldName)); } @Test @@ -36,6 +34,9 @@ void testfromFieldNameEdgeCases() { assertNull(FieldEnum.fromFieldName("11a")); // should return null because "11a" is lowercase assertNull(FieldEnum.fromFieldName(" 11A")); // should return null because of the leading space assertNull(FieldEnum.fromFieldName("11A ")); // should return null because of the trailing space + assertNull(FieldEnum.fromFieldName(null)); // Test null input + assertNull(FieldEnum.fromFieldName("11")); // Test partial field name + assertNull(FieldEnum.fromFieldName("111A")); // Test invalid format with correct length } @Test