diff --git a/src/main/java/com/fincatto/nfe310/validadores/BigDecimalParser.java b/src/main/java/com/fincatto/nfe310/validadores/BigDecimalParser.java index a970baf62..c8738fff4 100755 --- a/src/main/java/com/fincatto/nfe310/validadores/BigDecimalParser.java +++ b/src/main/java/com/fincatto/nfe310/validadores/BigDecimalParser.java @@ -64,7 +64,7 @@ public static String tamanho4Com2CasasDecimais(final BigDecimal valor) { private static String parse(BigDecimal valor, final String formato, final int tamanho, final int posicaoPontoFlutuante) { if (valor.toPlainString().length() > tamanho || StringUtils.split(valor.toPlainString(), ".")[0].length() > (tamanho - (posicaoPontoFlutuante + 1)) || valor.scale() > posicaoPontoFlutuante) { - throw new IllegalStateException("Valor extrapolou o tamanho de casas"); + throw new NumberFormatException("Valor extrapolou o tamanho de casas"); } valor = valor.round(new MathContext(valor.precision(), RoundingMode.UNNECESSARY)); return new DecimalFormat(formato, DecimalFormatSymbols.getInstance(Locale.US)).format(valor); diff --git a/src/main/java/com/fincatto/nfe310/validadores/BigIntegerValidador.java b/src/main/java/com/fincatto/nfe310/validadores/BigIntegerValidador.java index ce6794423..5a3904a0c 100755 --- a/src/main/java/com/fincatto/nfe310/validadores/BigIntegerValidador.java +++ b/src/main/java/com/fincatto/nfe310/validadores/BigIntegerValidador.java @@ -6,13 +6,13 @@ public class BigIntegerValidador { public static void tamanho12(final BigInteger valor) { if (valor.compareTo(new BigInteger("999999999999")) > 0) { - throw new IllegalStateException("Tamanho maior que 12"); + throw new NumberFormatException("Tamanho maior que 12"); } } public static void tamanho11(final BigInteger valor) { if (valor.compareTo(new BigInteger("99999999999")) > 0) { - throw new IllegalStateException("Tamanho maior que 11"); + throw new NumberFormatException("Tamanho maior que 11"); } } } \ No newline at end of file diff --git a/src/main/java/com/fincatto/nfe310/validadores/IntegerValidador.java b/src/main/java/com/fincatto/nfe310/validadores/IntegerValidador.java index d5d2c82f1..bbcc4cdd4 100755 --- a/src/main/java/com/fincatto/nfe310/validadores/IntegerValidador.java +++ b/src/main/java/com/fincatto/nfe310/validadores/IntegerValidador.java @@ -73,13 +73,13 @@ public static void exatamente2(final Integer valor) { private static void limite(final Integer valor, final int maximo) { if (valor > maximo) { - throw new IllegalStateException("Valor extrapolou o tamanho do campo"); + throw new NumberFormatException("Valor extrapolou o tamanho do campo"); } } private static void intervalo(final Integer valor, final int minimo, final int maximo) { if (valor < minimo || valor > maximo) { - throw new IllegalStateException(MessageFormat.format("Valor tem tamanho fora do intervalo de [{0}-{1}]", minimo, maximo)); + throw new NumberFormatException(MessageFormat.format("Valor tem tamanho fora do intervalo de [{0}-{1}]", minimo, maximo)); } } } \ No newline at end of file diff --git a/src/test/java/com/fincatto/nfe310/classes/inutilizacao/NFEventoCancelamentoDadosTest.java b/src/test/java/com/fincatto/nfe310/classes/inutilizacao/NFEventoCancelamentoDadosTest.java index 320638875..67fea4d01 100644 --- a/src/test/java/com/fincatto/nfe310/classes/inutilizacao/NFEventoCancelamentoDadosTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/inutilizacao/NFEventoCancelamentoDadosTest.java @@ -32,12 +32,12 @@ public void naoDevePermitirCNPJInvalido() { dados.setCnpj("1234567890123"); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirAnoDiferenteDeDuasCasas() { final NFEventoCancelamentoDados dados = new NFEventoCancelamentoDados(); try { dados.setAno(9); - } catch (final IllegalStateException e) { + } catch (final NumberFormatException e) { dados.setAno(100); } } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoModelo1Por1AReferenciadaTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoModelo1Por1AReferenciadaTest.java index 11d22a608..111dcb18c 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoModelo1Por1AReferenciadaTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoModelo1Por1AReferenciadaTest.java @@ -5,7 +5,6 @@ import com.fincatto.nfe310.FabricaDeObjetosFake; import com.fincatto.nfe310.classes.NFUnidadeFederativa; -import com.fincatto.nfe310.classes.nota.NFInfoModelo1Por1AReferenciada; public class NFInfoModelo1Por1AReferenciadaTest { @@ -32,7 +31,7 @@ public void naoDevePermitirNumeroDocumentoFiscalComTamanhoInvalido() { new NFInfoModelo1Por1AReferenciada().setNumeroDocumentoFiscal("1000000000"); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirSerieComTamanhoInvalido() { new NFInfoModelo1Por1AReferenciada().setSerie(1000); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoProdutorRuralReferenciadaTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoProdutorRuralReferenciadaTest.java index 0d7dac609..850d2f2e1 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoProdutorRuralReferenciadaTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFInfoProdutorRuralReferenciadaTest.java @@ -4,7 +4,6 @@ import org.junit.Test; import com.fincatto.nfe310.classes.NFUnidadeFederativa; -import com.fincatto.nfe310.classes.nota.NFInfoProdutorRuralReferenciada; public class NFInfoProdutorRuralReferenciadaTest { @@ -26,12 +25,12 @@ public void naoDevePermitirCPFComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirSerieDocumentoFiscalComTamanhoInvalido() { new NFInfoProdutorRuralReferenciada().setSerieDocumentoFiscal(1000); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirNumeroDocumentoFiscalComTamanhoInvalido() { new NFInfoProdutorRuralReferenciada().setNumeroDocumentoFiscal(1000000); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFInformacaoImpostoDevolvidoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFInformacaoImpostoDevolvidoTest.java index 9d384c4d8..6bc6e251b 100644 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFInformacaoImpostoDevolvidoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFInformacaoImpostoDevolvidoTest.java @@ -12,7 +12,7 @@ public void naoDevePermitirValorIPINulo() { new NFInformacaoImpostoDevolvido().toString(); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorIPIInvalido() { final NFInformacaoImpostoDevolvido informacaoImpostoDevolvido = new NFInformacaoImpostoDevolvido(); informacaoImpostoDevolvido.setValorIPIDevolvido(new BigDecimal("10000000000000.00")); diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoAvulsaTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoAvulsaTest.java index cc50128cb..9fa8f4a01 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoAvulsaTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoAvulsaTest.java @@ -74,7 +74,7 @@ public void naoDevePermitirReparticaoFiscalEmitenteComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalConstanteDocumentoArrecadacaoReceitaComTamanhoInvalido() { new NFNotaInfoAvulsa().setValorTotalConstanteDocumentoArrecadacaoReceita(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotalTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotalTest.java index bd7c8f589..801e29335 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotalTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotalTest.java @@ -6,81 +6,80 @@ import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoICMSTotal; public class NFNotaInfoICMSTotalTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalTributosInvalido() { new NFNotaInfoICMSTotal().setValorTotalTributos(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalSeguroInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalSeguro(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalNFeInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalNFe(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalIPIInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalIPI(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalIIInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalII(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalICMSSTInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalICMSST(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalICMSInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalICMS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalFreteInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalFrete(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalDosProdutosServicosInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalDosProdutosServicos(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalDescontoInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorTotalDesconto(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorPISInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorPIS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorCOFINSInvalidoMonetario() { new NFNotaInfoICMSTotal().setValorCOFINS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorInvalidoMonetario() { new NFNotaInfoICMSTotal().setValor(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirOutrasDespesasAcessoriasInvalidoMonetario() { new NFNotaInfoICMSTotal().setOutrasDespesasAcessorias(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirBaseCalculoICMSInvalidoMonetario() { new NFNotaInfoICMSTotal().setBaseCalculoICMS(new BigDecimal("1000000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoISSQNTotalTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoISSQNTotalTest.java index bfa4d219d..247d5632e 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoISSQNTotalTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoISSQNTotalTest.java @@ -7,32 +7,30 @@ import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoISSQNTotal; -import com.fincatto.nfe310.classes.nota.NFNotaInfoRegimeEspecialTributacao; public class NFNotaInfoISSQNTotalTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalServicosSobNaoIncidenciaNaoTributadosICMSComValorInvalido() { new NFNotaInfoISSQNTotal().setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalISSComValorInvalido() { new NFNotaInfoISSQNTotal().setValorTotalISS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorPISsobreServicosInvalido() { new NFNotaInfoISSQNTotal().setValorPISsobreServicos(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorCOFINSsobreServicosInvalido() { new NFNotaInfoISSQNTotal().setValorCOFINSsobreServicos(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirCalculoINSSComValorInvalido() { new NFNotaInfoISSQNTotal().setValorTotalISS(new BigDecimal("1000000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoIdentificacaoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoIdentificacaoTest.java index c2b0443ab..ff475c030 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoIdentificacaoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoIdentificacaoTest.java @@ -17,11 +17,6 @@ import com.fincatto.nfe310.classes.NFTipoEmissao; import com.fincatto.nfe310.classes.NFTipoImpressao; import com.fincatto.nfe310.classes.NFUnidadeFederativa; -import com.fincatto.nfe310.classes.nota.NFIdentificadorLocalDestinoOperacao; -import com.fincatto.nfe310.classes.nota.NFIndicadorPresencaComprador; -import com.fincatto.nfe310.classes.nota.NFInfoReferenciada; -import com.fincatto.nfe310.classes.nota.NFNotaInfoIdentificacao; -import com.fincatto.nfe310.classes.nota.NFOperacaoConsumidorFinal; public class NFNotaInfoIdentificacaoTest { @@ -89,7 +84,7 @@ public void naoDevePermitirModeloComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirDigitoVerificadorComTamanhoInvalido() { new NFNotaInfoIdentificacao().setDigitoVerificador(10); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemDetalheExportacaoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemDetalheExportacaoTest.java index 54bd88370..93f1e983c 100644 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemDetalheExportacaoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemDetalheExportacaoTest.java @@ -6,11 +6,10 @@ import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemDetalheExportacao; public class NFNotaInfoItemDetalheExportacaoTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirNumeroAtoConcessorioDrawbackComTamanhoInvalido() { new NFNotaInfoItemDetalheExportacao().setNumeroAtoConcessorioDrawback(new BigInteger("100000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemExportacaoIndiretaTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemExportacaoIndiretaTest.java index b982df621..efcc48e88 100644 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemExportacaoIndiretaTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemExportacaoIndiretaTest.java @@ -10,12 +10,12 @@ public class NFNotaInfoItemExportacaoIndiretaTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirNumeroRegistroExportacaoComTamanhoInvalido() { new NFNotaInfoItemExportacaoIndireta().setNumeroRegistroExportacao(new BigInteger("1000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeIemEfetivamenteExportadoComTamanhoInvalido() { new NFNotaInfoItemExportacaoIndireta().setQuantidadeItemEfetivamenteExportado(new BigDecimal("100000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSAliquotaTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSAliquotaTest.java index 7bf42f660..e5a74c610 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSAliquotaTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSAliquotaTest.java @@ -10,17 +10,17 @@ public class NFNotaInfoItemImpostoCOFINSAliquotaTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSAliquota().setValor(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCaluloTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSAliquota().setValorBaseCalulo(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSAliquota().setPercentualAliquota(new BigDecimal("1000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSOutrasOperacoesTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSOutrasOperacoesTest.java index 7d0b46558..194b22062 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSOutrasOperacoesTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSOutrasOperacoesTest.java @@ -10,27 +10,27 @@ public class NFNotaInfoItemImpostoCOFINSOutrasOperacoesTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualCOFINSComTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSOutrasOperacoes().setPercentualCOFINS(new BigDecimal("999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoComTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSOutrasOperacoes().setValorBaseCalculo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeVendidaComTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSOutrasOperacoes().setQuantidadeVendida(new BigDecimal("9999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorCOFINSComTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSOutrasOperacoes().setValorCOFINS(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoCOFINSOutrasOperacoes().setValorAliquota(new BigDecimal("999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSSTTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSSTTest.java index 127f7ba92..73f59e53d 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSSTTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoCOFINSSTTest.java @@ -9,27 +9,27 @@ public class NFNotaInfoItemImpostoCOFINSSTTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorCOFINSForaoDoLimite() { new NFNotaInfoItemImpostoCOFINSST().setValorCOFINS(new BigDecimal("99999999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorAliquotaCOFINSForaoDoLimite() { new NFNotaInfoItemImpostoCOFINSST().setValorAliquotaCOFINS(new BigDecimal("99999999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeVendidaForaDoLimite() { new NFNotaInfoItemImpostoCOFINSST().setQuantidadeVendida(new BigDecimal("999999999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorPercentualAliquotaCOFINSForaDoLimite() { new NFNotaInfoItemImpostoCOFINSST().setPercentualAliquota(new BigDecimal("1000.01")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoForaDoLimite() { new NFNotaInfoItemImpostoCOFINSST().setValorBaseCalculo(new BigDecimal("99999999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS00Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS00Test.java index 1b3c60f06..26701f293 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS00Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS00Test.java @@ -12,17 +12,17 @@ public class NFNotaInfoItemImpostoICMS00Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS00().setPercentualAliquota(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS00().setValorBaseCalculo(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS00().setValorTributo(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS10Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS10Test.java index 031781b01..e870f0a2f 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS10Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS10Test.java @@ -12,42 +12,42 @@ public class NFNotaInfoItemImpostoICMS10Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setPercentualAliquota(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setPercentualMargemValorICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setValorBaseCalculo(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirBCICMSSTTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setValorBCICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setValorICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS10().setValorTributo(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS20Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS20Test.java index f4f1bb386..25e9e9fc6 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS20Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS20Test.java @@ -12,22 +12,22 @@ public class NFNotaInfoItemImpostoICMS20Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS20().setPercentualAliquota(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS20().setPercentualReducaoBC(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS20().setValorBCICMS(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS20().setValorTributo(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS30Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS30Test.java index dc07f6eb2..a5c68e3d1 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS30Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS30Test.java @@ -12,27 +12,27 @@ public class NFNotaInfoItemImpostoICMS30Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS30().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorAdicionadoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS30().setPercentualMargemValorAdicionadoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS30().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS30().setValorBCICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS30().setValorImpostoICMSST(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS40Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS40Test.java index b1a6c787d..34ea0df04 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS40Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS40Test.java @@ -11,7 +11,7 @@ public class NFNotaInfoItemImpostoICMS40Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS40().setValorICMSDesoneracao(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS51Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS51Test.java index 3b821f9f6..d134d9134 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS51Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS51Test.java @@ -11,22 +11,22 @@ public class NFNotaInfoItemImpostoICMS51Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualICMSComTamanhoDiferente() { new NFNotaInfoItemImpostoICMS51().setPercentualICMS(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCComTamanhoDiferente() { new NFNotaInfoItemImpostoICMS51().setPercentualReducaoBC(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSComTamanhoDiferente() { new NFNotaInfoItemImpostoICMS51().setValorBCICMS(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSComTamanhoDiferente() { new NFNotaInfoItemImpostoICMS51().setValorICMS(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS60Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS60Test.java index 639ce5b7f..e4a10bdf9 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS60Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS60Test.java @@ -10,12 +10,12 @@ public class NFNotaInfoItemImpostoICMS60Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTRetidoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS60().setValorBCICMSSTRetido(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTRetidoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS60().setValorICMSSTRetido(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS70Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS70Test.java index 3361c115a..0bdd6178e 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS70Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS70Test.java @@ -13,47 +13,47 @@ public class NFNotaInfoItemImpostoICMS70Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setPercentualAliquota(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorAdicionadoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setPercentualMargemValorAdicionadoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setPercentualReducaoBC(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setValorBC(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setValorBCST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setValorICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMS70().setValorTributo(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS90Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS90Test.java index 4516f8cef..61a18e654 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS90Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMS90Test.java @@ -13,47 +13,47 @@ public class NFNotaInfoItemImpostoICMS90Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquota() { new NFNotaInfoItemImpostoICMS90().setPercentualAliquota(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoICMSST() { new NFNotaInfoItemImpostoICMS90().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorAdicionadoICMSST() { new NFNotaInfoItemImpostoICMS90().setPercentualMargemValorAdicionadoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBC() { new NFNotaInfoItemImpostoICMS90().setPercentualReducaoBC(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSST() { new NFNotaInfoItemImpostoICMS90().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCTamanhoInvalido() { new NFNotaInfoItemImpostoICMS90().setValorBC(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCSTTamanhoInvalido() { new NFNotaInfoItemImpostoICMS90().setValorBCST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTTamanhoInvalido() { new NFNotaInfoItemImpostoICMS90().setValorICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTributoTamanhoInvalido() { new NFNotaInfoItemImpostoICMS90().setValorTributo(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSPartilhadoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSPartilhadoTest.java index e4a51cb64..9edfc3309 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSPartilhadoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSPartilhadoTest.java @@ -13,52 +13,52 @@ public class NFNotaInfoItemImpostoICMSPartilhadoTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setPercentualAliquotaImposto(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualBCOperacaoPropriaComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setPercentualBCOperacaoPropria(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorAdicionadoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setPercentualMargemValorAdicionadoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setPercentualReducaoBC(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setValorBCICMS(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setValorBCICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setValorICMS(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSPartilhado().setValorICMSST(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN101Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN101Test.java index c0349d334..2050f4a1f 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN101Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN101Test.java @@ -10,12 +10,12 @@ public class NFNotaInfoItemImpostoICMSSN101Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaAplicavelCalculoCreditoSNComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN101().setPercentualAliquotaAplicavelCalculoCreditoSN(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorCreditoICMSSNComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN101().setValorCreditoICMSSN(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN201Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN201Test.java index b99a47161..f51b49f06 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN201Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN201Test.java @@ -11,37 +11,37 @@ public class NFNotaInfoItemImpostoICMSSN201Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaAplicavelCalculoCreditoSNComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN201().setPercentualAliquotaAplicavelCalculoCreditoSN(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN201().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorAdicionadoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN201().setPercentualMargemValorAdicionadoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN201().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN201().setValorBCICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorCreditoICMSSNComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN201().setValorCreditoICMSSN(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN201().setValorICMSST(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN202Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN202Test.java index 50687eec3..49725c9a9 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN202Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN202Test.java @@ -11,27 +11,27 @@ public class NFNotaInfoItemImpostoICMSSN202Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN202().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorAdicionadoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN202().setPercentualMargemValorAdicionadoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN202().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN202().setValorBCICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICSMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN202().setValorICMSST(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN500Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN500Test.java index 5e85b5047..051f8994f 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN500Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN500Test.java @@ -10,12 +10,12 @@ public class NFNotaInfoItemImpostoICMSSN500Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTRetidoTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN500().setValorICMSSTRetido(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTRetidoTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN500().setValorBCICMSSTRetido(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java index d8844e0be..002c60273 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java @@ -12,57 +12,57 @@ public class NFNotaInfoItemImpostoICMSSN900Test { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirAliquotaAplicavelCalculoCreditoSNComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setAliquotaAplicavelCalculoCreditoSN(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirAliquotaImpostoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setPercentualAliquotaImpostoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaImpostoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setPercentualAliquotaImposto(new BigDecimal("10000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualMargemValorAdicionadoICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setPercentualMargemValorAdicionadoICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setPercentualReducaoBC(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualReducaoBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setPercentualReducaoBCICMSST(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setValorBCICMS(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setValorBCICMSST(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorCreditoICMSSNComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setValorCreditoICMSSN(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setValorICMS(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSSN900().setValorICMSST(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSTTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSTTest.java index 62671a278..5e2b73d5e 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSTTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoICMSSTTest.java @@ -10,22 +10,22 @@ public class NFNotaInfoItemImpostoICMSSTTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTRetidoUFRemetenteComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSST().setValorBCICMSSTRetidoUFRemetente(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBCICMSSTUFDestinoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSST().setValorBCICMSSTUFDestino(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTRetidoUFRemetenteComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSST().setValorICMSSTRetidoUFRemetente(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSSTUFDestinoComTamanhoInvalido() { new NFNotaInfoItemImpostoICMSST().setValorICMSSTUFDestino(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITest.java index bdeca2df0..b579362bc 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITest.java @@ -6,7 +6,6 @@ import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoIPI; public class NFNotaInfoItemImpostoIPITest { @@ -25,7 +24,7 @@ public void naoDevePermitirCodigoSeloTamanhoInvalido() { new NFNotaInfoItemImpostoIPI().setCodigoSelo("iNEFifS1jexTxcCvgjlQ186nR6JAwM2koyjbWKA1DJSLmZy432GoSwoygXc51"); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeSeloTamanhoInvalido() { new NFNotaInfoItemImpostoIPI().setQuantidadeSelo(new BigInteger("1000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITributadoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITributadoTest.java index a6286e61e..4fcf8d168 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITributadoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoIPITributadoTest.java @@ -10,22 +10,22 @@ public class NFNotaInfoItemImpostoIPITributadoTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoIPITributado().setValorTributo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoIPITributado().setPercentualAliquota(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoComTamanhoInvalido() { new NFNotaInfoItemImpostoIPITributado().setValorBaseCalculo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeComTamanhoInvalido() { new NFNotaInfoItemImpostoIPITributado().setQuantidade(new BigDecimal("9999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoISSQNTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoISSQNTest.java index f6bcd1303..aac51e7e9 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoISSQNTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoISSQNTest.java @@ -6,9 +6,6 @@ import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoISSQN; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemIndicadorExigibilidadeISS; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemIndicadorIncentivoFiscal; public class NFNotaInfoItemImpostoISSQNTest { @@ -21,26 +18,26 @@ public void naoDevePermitirItemListaServicosComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirCodigoMunicipioComTamanhoInvalido() { try { new NFNotaInfoItemImpostoISSQN().setCodigoMunicipio(999999); - } catch (final IllegalStateException e) { + } catch (final NumberFormatException e) { new NFNotaInfoItemImpostoISSQN().setCodigoMunicipio(10000000); } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirAliquotaISSQNComTamanhoNulo() { new NFNotaInfoItemImpostoISSQN().setValorAliquota(new BigDecimal("100000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoComTamanhoInvalido() { new NFNotaInfoItemImpostoISSQN().setValorBaseCalculo(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorComTamanhoInvalido() { new NFNotaInfoItemImpostoISSQN().setValor(new BigDecimal("1000000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoImportacaoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoImportacaoTest.java index 7af6b5428..30f0e6ddb 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoImportacaoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoImportacaoTest.java @@ -9,22 +9,22 @@ public class NFNotaInfoItemImpostoImportacaoTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoInvalido() { new NFNotaInfoItemImpostoImportacao().setValorBaseCalculo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorDespesaAduaneiraTamanhoInvalido() { new NFNotaInfoItemImpostoImportacao().setValorDespesaAduaneira(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirImpostoImportacaoTamanhoInvalido() { new NFNotaInfoItemImpostoImportacao().setValorImpostoImportacao(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorIOFTamanhoInvalido() { new NFNotaInfoItemImpostoImportacao().setValorIOF(new BigDecimal("99999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISAliquotaTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISAliquotaTest.java index 88c25d313..2c9a2dae2 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISAliquotaTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISAliquotaTest.java @@ -10,17 +10,17 @@ public class NFNotaInfoItemImpostoPISAliquotaTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoPISAliquota().setValorTributo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISAliquota().setPercentualAliquota(new BigDecimal("9999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeVendidaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISAliquota().setValorBaseCalculo(new BigDecimal("99999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISOutrasOperacoesTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISOutrasOperacoesTest.java index 7aa055cf4..600fdb304 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISOutrasOperacoesTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISOutrasOperacoesTest.java @@ -19,27 +19,27 @@ public void naoDevePermitirSituacaoTributariaNulo() { pisOutrasOperacoes.toString(); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoPISOutrasOperacoes().setValorTributo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISOutrasOperacoes().setValorAliquota(new BigDecimal("999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISOutrasOperacoes().setPercentualAliquota(new BigDecimal("9999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoComTamanhoInvalido() { new NFNotaInfoItemImpostoPISOutrasOperacoes().setValorBaseCalculo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeVendidaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISOutrasOperacoes().setQuantidadeVendida(new BigDecimal("9999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISQuantidadeTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISQuantidadeTest.java index a7d074771..8c0a1687e 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISQuantidadeTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISQuantidadeTest.java @@ -10,17 +10,17 @@ public class NFNotaInfoItemImpostoPISQuantidadeTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoPISQuantidade().setValorTributo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISQuantidade().setValorAliquota(new BigDecimal("999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeVendidaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISQuantidade().setQuantidadeVendida(new BigDecimal("9999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISSTTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISSTTest.java index dd3fc901d..8e45d7d07 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISSTTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoPISSTTest.java @@ -9,27 +9,27 @@ public class NFNotaInfoItemImpostoPISSTTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlTributoComTamanhoInvalido() { new NFNotaInfoItemImpostoPISST().setValorTributo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorlAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISST().setValorAliquota(new BigDecimal("999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPercentualAliquotaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISST().setPercentualAliquota(new BigDecimal("1000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorBaseCalculoComTamanhoInvalido() { new NFNotaInfoItemImpostoPISST().setValorBaseCalculo(new BigDecimal("99999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeVendidaComTamanhoInvalido() { new NFNotaInfoItemImpostoPISST().setQuantidadeVendida(new BigDecimal("9999999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoTest.java index d930b3e4f..7e7a9f795 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemImpostoTest.java @@ -9,7 +9,7 @@ public class NFNotaInfoItemImpostoTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalTributosComTamanhoInvalido() { new NFNotaInfoItemImposto().setValorTotalTributos(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelCIDETest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelCIDETest.java index b962375a3..cfe1a6837 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelCIDETest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelCIDETest.java @@ -9,17 +9,17 @@ public class NFNotaInfoItemProdutoCombustivelCIDETest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorQuantidadeBCCIDEComTamanhoInvalido() { new NFNotaInfoItemProdutoCombustivelCIDE().setQuantidadeBCCIDE(new BigDecimal("1000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorAliquotaComTamanhoInvalido() { new NFNotaInfoItemProdutoCombustivelCIDE().setValorAliquota(new BigDecimal("100000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorComTamanhoInvalido() { new NFNotaInfoItemProdutoCombustivelCIDE().setValor(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelTest.java index 1b3dcca10..af0f37218 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoCombustivelTest.java @@ -28,7 +28,7 @@ public void naoDevePermitirCodigoProdutoANPComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeComTamanhoInvalido() { new NFNotaInfoItemProdutoCombustivel().setQuantidade(new BigDecimal("1000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoAdicaoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoAdicaoTest.java index 5e33ff40b..1954aac47 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoAdicaoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoAdicaoTest.java @@ -19,22 +19,22 @@ public void naoDevePermitirCodigoFabricanteComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirNumeroAtoConcessorioDrawbackComTamanhoInvalido() { new NFNotaInfoItemProdutoDeclaracaoImportacaoAdicao().setNumeroAtoConcessorioDrawback(new BigInteger("100000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirDescontoComTamanhoInvalido() { new NFNotaInfoItemProdutoDeclaracaoImportacaoAdicao().setDesconto(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirNumeroComTamanhoInvalido() { new NFNotaInfoItemProdutoDeclaracaoImportacaoAdicao().setNumero(1000); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirSequencialComTamanhoInvalido() { new NFNotaInfoItemProdutoDeclaracaoImportacaoAdicao().setSequencial(1000); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoMedicamentoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoMedicamentoTest.java index 6275cc4cd..75f691e31 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoMedicamentoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoMedicamentoTest.java @@ -17,12 +17,12 @@ public void naoDevePermitirLoteComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPrecoMaximoConsumidorComTamanhoInvalido() { new NFNotaInfoItemProdutoMedicamento().setPrecoMaximoConsumidor(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeComTamanhoInvalido() { new NFNotaInfoItemProdutoMedicamento().setQuantidade(new BigDecimal("100000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoTest.java index 49ed1e5f6..2ebe1f5c6 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoTest.java @@ -16,37 +16,37 @@ public void naoDevePermitirNomeclaturaForaDoPadrao() { new NFNotaInfoItemProduto().setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("ABC0123")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorUnitarioTributavelComTamanhoInvalido() { new NFNotaInfoItemProduto().setValorUnitarioTributavel(new BigDecimal("100000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorUnitarioComTamanhoInvalido() { new NFNotaInfoItemProduto().setValorUnitario(new BigDecimal("100000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorTotalBrutoComTamanhoInvalido() { new NFNotaInfoItemProduto().setValorTotalBruto(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorSeguroComTamanhoInvalido() { new NFNotaInfoItemProduto().setValorSeguro(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorOutrasDespesasAcessoriasComTamanhoInvalido() { new NFNotaInfoItemProduto().setValorOutrasDespesasAcessorias(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorFreteComTamanhoInvalido() { new NFNotaInfoItemProduto().setValorFrete(new BigDecimal("10000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorDescontoComTamanhoInvalido() { new NFNotaInfoItemProduto().setValorDesconto(new BigDecimal("10000000000000")); } @@ -69,17 +69,17 @@ public void naoDevePermitirUnidadeComercialComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeTributavelComTamanhoInvalido() { new NFNotaInfoItemProduto().setQuantidadeTributavel(new BigDecimal("100000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirQuantidadeComercialComTamanhoInvalido() { new NFNotaInfoItemProduto().setQuantidadeComercial(new BigDecimal("100000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirNumeroPedidoItemClienteComTamanhoInvalido() { new NFNotaInfoItemProduto().setNumeroPedidoItemCliente(1000000); } @@ -117,7 +117,7 @@ public void naoDevePermitirNcmComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirExtipiComTamanhoInvalido() { new NFNotaInfoItemProduto().setExtipi(1000); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoVeiculoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoVeiculoTest.java index adb0ffcf3..13165001f 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoVeiculoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoVeiculoTest.java @@ -35,12 +35,12 @@ public void naoDevePermitirTipoPenturaComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPesoLiquidoComTamanhoInvalido() { new NFNotaInfoItemProdutoVeiculo().setPesoLiquido(new BigDecimal("100000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirPesoBrutoComTamanhoInvalido() { new NFNotaInfoItemProdutoVeiculo().setPesoBruto(new BigDecimal("100000")); } @@ -63,7 +63,7 @@ public void naoDevePermitirNumeroMotorComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirLotacaoComTamanhoInvalido() { new NFNotaInfoItemProdutoVeiculo().setLotacao(1000); } @@ -122,25 +122,25 @@ public void naoDevePermitirChassiComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirCapacidadeMaximaTracaoComTamanhoInvalido() { new NFNotaInfoItemProdutoVeiculo().setCapacidadeMaximaTracao(new BigDecimal("100000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirAnoModeloFabricacaoComTamanhoInvalido() { try { new NFNotaInfoItemProdutoVeiculo().setAnoModeloFabricacao(999); - } catch (final IllegalStateException e) { + } catch (final NumberFormatException e) { new NFNotaInfoItemProdutoVeiculo().setAnoModeloFabricacao(10000); } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirAnoFabricacaoComTamanhoInvalido() { try { new NFNotaInfoItemProdutoVeiculo().setAnoFabricacao(999); - } catch (final IllegalStateException e) { + } catch (final NumberFormatException e) { new NFNotaInfoItemProdutoVeiculo().setAnoFabricacao(10000); } } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemTest.java index 1f4eea1bc..1faca3b93 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemTest.java @@ -16,7 +16,7 @@ public void naoDevePermitirInformacoesAdicionaisComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirNumeroItemComTamanhoInvalido() { new NFNotaInfoItem().setNumeroItem(991); } @@ -25,7 +25,7 @@ public void naoDevePermitirNumeroItemComTamanhoInvalido() { public void naoDevePermitirImpostoNulo() { final NFNotaInfoItem item = new NFNotaInfoItem(); item.setInformacoesAdicionais("R3s36BVI9k15xOe3hnlEpZRpPHEom9inv4hE1oo8hzHYG8X6D9sQjt6oLYiH6yToSFM95zueMhE4s270GB7iLUKcQTRHWLcHb1TU2fSYx2NAz5ZflI3hoTnN8zmqJtGzneaNpDRA5gJW7wxMg9IXIuUCxg25MlIQ46AbDQNc3HLl82g3awWKigBMli0bUEWIMf8C2GG2sB2Y9w1GnsfiDvw7RUuU5vATfWWvYFRCehm2UpDhBlrBjjXcWKYzXsT3x2PNtCC82JqY1nkKrgt2AHCPUjM0tCQk5EHFcssb8I0Rkc4s8aNcARXtFrBzmWqXDQPmCpLIGaAo7LlypOKKaqUNqkRkf8c930p8HaRDvQJealZsVnpwJn3Ev7yEaBZ9INe5PXFwkTQEfpNE3B8IokFMh0aUbu8mfzjKLBazSKW2qA4faIo2Wp5FmOmTzCMiPqznOq3Bl0zM4wmuo0rOXbswjaCUzPB0KpM8Yaze9TArOEDrV6Li"); - item.setNumeroItem(999); + item.setNumeroItem(99); item.setProduto(FabricaDeObjetosFake.getNFNotaInfoItemProduto()); item.toString(); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoPagamentoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoPagamentoTest.java index 49ef20260..483e210a2 100644 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoPagamentoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoPagamentoTest.java @@ -9,7 +9,7 @@ public class NFNotaInfoPagamentoTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorPagamentoComTamanhoInvalido() { new NFNotaInfoPagamento().setValorPagamento(new BigDecimal("10000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencaoICMSTransporteTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencaoICMSTransporteTest.java index b6f0b7455..0f3a15320 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencaoICMSTransporteTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencaoICMSTransporteTest.java @@ -6,7 +6,6 @@ import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoRetencaoICMSTransporte; public class NFNotaInfoRetencaoICMSTransporteTest { @@ -30,27 +29,27 @@ public void devePermitirValorICMSRetidoValorServicoTamanhoValido() { new NFNotaInfoRetencaoICMSTransporte().setValorServico(new BigDecimal("999999999999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirAliquotaRetencaoTamanhoValido() { new NFNotaInfoRetencaoICMSTransporte().setAliquotaRetencao(new BigDecimal("100000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorICMSRetidoTamanhoInvalido() { new NFNotaInfoRetencaoICMSTransporte().setValorICMSRetido(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirBCRetencaoICMSTamanhoInvalido() { new NFNotaInfoRetencaoICMSTransporte().setBcRetencaoICMS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorServicoTamanhoInvalido() { new NFNotaInfoRetencaoICMSTransporte().setValorServico(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirCodigoMunicipioOcorrenciaFatoGeradorICMSTransporteInvalido() { new NFNotaInfoRetencaoICMSTransporte().setCodigoMunicipioOcorrenciaFatoGeradorICMSTransporte(10000000); } @@ -60,7 +59,7 @@ public void devePermitirCodigoMunicipioOcorrenciaFatoGeradorICMSTransporteValido new NFNotaInfoRetencaoICMSTransporte().setCodigoMunicipioOcorrenciaFatoGeradorICMSTransporte(9999999); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirCFOPValorInvalido() { new NFNotaInfoRetencaoICMSTransporte().setCfop(10000); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencoesTributosTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencoesTributosTest.java index 6717737db..61c3c256b 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencoesTributosTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRetencoesTributosTest.java @@ -6,41 +6,40 @@ import org.junit.Test; import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoRetencoesTributos; public class NFNotaInfoRetencoesTributosTest { - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorRetidoPISInvalidosMonetarios() { new NFNotaInfoRetencoesTributos().setValorRetidoPIS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorRetidoIRRFInvalidosMonetarios() { new NFNotaInfoRetencoesTributos().setValorRetidoIRRF(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorRetidoCSLLInvalidosMonetarios() { new NFNotaInfoRetencoesTributos().setValorRetidoCSLL(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorRetidoCOFINSInvalidosMonetarios() { new NFNotaInfoRetencoesTributos().setValorRetidoCOFINS(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirValorRetencaoPrevidenciaSocialInvalidosMonetarios() { new NFNotaInfoRetencoesTributos().setValorRetencaoPrevidenciaSocial(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirCalculoRetencaoPrevidenciaSocialInvalidosMonetarios() { new NFNotaInfoRetencoesTributos().setBaseCalculoRetencaoPrevidenciaSocial(new BigDecimal("1000000000000000")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirCalculoIRRFInvalidosMonetarios() { new NFNotaInfoRetencoesTributos().setBaseCalculoIRRF(new BigDecimal("1000000000000000")); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTest.java index 6355adbfb..58e78d153 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTest.java @@ -19,7 +19,7 @@ public void naoDevePermitirIdentificadorComTamanhoInvalido() { } } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirVersaoComTamanhoInvalido() { new NFNotaInfo().setVersao(new BigDecimal("100")); } diff --git a/src/test/java/com/fincatto/nfe310/validadores/BigDecimalParserTest.java b/src/test/java/com/fincatto/nfe310/validadores/BigDecimalParserTest.java index aa45bf865..04e111739 100755 --- a/src/test/java/com/fincatto/nfe310/validadores/BigDecimalParserTest.java +++ b/src/test/java/com/fincatto/nfe310/validadores/BigDecimalParserTest.java @@ -67,27 +67,27 @@ public void devePermitirValores15ComAte4CasasDecimais() { Assert.assertEquals("1", BigDecimalParser.tamanho15comAte4CasasDecimais(new BigDecimal("1"))); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirExtrapolacaoDeInteiros() { BigDecimalParser.tamanho15Com2CasasDecimais(new BigDecimal("99999999999999.9")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirExtrapolacaoDeCasasDecimais() { BigDecimalParser.tamanho15Com2CasasDecimais(new BigDecimal("99999999999.999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirExtrapolacaoPor15CaracteresCom2CasasDecimais() { BigDecimalParser.tamanho15Com2CasasDecimais(new BigDecimal("99999999999999.99")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirExtrapolacaoPor15CaracteresCom3CasasDecimais() { BigDecimalParser.tamanho15Com3CasasDecimais(new BigDecimal("9999999999999.999")); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void naoDevePermitirExtrapolar21Caracteres() { BigDecimalParser.tamanho21ComAte10CasasDecimais(new BigDecimal("999999999999.9999999999")); } diff --git a/src/test/java/com/fincatto/nfe310/validadores/IntegerValidadorTest.java b/src/test/java/com/fincatto/nfe310/validadores/IntegerValidadorTest.java index 8a260b13d..c59f0e0d0 100755 --- a/src/test/java/com/fincatto/nfe310/validadores/IntegerValidadorTest.java +++ b/src/test/java/com/fincatto/nfe310/validadores/IntegerValidadorTest.java @@ -2,8 +2,6 @@ import org.junit.Test; -import com.fincatto.nfe310.validadores.IntegerValidador; - public class IntegerValidadorTest { @Test @@ -16,12 +14,12 @@ public void deveValidarCasoValorParaTamanho4EstejaValido() { IntegerValidador.tamanho4(9999); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void deveLancarExcecaoCasoValorParaTamanho7SejaInvalido() { IntegerValidador.tamanho7(10000000); } - @Test(expected = IllegalStateException.class) + @Test(expected = NumberFormatException.class) public void deveLancarExcecaoCasoValorParaTamanho4SejaInvalido() { IntegerValidador.tamanho4(10000); }