Skip to content

Commit

Permalink
ajustado tag cAut para permitir ate 128 caracteres (#1011)
Browse files Browse the repository at this point in the history
* ajustado tag cAut para permitir ate 128 caracteres

* corrigido teste unitario
  • Loading branch information
giovaneboeing authored Oct 14, 2024
1 parent 0471d50 commit 3af2694
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void setCnpj(final String cnpj) {
}

public void setNumeroAutorizacaoOperacaoCartao(final String numeroAutorizacaoOperacaoCartao) {
DFStringValidador.tamanho20(numeroAutorizacaoOperacaoCartao, "Numero Autorizacao Operacao Cartao");
DFStringValidador.tamanho128(numeroAutorizacaoOperacaoCartao, "Numero Autorizacao Operacao Cartao");
this.numeroAutorizacaoOperacaoCartao = numeroAutorizacaoOperacaoCartao;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,12 @@ public static void tamanho120(final String string, final String info) {
}
}

public static void tamanho128(final String string, final String info) {
if (string != null) {
DFStringValidador.validaTamanhoMaximo(string, 128, info);
}
}

public static void tamanho160(final String string, final String info) {
if (string != null) {
DFStringValidador.validaTamanhoMaximo(string, 160, info);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class NFNotaInfoCartaoTest {

@Test(expected = IllegalStateException.class)
public void naoDevePermitirNumeroAutorizacaoOperacaoCartaoComTamanhoInvalido() {
new NFNotaInfoCartao().setNumeroAutorizacaoOperacaoCartao("9ItpS1hBk3TyhjUB3I901");
new NFNotaInfoCartao().setNumeroAutorizacaoOperacaoCartao("9ItpS1hBk3TyhjUB3I9019ItpS1hBk3TyhjUB3I9019ItpS1hBk3TyhjUB3I9019ItpS1hBk3TyhjUB3I9019ItpS1hBk3TyhjUB3I9019ItpS1hBk3TyhjUB3I9019It");
}

@Test(expected = IllegalStateException.class)
Expand Down

0 comments on commit 3af2694

Please sign in to comment.