Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ jobs:
- name: Build with Maven
run: mvn clean verify

- name: Upload codecov report
uses: codecov/codecov-action@v3
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
20 changes: 4 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@
</dependency>
</dependencies>

<distributionManagement>
<snapshotRepository>
<id>repo-bridge</id>
<url>https://repositorio.bridge.ufsc.br/repository/snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>

<build>
<plugins>
Expand Down Expand Up @@ -216,14 +206,12 @@
<!-- Release -->

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.9.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class CnsRule implements Rule<String> {

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)) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/script/rules/cns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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));
Expand All @@ -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));
Expand Down