From d46eebe0beaed3e49e52a5eb8efbd2973d95d6a8 Mon Sep 17 00:00:00 2001 From: Lucas Brand Date: Mon, 17 Nov 2025 14:01:43 -0300 Subject: [PATCH 1/4] =?UTF-8?q?feat:=20cns=20agora=20pode=20come=C3=A7ar?= =?UTF-8?q?=20com=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../br/ufsc/bridge/platform/validation/rules/CnsRule.java | 2 +- src/main/script/rules/cns.ts | 2 +- .../br/ufsc/bridge/platform/validation/rules/CnsTest.java | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/br/ufsc/bridge/platform/validation/rules/CnsRule.java b/src/main/java/br/ufsc/bridge/platform/validation/rules/CnsRule.java index f95a6ce..8045531 100644 --- a/src/main/java/br/ufsc/bridge/platform/validation/rules/CnsRule.java +++ b/src/main/java/br/ufsc/bridge/platform/validation/rules/CnsRule.java @@ -6,7 +6,7 @@ public class CnsRule implements Rule { private final static String CNS1 = "^[1-2][0-9]{10}00[0-1][0-9]$"; - private final static String CNS2 = "^[7-9][0-9]{14}$"; + private final static String CNS2 = "^[57-9][0-9]{14}$"; @Override public String validate(String value) { if (!Util.isEmpty(value) && !this.isValid(value)) { diff --git a/src/main/script/rules/cns.ts b/src/main/script/rules/cns.ts index 95f7593..cbfc70c 100644 --- a/src/main/script/rules/cns.ts +++ b/src/main/script/rules/cns.ts @@ -3,7 +3,7 @@ import { msg } from '..' import { length } from './length' const CNS1 = '^[1-2][0-9]{10}00[0-1][0-9]$' -const CNS2 = '^[7-9][0-9]{14}$' +const CNS2 = '^[57-9][0-9]{14}$' function somaPonderada(cnsValue: string) { let soma = 0 diff --git a/src/test/java/br/ufsc/bridge/platform/validation/rules/CnsTest.java b/src/test/java/br/ufsc/bridge/platform/validation/rules/CnsTest.java index 7fb355c..35eebc7 100644 --- a/src/test/java/br/ufsc/bridge/platform/validation/rules/CnsTest.java +++ b/src/test/java/br/ufsc/bridge/platform/validation/rules/CnsTest.java @@ -18,6 +18,8 @@ public void testarRequired() { public void testarValorDeCns() { Assert.assertNull("975055825130003 é um Cns válido", this.validate("975055825130003", Rules.cns)); + Assert.assertNull("586309087428878 é um Cns válido", this.validate("586309087428878", Rules.cns)); + Assert.assertNull("118725165660004 é um Cns válido", this.validate("118725165660004", Rules.cns)); Assert.assertNull("218342347130008 é um Cns válido", this.validate("218342347130008", Rules.cns)); @@ -30,6 +32,8 @@ public void testarValorDeCns() { Assert.assertNotNull("O Cns é invalido", this.validate("109878998754646", Rules.cns)); + Assert.assertNotNull("O Cns é invalido", this.validate("594516874912612", Rules.cns)); + Assert.assertNotNull("O Cns é invalido", this.validate("236951545487965", Rules.cns)); Assert.assertNotNull("O Cns é invalido", this.validate("478976532213336", Rules.cns)); @@ -46,8 +50,6 @@ public void testarValorDeCns() { Assert.assertNotNull("O Cns não pode comeaçar com 4", this.validate("431439904710009", Rules.cns)); - Assert.assertNotNull("O Cns não pode comeaçar com 5", this.validate("562593396660002", Rules.cns)); - Assert.assertNotNull("O Cns não pode comeaçar com 6", this.validate("667429114440003", Rules.cns)); Assert.assertNotNull("111111111111111 não é um Cns válido", this.validate("111111111111111", Rules.cns)); From 9924ebdca43047f9be2052c27cf97f208c07d4cc Mon Sep 17 00:00:00 2001 From: Lucas Brand Date: Wed, 19 Nov 2025 14:21:20 -0300 Subject: [PATCH 2/4] fix: versao do uses do action/cache --- .github/workflows/maven.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index e80bc24..440f614 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,7 +21,7 @@ jobs: distribution: 'zulu' - name: Cache local Maven repository - uses: actions/cache@v2.1.6 + uses: actions/cache@v3 with: path: ~/.m2/ key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml') }} From 8aac5f3077147813ef1a19361e9cc70e04249d34 Mon Sep 17 00:00:00 2001 From: Matheus Dias <1726247+matheusdias@users.noreply.github.com> Date: Mon, 24 Nov 2025 14:58:00 -0300 Subject: [PATCH 3/4] Update Codecov action in Maven workflow --- .github/workflows/maven.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 440f614..a04f541 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,5 +29,8 @@ jobs: - name: Build with Maven run: mvn clean verify - - name: Upload codecov report - uses: codecov/codecov-action@v1.5.2 + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 668fe39e9caf9e0804a51fc1f6699727d3497e65 Mon Sep 17 00:00:00 2001 From: Matheus Dias <1726247+matheusdias@users.noreply.github.com> Date: Mon, 24 Nov 2025 17:06:31 -0300 Subject: [PATCH 4/4] Update Codecov action in Maven workflow --- .github/workflows/maven.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index a04f541..8a642c2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -29,8 +29,7 @@ jobs: - name: Build with Maven run: mvn clean verify - - name: Upload test results to Codecov - if: ${{ !cancelled() }} - uses: codecov/test-results-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}