diff --git a/README.md b/README.md index 1cf3b7dbe..86fdd01fe 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Nota Fiscal Eletrônica Comunicador de nota fiscal da [fazenda](http://www.nfe.fazenda.gov.br/portal/principal.aspx).
[![Build Status](https://api.travis-ci.org/wmixvideo/nfe.png)](http://travis-ci.org/#!/wmixvideo/nfe) [![Coverage Status](https://coveralls.io/repos/wmixvideo/nfe/badge.svg?branch=master&service=github)](https://coveralls.io/github/wmixvideo/nfe?branch=master) -[![Maven Central](https://img.shields.io/badge/maven%20central-1.1.14-blue.svg)](http://search.maven.org/#artifactdetails|com.github.wmixvideo|nfe|1.1.14|) +[![Maven Central](https://img.shields.io/badge/maven%20central-1.2.0-blue.svg)](http://search.maven.org/#artifactdetails|com.github.wmixvideo|nfe|1.2.0|) [![Apache 2.0 License](https://img.shields.io/badge/license-apache%202.0-green.svg) ](https://github.com/wmixvideo/nfe/blob/master/LICENSE) ## Atenção @@ -22,7 +22,7 @@ Caso não possua conhecimento técnico para criar notas fiscais, um profissional com.github.wmixvideo nfe - 1.1.14 + 1.2.0 ``` @@ -33,67 +33,53 @@ comunicação com os webservices da Sefaz. ```java // Exemplo de configuracao para acesso aos serviços da Sefaz. -public class ConfiguracaoSefaz implements NFeConfig { +public class NFeConfigTeste extends NFeConfig { - private final boolean ehAmbienteDeTeste; - - public ConfiguracaoSefaz(final boolean ehAmbienteDeTeste) { - this.ehAmbienteDeTeste = ehAmbienteDeTeste; - } - - @Override - public NFAmbiente getAmbiente() { - return this.ehAmbienteDeTeste ? NFAmbiente.HOMOLOGACAO : NFAmbiente.PRODUCAO; - } - - @Override - public File getCertificado() throws IOException { - try (InputStream is = CertificadoUtils.class.getResource("certificado.pfx").openStream()) { - return IOUtils.toByteArray(is); - } - } + private KeyStore keyStoreCertificado = null; + private KeyStore keyStoreCadeia = null; @Override - public File getCadeiaCertificados() throws IOException { - try (InputStream is = CertificadoUtils.class.getResource("cadeia_certificado.jks").openStream()) { - return IOUtils.toByteArray(is); - } + public NFUnidadeFederativa getCUF() { + return NFUnidadeFederativa.SC; } @Override public String getCertificadoSenha() { - return "senhaDoCertificado"; + return "senha_certificado"; } - @Override - public String getCadeiaCertificadosSenha() { - return "senhaDaCadeiaDeCertificados"; - } - @Override - public NFUnidadeFederativa getCUF() { - return NFUnidadeFederativa.SC; + public String getCadeiaCertificadosSenha() { + return "senha_cadeia"; } @Override - public NFTipoEmissao getTipoEmissao() { - return NFTipoEmissao.EMISSAO_NORMAL; + public KeyStore getCertificadoKeyStore() throws KeyStoreException { + if (this.keyStoreCertificado == null) { + this.keyStoreCertificado = KeyStore.getInstance("PKCS12"); + try (InputStream certificadoStream = new FileInputStream("/tmp/certificado.pfx")) { + this.keyStoreCertificado.load(certificadoStream, this.getCertificadoSenha().toCharArray()); + } catch (CertificateException | NoSuchAlgorithmException | IOException e) { + this.keyStoreCadeia = null; + throw new KeyStoreException("Nao foi possibel montar o KeyStore com a cadeia de certificados", e); + } + } + return this.keyStoreCertificado; } @Override - public String getSSLProtocolo() { - return "TLSv1"; - } - - @Override - public Integer getCodigoSegurancaContribuinteID() { - return null; - } - - @Override - public String getCodigoSegurancaContribuinte() { - return null; - } + public KeyStore getCadeiaCertificadosKeyStore() throws KeyStoreException { + if (this.keyStoreCadeia == null) { + this.keyStoreCadeia = KeyStore.getInstance("JKS"); + try (InputStream cadeia = new FileInputStream("/tmp/cadeia.jks")) { + this.keyStoreCadeia.load(cadeia, this.getCadeiaCertificadosSenha().toCharArray()); + } catch (CertificateException | NoSuchAlgorithmException | IOException e) { + this.keyStoreCadeia = null; + throw new KeyStoreException("Nao foi possibel montar o KeyStore com o certificado", e); + } + } + return this.keyStoreCadeia; + } } ``` diff --git a/pom.xml b/pom.xml index d7cee4bad..aa79f0ba4 100755 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ com.github.wmixvideo nfe jar - 1.1.15-SNAPSHOT + 1.2.0-SNAPSHOT nfe Biblioteca de comunicacao de nota fiscal eletronica brasileira https://github.com/wmixvideo/nfe @@ -26,7 +26,7 @@ UTF-8 UTF-8 - 1.6.3 + 1.6.4 2.9.3 4.12 diff --git a/src/main/java/com/fincatto/nfe310/NFeConfig.java b/src/main/java/com/fincatto/nfe310/NFeConfig.java index 0e50435e2..0b99ab80b 100755 --- a/src/main/java/com/fincatto/nfe310/NFeConfig.java +++ b/src/main/java/com/fincatto/nfe310/NFeConfig.java @@ -1,33 +1,105 @@ package com.fincatto.nfe310; -import java.io.IOException; - import com.fincatto.nfe310.classes.NFAmbiente; import com.fincatto.nfe310.classes.NFTipoEmissao; import com.fincatto.nfe310.classes.NFUnidadeFederativa; -public interface NFeConfig { +import java.security.KeyStore; +import java.security.KeyStoreException; + +/** + * Configuração basica do sistema de notas fiscais. + */ +public abstract class NFeConfig { - String VERSAO_NFE = "3.10"; - String NFE_NAMESPACE = "http://www.portalfiscal.inf.br/nfe"; + public static final String VERSAO_NFE = "3.10"; + public static final String NFE_NAMESPACE = "http://www.portalfiscal.inf.br/nfe"; - NFAmbiente getAmbiente(); + /** + * Indica o ambiente de trabalho, se em produção ou homologação. + * + * @return Ambiente de trabalho. + */ + public NFAmbiente getAmbiente() { + return NFAmbiente.HOMOLOGACAO; + } - byte[] getCertificado() throws IOException; + /** + * Unidade da federação do emissor das notas. + * + * @return Unidade da federação do emissor. + */ + public abstract NFUnidadeFederativa getCUF(); - byte[] getCadeiaCertificados() throws IOException; + /** + * KeyStore contendo o certificado pessoal do emissor.
+ * Esse certificado é fornecido por uma autoridade certificadora.
+ * Em caso de dúvidas, consulte seu contador. + * + * @return KeyStore do certificado pessoal. + * @throws KeyStoreException Caso não consiga carregar o KeyStore. + */ + public abstract KeyStore getCertificadoKeyStore() throws KeyStoreException; - String getCertificadoSenha(); + /** + * Senha do certificado pessoal do emissor, contido dentro do KeyStore do certificado. + * + * @return Senha do certificado. + * @see #getCertificadoKeyStore() + */ + public abstract String getCertificadoSenha(); - String getCadeiaCertificadosSenha(); + /** + * KeyStore contendo a cadeia de certificados da SEFAZ de destino.
+ * Para gerar a cadeia, use o utilitário fornecido com a biblioteca:
+ * FileUtils.writeByteArrayToFile(new File("/tmp/producao.cacerts"), NFGeraCadeiaCertificados.geraCadeiaCertificados(NFAmbiente.PRODUCAO, "senha")); + * + * @return KeyStore da cadeia de certificados. + * @throws KeyStoreException Caso nao consiga carregar o KeyStore. + */ + public abstract KeyStore getCadeiaCertificadosKeyStore() throws KeyStoreException; - NFUnidadeFederativa getCUF(); + /** + * Senha da cadeia de certificados, contida dentro do KeyStore da cadeia. + * + * @return Senha da cadeia de certificados. + * @see #getCadeiaCertificadosKeyStore() + */ + public abstract String getCadeiaCertificadosSenha(); - NFTipoEmissao getTipoEmissao(); + /** + * ID de contribuinte, somente para NFCe. + * + * @return ID do contribuinte. + */ + public Integer getCodigoSegurancaContribuinteID() { + return null; + } - String getSSLProtocolo(); + /** + * Codigo de seguranca do contribuinte, com 36 caracteres, somente para NFCe. + * + * @return Codigo de segurança do contribuinte. + */ + public String getCodigoSegurancaContribuinte() { + return null; + } - Integer getCodigoSegurancaContribuinteID(); + /** + * Tipo da emissão das notas (se normal ou em contingência). + * + * @return Tipo da emissão das notas. + */ + public NFTipoEmissao getTipoEmissao() { + return NFTipoEmissao.EMISSAO_NORMAL; + } - String getCodigoSegurancaContribuinte(); + /** + * Protocolo de SSL, usado pela SEFAZ para receber as notas. + * + * @return Protocolo SSL da SEFAZ de origem. + */ + public String getSSLProtocolo() { + return "TLSv1"; + } } \ No newline at end of file diff --git a/src/main/java/com/fincatto/nfe310/assinatura/AssinaturaDigital.java b/src/main/java/com/fincatto/nfe310/assinatura/AssinaturaDigital.java index 05e40823d..7b863c811 100755 --- a/src/main/java/com/fincatto/nfe310/assinatura/AssinaturaDigital.java +++ b/src/main/java/com/fincatto/nfe310/assinatura/AssinaturaDigital.java @@ -29,7 +29,6 @@ import javax.xml.transform.TransformerFactoryConfigurationError; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; -import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -75,12 +74,9 @@ public boolean isValida(final InputStream xmlStream) throws Exception { } public String assinarDocumento(final String conteudoXml) throws Exception { - final KeyStore keyStore = KeyStore.getInstance("PKCS12"); - try (InputStream certificadoStream = new ByteArrayInputStream(this.config.getCertificado())) { - keyStore.load(certificadoStream, this.config.getCertificadoSenha().toCharArray()); - } - - final KeyStore.PrivateKeyEntry keyEntry = (KeyStore.PrivateKeyEntry) keyStore.getEntry(keyStore.aliases().nextElement(), new KeyStore.PasswordProtection(this.config.getCertificadoSenha().toCharArray())); + final String certificateAlias = config.getCertificadoKeyStore().aliases().nextElement(); + final KeyStore.PasswordProtection passwordProtection = new KeyStore.PasswordProtection(this.config.getCertificadoSenha().toCharArray()); + final KeyStore.PrivateKeyEntry keyEntry = (KeyStore.PrivateKeyEntry) config.getCertificadoKeyStore().getEntry(certificateAlias, passwordProtection); final XMLSignatureFactory signatureFactory = XMLSignatureFactory.getInstance("DOM"); final List transforms = new ArrayList<>(2); diff --git a/src/main/java/com/fincatto/nfe310/classes/NFAmbiente.java b/src/main/java/com/fincatto/nfe310/classes/NFAmbiente.java index ba5ad2caa..6cdb07063 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFAmbiente.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFAmbiente.java @@ -7,7 +7,7 @@ public enum NFAmbiente { private final String codigo; - private NFAmbiente(final String codigo) { + NFAmbiente(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFFinalidade.java b/src/main/java/com/fincatto/nfe310/classes/NFFinalidade.java index 6441d8fea..04bb71b8f 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFFinalidade.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFFinalidade.java @@ -10,7 +10,7 @@ public enum NFFinalidade { private final String codigo; private final String descricao; - private NFFinalidade(final String codigo, final String descricao) { + NFFinalidade(final String codigo, final String descricao) { this.codigo = codigo; this.descricao = descricao; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFFormaPagamentoPrazo.java b/src/main/java/com/fincatto/nfe310/classes/NFFormaPagamentoPrazo.java index c52f56d78..b9a16c357 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFFormaPagamentoPrazo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFFormaPagamentoPrazo.java @@ -1,27 +1,27 @@ package com.fincatto.nfe310.classes; public enum NFFormaPagamentoPrazo { - + A_VISTA("0", "A vista"), A_PRAZO("1", "A prazo"), OUTROS("2", "Outros"); - + private final String codigo; private final String descricao; - - private NFFormaPagamentoPrazo(final String codigo, final String descricao) { + + NFFormaPagamentoPrazo(final String codigo, final String descricao) { this.codigo = codigo; this.descricao = descricao; } - + public String getCodigo() { return this.codigo; } - + public String getDescricao() { return this.descricao; } - + public static NFFormaPagamentoPrazo valueOfCodigo(final String codigo) { for (NFFormaPagamentoPrazo formaPagamento : NFFormaPagamentoPrazo.values()) { if (formaPagamento.getCodigo().equals(codigo)) { diff --git a/src/main/java/com/fincatto/nfe310/classes/NFModalidadeFrete.java b/src/main/java/com/fincatto/nfe310/classes/NFModalidadeFrete.java index c0bf0a919..9ef676ed2 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFModalidadeFrete.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFModalidadeFrete.java @@ -8,7 +8,7 @@ public enum NFModalidadeFrete { private String codigo; - private NFModalidadeFrete(final String codigo) { + NFModalidadeFrete(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFModelo.java b/src/main/java/com/fincatto/nfe310/classes/NFModelo.java index 5803bb2f6..88f0d74f2 100644 --- a/src/main/java/com/fincatto/nfe310/classes/NFModelo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFModelo.java @@ -7,7 +7,7 @@ public enum NFModelo { private final String codigo; - private NFModelo(final String codigo) { + NFModelo(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoCombustivelTipo.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoCombustivelTipo.java index 2e9154d25..e55e3ae9e 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoCombustivelTipo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoCombustivelTipo.java @@ -23,7 +23,7 @@ public enum NFNotaInfoCombustivelTipo { private String codigo; - private NFNotaInfoCombustivelTipo(final String codigo) { + NFNotaInfoCombustivelTipo(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoEspecieVeiculo.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoEspecieVeiculo.java index 9d188de89..d3ef2b545 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoEspecieVeiculo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoEspecieVeiculo.java @@ -11,7 +11,7 @@ public enum NFNotaInfoEspecieVeiculo { private String codigo; - private NFNotaInfoEspecieVeiculo(final String codigo) { + NFNotaInfoEspecieVeiculo(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoICMS.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoICMS.java index 2912c4317..4c90bc9f5 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoICMS.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoICMS.java @@ -15,7 +15,7 @@ public enum NFNotaInfoImpostoTributacaoICMS { String codigo; - private NFNotaInfoImpostoTributacaoICMS(final String codigo) { + NFNotaInfoImpostoTributacaoICMS(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoISSQN.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoISSQN.java index 67c11b68d..a963e4100 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoISSQN.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoImpostoTributacaoISSQN.java @@ -8,7 +8,7 @@ public enum NFNotaInfoImpostoTributacaoISSQN { private String codigo; - private NFNotaInfoImpostoTributacaoISSQN(final String codigo) { + NFNotaInfoImpostoTributacaoISSQN(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemImpostoICMSModalidadeBaseCalculo.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemImpostoICMSModalidadeBaseCalculo.java index b68576b8c..6a4d2aaba 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemImpostoICMSModalidadeBaseCalculo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemImpostoICMSModalidadeBaseCalculo.java @@ -10,7 +10,7 @@ public enum NFNotaInfoItemImpostoICMSModalidadeBaseCalculo { private final String codigo; private final String descricao; - private NFNotaInfoItemImpostoICMSModalidadeBaseCalculo(final String codigo, final String descricao) { + NFNotaInfoItemImpostoICMSModalidadeBaseCalculo(final String codigo, final String descricao) { this.codigo = codigo; this.descricao = descricao; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemModalidadeBCICMSST.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemModalidadeBCICMSST.java index 3f873a14b..dccf2795d 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemModalidadeBCICMSST.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemModalidadeBCICMSST.java @@ -11,7 +11,7 @@ public enum NFNotaInfoItemModalidadeBCICMSST { private String codigo; private String descricao; - private NFNotaInfoItemModalidadeBCICMSST(final String codigo, final String descricao) { + NFNotaInfoItemModalidadeBCICMSST(final String codigo, final String descricao) { this.codigo = codigo; this.descricao = descricao; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoArmamentoTipo.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoArmamentoTipo.java index c25d295f4..543c6f89b 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoArmamentoTipo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoArmamentoTipo.java @@ -6,7 +6,7 @@ public enum NFNotaInfoItemProdutoArmamentoTipo { private final String codigo; - private NFNotaInfoItemProdutoArmamentoTipo(final String codigo) { + NFNotaInfoItemProdutoArmamentoTipo(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicao.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicao.java index e4962d14a..734f3299f 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicao.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicao.java @@ -8,7 +8,7 @@ public enum NFNotaInfoItemProdutoVeiculoCondicao { private final String codigo; - private NFNotaInfoItemProdutoVeiculoCondicao(final String codigo) { + NFNotaInfoItemProdutoVeiculoCondicao(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicaoChassi.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicaoChassi.java index fdf655f45..49eeaa4e9 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicaoChassi.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoCondicaoChassi.java @@ -7,7 +7,7 @@ public enum NFNotaInfoItemProdutoVeiculoCondicaoChassi { private final String codigo; - private NFNotaInfoItemProdutoVeiculoCondicaoChassi(final String codigo) { + NFNotaInfoItemProdutoVeiculoCondicaoChassi(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoRestricao.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoRestricao.java index 20e832dcc..8f6e749d4 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoRestricao.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoRestricao.java @@ -11,7 +11,7 @@ public enum NFNotaInfoItemProdutoVeiculoRestricao { private final String codigo; - private NFNotaInfoItemProdutoVeiculoRestricao(final String codigo) { + NFNotaInfoItemProdutoVeiculoRestricao(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoTipoOperacao.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoTipoOperacao.java index 1624b3384..9407fc5c8 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoTipoOperacao.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoItemProdutoVeiculoTipoOperacao.java @@ -9,7 +9,7 @@ public enum NFNotaInfoItemProdutoVeiculoTipoOperacao { private final String codigo; - private NFNotaInfoItemProdutoVeiculoTipoOperacao(final String codigo) { + NFNotaInfoItemProdutoVeiculoTipoOperacao(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaCOFINS.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaCOFINS.java index 1d51d42a2..5bbcf9629 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaCOFINS.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaCOFINS.java @@ -37,7 +37,7 @@ public enum NFNotaInfoSituacaoTributariaCOFINS { private String codigo; - private NFNotaInfoSituacaoTributariaCOFINS(final String codigo) { + NFNotaInfoSituacaoTributariaCOFINS(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaIPI.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaIPI.java index 18a0fa360..4d0e81efc 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaIPI.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaIPI.java @@ -18,7 +18,7 @@ public enum NFNotaInfoSituacaoTributariaIPI { private final String codigo; - private NFNotaInfoSituacaoTributariaIPI(final String codigo) { + NFNotaInfoSituacaoTributariaIPI(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaPIS.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaPIS.java index 8687a46a9..251f27775 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaPIS.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoSituacaoTributariaPIS.java @@ -37,7 +37,7 @@ public enum NFNotaInfoSituacaoTributariaPIS { private final String codigo; - private NFNotaInfoSituacaoTributariaPIS(final String codigo) { + NFNotaInfoSituacaoTributariaPIS(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoTipoVeiculo.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoTipoVeiculo.java index 07b4e76bd..5d5955840 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoTipoVeiculo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoTipoVeiculo.java @@ -19,7 +19,7 @@ public enum NFNotaInfoTipoVeiculo { private String codigo; - private NFNotaInfoTipoVeiculo(final String codigo) { + NFNotaInfoTipoVeiculo(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoVeiculoCor.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoVeiculoCor.java index 2e8d8397e..86c755370 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoVeiculoCor.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaInfoVeiculoCor.java @@ -21,7 +21,7 @@ public enum NFNotaInfoVeiculoCor { private String codigo; - private NFNotaInfoVeiculoCor(final String codigo) { + NFNotaInfoVeiculoCor(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaMotivoDesoneracaoICMS.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaMotivoDesoneracaoICMS.java index 404ba975a..b417aba0d 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaMotivoDesoneracaoICMS.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaMotivoDesoneracaoICMS.java @@ -15,7 +15,7 @@ public enum NFNotaMotivoDesoneracaoICMS { private final String codigo; - private NFNotaMotivoDesoneracaoICMS(final String codigo) { + NFNotaMotivoDesoneracaoICMS(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFNotaSituacaoOperacionalSimplesNacional.java b/src/main/java/com/fincatto/nfe310/classes/NFNotaSituacaoOperacionalSimplesNacional.java index d5b69cc7f..7b4543245 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFNotaSituacaoOperacionalSimplesNacional.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFNotaSituacaoOperacionalSimplesNacional.java @@ -14,7 +14,7 @@ public enum NFNotaSituacaoOperacionalSimplesNacional { private final String codigo; - private NFNotaSituacaoOperacionalSimplesNacional(final String codigo) { + NFNotaSituacaoOperacionalSimplesNacional(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFOrigem.java b/src/main/java/com/fincatto/nfe310/classes/NFOrigem.java index d23fd2ada..1d5bd2e4b 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFOrigem.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFOrigem.java @@ -14,7 +14,7 @@ public enum NFOrigem { private final String codigo; - private NFOrigem(final String codigo) { + NFOrigem(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFOrigemProcesso.java b/src/main/java/com/fincatto/nfe310/classes/NFOrigemProcesso.java index 16e07e959..1fa75cdaf 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFOrigemProcesso.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFOrigemProcesso.java @@ -9,7 +9,7 @@ public enum NFOrigemProcesso { private String codigo; - private NFOrigemProcesso(final String codigo) { + NFOrigemProcesso(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFProcessoEmissor.java b/src/main/java/com/fincatto/nfe310/classes/NFProcessoEmissor.java index 20ac7e61e..a29979edd 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFProcessoEmissor.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFProcessoEmissor.java @@ -10,7 +10,7 @@ public enum NFProcessoEmissor { private final String codigo; private final String descricao; - private NFProcessoEmissor(final String codigo, final String descricao) { + NFProcessoEmissor(final String codigo, final String descricao) { this.codigo = codigo; this.descricao = descricao; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFProdutoCompoeValorNota.java b/src/main/java/com/fincatto/nfe310/classes/NFProdutoCompoeValorNota.java index 091fa6761..1e670bb2a 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFProdutoCompoeValorNota.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFProdutoCompoeValorNota.java @@ -6,7 +6,7 @@ public enum NFProdutoCompoeValorNota { private final String codigo; - private NFProdutoCompoeValorNota(final String codigo) { + NFProdutoCompoeValorNota(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFRegimeTributario.java b/src/main/java/com/fincatto/nfe310/classes/NFRegimeTributario.java index 665061449..d13982895 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFRegimeTributario.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFRegimeTributario.java @@ -9,7 +9,7 @@ public enum NFRegimeTributario { private final String codigo; private final String descricao; - private NFRegimeTributario(final String codigo, final String descricao) { + NFRegimeTributario(final String codigo, final String descricao) { this.codigo = codigo; this.descricao = descricao; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFTipo.java b/src/main/java/com/fincatto/nfe310/classes/NFTipo.java index 6436c9f2b..e200ae775 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFTipo.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFTipo.java @@ -7,7 +7,7 @@ public enum NFTipo { private final String codigo; - private NFTipo(final String codigo) { + NFTipo(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFTipoImpressao.java b/src/main/java/com/fincatto/nfe310/classes/NFTipoImpressao.java index 85e54611c..9ccc58d50 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFTipoImpressao.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFTipoImpressao.java @@ -10,7 +10,7 @@ public enum NFTipoImpressao { private final String codigo; - private NFTipoImpressao(final String codigo) { + NFTipoImpressao(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/NFUnidadeFederativa.java b/src/main/java/com/fincatto/nfe310/classes/NFUnidadeFederativa.java index e9cd80b11..18d4eadef 100755 --- a/src/main/java/com/fincatto/nfe310/classes/NFUnidadeFederativa.java +++ b/src/main/java/com/fincatto/nfe310/classes/NFUnidadeFederativa.java @@ -42,7 +42,7 @@ public enum NFUnidadeFederativa { private final String qrCodeHomologacao; private final String qrCodeProducao; - private NFUnidadeFederativa(final String codigo, final String descricao, final String codigoIbge, String qrCodeHomologacao, String qrCodeProducao) { + NFUnidadeFederativa(final String codigo, final String descricao, final String codigoIbge, String qrCodeHomologacao, String qrCodeProducao) { this.codigo = codigo; this.descricao = descricao; this.codigoIbge = codigoIbge; @@ -50,8 +50,8 @@ private NFUnidadeFederativa(final String codigo, final String descricao, final S this.qrCodeProducao = qrCodeProducao; } - private NFUnidadeFederativa(final String codigo, final String descricao, final String codigoIbge) { - this(codigo, descricao, codigoIbge, null, null); + NFUnidadeFederativa(final String codigo, final String descricao, final String codigoIbge) { + this(codigo, descricao, codigoIbge, null, null); } public String getCodigo() { diff --git a/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteCTe.java b/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteCTe.java index c63435138..b443ff2f0 100644 --- a/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteCTe.java +++ b/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteCTe.java @@ -9,7 +9,7 @@ public enum NFIndicadorContribuinteCTe { private int codigo; - private NFIndicadorContribuinteCTe(final int codigo) { + NFIndicadorContribuinteCTe(final int codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteNFe.java b/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteNFe.java index 977f2e463..bfa3eec23 100644 --- a/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteNFe.java +++ b/src/main/java/com/fincatto/nfe310/classes/cadastro/NFIndicadorContribuinteNFe.java @@ -10,7 +10,7 @@ public enum NFIndicadorContribuinteNFe { private int codigo; - private NFIndicadorContribuinteNFe(final int codigo) { + NFIndicadorContribuinteNFe(final int codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/cadastro/NFSituacaoContribuinte.java b/src/main/java/com/fincatto/nfe310/classes/cadastro/NFSituacaoContribuinte.java index 5019252bb..2475dfa9c 100644 --- a/src/main/java/com/fincatto/nfe310/classes/cadastro/NFSituacaoContribuinte.java +++ b/src/main/java/com/fincatto/nfe310/classes/cadastro/NFSituacaoContribuinte.java @@ -7,7 +7,7 @@ public enum NFSituacaoContribuinte { private int codigo; - private NFSituacaoContribuinte(final int codigo) { + NFSituacaoContribuinte(final int codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/evento/NFTipoEvento.java b/src/main/java/com/fincatto/nfe310/classes/evento/NFTipoEvento.java index 33b318956..b9c622859 100644 --- a/src/main/java/com/fincatto/nfe310/classes/evento/NFTipoEvento.java +++ b/src/main/java/com/fincatto/nfe310/classes/evento/NFTipoEvento.java @@ -1,14 +1,13 @@ package com.fincatto.nfe310.classes.evento; -import java.math.BigDecimal; - +import com.fincatto.nfe310.classes.NFBase; +import com.fincatto.nfe310.validadores.BigDecimalParser; +import com.fincatto.nfe310.validadores.StringValidador; import org.simpleframework.xml.Attribute; import org.simpleframework.xml.Element; import org.simpleframework.xml.Root; -import com.fincatto.nfe310.classes.NFBase; -import com.fincatto.nfe310.validadores.BigDecimalParser; -import com.fincatto.nfe310.validadores.StringValidador; +import java.math.BigDecimal; @Root(strict = false) public class NFTipoEvento extends NFBase { @@ -20,7 +19,7 @@ public class NFTipoEvento extends NFBase { // Carta correcao @Element(name = "xCorrecao", required = false) - private String textoCorrecao;; + private String textoCorrecao; @Element(name = "xCondUso", required = false) private String condicaoUso; diff --git a/src/main/java/com/fincatto/nfe310/classes/lote/envio/NFLoteIndicadorProcessamento.java b/src/main/java/com/fincatto/nfe310/classes/lote/envio/NFLoteIndicadorProcessamento.java index a8a428428..053a9b282 100644 --- a/src/main/java/com/fincatto/nfe310/classes/lote/envio/NFLoteIndicadorProcessamento.java +++ b/src/main/java/com/fincatto/nfe310/classes/lote/envio/NFLoteIndicadorProcessamento.java @@ -7,7 +7,7 @@ public enum NFLoteIndicadorProcessamento { private String codigo; - private NFLoteIndicadorProcessamento(final String codigo) { + NFLoteIndicadorProcessamento(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaImportacaoIntermediacao.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaImportacaoIntermediacao.java index 98cf4c935..1b977d19a 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaImportacaoIntermediacao.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaImportacaoIntermediacao.java @@ -8,7 +8,7 @@ public enum NFFormaImportacaoIntermediacao { private String codigo; - private NFFormaImportacaoIntermediacao(final String codigo) { + NFFormaImportacaoIntermediacao(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaPagamentoMoeda.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaPagamentoMoeda.java index 215fda64b..019b3b1f4 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaPagamentoMoeda.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFFormaPagamentoMoeda.java @@ -15,7 +15,7 @@ public enum NFFormaPagamentoMoeda { private String codigo; - private NFFormaPagamentoMoeda(final String codigo) { + NFFormaPagamentoMoeda(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFIdentificadorLocalDestinoOperacao.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFIdentificadorLocalDestinoOperacao.java index 4945e4cc3..a6fa5cd59 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFIdentificadorLocalDestinoOperacao.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFIdentificadorLocalDestinoOperacao.java @@ -8,7 +8,7 @@ public enum NFIdentificadorLocalDestinoOperacao { private String codigo; - private NFIdentificadorLocalDestinoOperacao(final String codigo) { + NFIdentificadorLocalDestinoOperacao(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorIEDestinatario.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorIEDestinatario.java index 3271e01fe..05542f168 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorIEDestinatario.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorIEDestinatario.java @@ -7,7 +7,7 @@ public enum NFIndicadorIEDestinatario { private String codigo; - private NFIndicadorIEDestinatario(final String codigo) { + NFIndicadorIEDestinatario(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorPresencaComprador.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorPresencaComprador.java index f9fecb67e..8d0f42e6c 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorPresencaComprador.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFIndicadorPresencaComprador.java @@ -10,7 +10,7 @@ public enum NFIndicadorPresencaComprador { private String codigo; - private NFIndicadorPresencaComprador(final String codigo) { + NFIndicadorPresencaComprador(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotal.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotal.java index 006b94229..024a7f433 100755 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotal.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoICMSTotal.java @@ -81,7 +81,7 @@ public void setValorTotalICMS(final BigDecimal valorTotalICMS) { public void setValor(final BigDecimal valor) { this.baseCalculoICMSST = BigDecimalParser.tamanho15Com2CasasDecimais(valor); } - + public void setBaseCalculoICMSST(final BigDecimal baseCalculoICMSST) { this.baseCalculoICMSST = BigDecimalParser.tamanho15Com2CasasDecimais(baseCalculoICMSST); } @@ -157,7 +157,7 @@ public String getValorICMSDesonerado() { public String getValor() { return this.baseCalculoICMSST; } - + public String getBaseCalculoICMSST() { return this.baseCalculoICMSST; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorExigibilidadeISS.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorExigibilidadeISS.java index 116635d0c..349b3f6b9 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorExigibilidadeISS.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorExigibilidadeISS.java @@ -12,7 +12,7 @@ public enum NFNotaInfoItemIndicadorExigibilidadeISS { private String codigo; - private NFNotaInfoItemIndicadorExigibilidadeISS(final String codigo) { + NFNotaInfoItemIndicadorExigibilidadeISS(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorIncentivoFiscal.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorIncentivoFiscal.java index 3de1a9e48..54dad26f9 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorIncentivoFiscal.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemIndicadorIncentivoFiscal.java @@ -6,7 +6,7 @@ public enum NFNotaInfoItemIndicadorIncentivoFiscal { private String codigo; - private NFNotaInfoItemIndicadorIncentivoFiscal(final String codigo) { + NFNotaInfoItemIndicadorIncentivoFiscal(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProduto.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProduto.java index 8e85eb9f1..20748dd1f 100755 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProduto.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProduto.java @@ -1,13 +1,5 @@ package com.fincatto.nfe310.classes.nota; -import java.math.BigDecimal; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.simpleframework.xml.Element; -import org.simpleframework.xml.ElementList; -import org.simpleframework.xml.convert.Convert; - import com.fincatto.nfe310.classes.NFBase; import com.fincatto.nfe310.classes.NFProdutoCompoeValorNota; import com.fincatto.nfe310.converters.StringNullConverter; @@ -15,13 +7,20 @@ import com.fincatto.nfe310.validadores.IntegerValidador; import com.fincatto.nfe310.validadores.ListValidador; import com.fincatto.nfe310.validadores.StringValidador; +import org.apache.commons.lang3.StringUtils; +import org.simpleframework.xml.Element; +import org.simpleframework.xml.ElementList; +import org.simpleframework.xml.convert.Convert; + +import java.math.BigDecimal; +import java.util.List; public class NFNotaInfoItemProduto extends NFBase { @Element(name = "cProd", required = true) private String codigo; - @Element(name = "cEAN", required = false) + @Element(name = "cEAN", required = true) @Convert(StringNullConverter.class) private String codigoDeBarras; @@ -55,7 +54,7 @@ public class NFNotaInfoItemProduto extends NFBase { @Element(name = "vProd", required = true) private String valorTotalBruto; - @Element(name = "cEANTrib", required = false) + @Element(name = "cEANTrib", required = true) @Convert(StringNullConverter.class) private String codigoDeBarrasTributavel; diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRegimeEspecialTributacao.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRegimeEspecialTributacao.java index a8d2f352b..f410e69ab 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRegimeEspecialTributacao.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFNotaInfoRegimeEspecialTributacao.java @@ -11,7 +11,7 @@ public enum NFNotaInfoRegimeEspecialTributacao { private String codigo; - private NFNotaInfoRegimeEspecialTributacao(final String codigo) { + NFNotaInfoRegimeEspecialTributacao(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFOperacaoConsumidorFinal.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFOperacaoConsumidorFinal.java index 57547c43e..066b29f3a 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFOperacaoConsumidorFinal.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFOperacaoConsumidorFinal.java @@ -6,7 +6,7 @@ public enum NFOperacaoConsumidorFinal { private String codigo; - private NFOperacaoConsumidorFinal(final String codigo) { + NFOperacaoConsumidorFinal(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/classes/nota/NFViaTransporteInternacional.java b/src/main/java/com/fincatto/nfe310/classes/nota/NFViaTransporteInternacional.java index 13d3e2348..1b813ef86 100644 --- a/src/main/java/com/fincatto/nfe310/classes/nota/NFViaTransporteInternacional.java +++ b/src/main/java/com/fincatto/nfe310/classes/nota/NFViaTransporteInternacional.java @@ -17,7 +17,7 @@ public enum NFViaTransporteInternacional { private String codigo; - private NFViaTransporteInternacional(final String codigo) { + NFViaTransporteInternacional(final String codigo) { this.codigo = codigo; } diff --git a/src/main/java/com/fincatto/nfe310/utils/NFGeraChave.java b/src/main/java/com/fincatto/nfe310/utils/NFGeraChave.java index 827f11a29..5850cbbf6 100644 --- a/src/main/java/com/fincatto/nfe310/utils/NFGeraChave.java +++ b/src/main/java/com/fincatto/nfe310/utils/NFGeraChave.java @@ -1,8 +1,7 @@ package com.fincatto.nfe310.utils; -import org.apache.commons.lang3.StringUtils; - import com.fincatto.nfe310.classes.nota.NFNota; +import org.apache.commons.lang3.StringUtils; public class NFGeraChave { @@ -21,8 +20,8 @@ public Integer getDV() { final int[] valoresInt = { 2, 3, 4, 5, 6, 7, 8, 9 }; int indice = 0; int soma = 0; - int valorTemp = 0; - int multTemp = 0; + int valorTemp; + int multTemp; for (int i = valores.length; i > 0; i--) { if (indice >= valoresInt.length) { indice = 0; @@ -37,15 +36,13 @@ public Integer getDV() { } private String geraChaveAcessoSemDV() { - final StringBuilder chaveAcesso = new StringBuilder(); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getUf().getCodigoIbge(), 2, "0")); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getDataHoraEmissao().toString("yyMM"), 4, "0")); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getEmitente().getCnpj() == null ? this.nota.getInfo().getEmitente().getCpf() : this.nota.getInfo().getEmitente().getCnpj(), 14, "0")); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getModelo().getCodigo(), 2, "0")); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getSerie(), 3, "0")); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getNumeroNota(), 9, "0")); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getTipoEmissao().getCodigo(), 1, "0")); - chaveAcesso.append(StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getCodigoRandomico(), 8, "0")); - return chaveAcesso.toString(); + return StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getUf().getCodigoIbge(), 2, "0") + + StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getDataHoraEmissao().toString("yyMM"), 4, "0") + + StringUtils.leftPad(this.nota.getInfo().getEmitente().getCnpj() == null ? this.nota.getInfo().getEmitente().getCpf() : this.nota.getInfo().getEmitente().getCnpj(), 14, "0") + + StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getModelo().getCodigo(), 2, "0") + + StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getSerie(), 3, "0") + + StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getNumeroNota(), 9, "0") + + StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getTipoEmissao().getCodigo(), 1, "0") + + StringUtils.leftPad(this.nota.getInfo().getIdentificacao().getCodigoRandomico(), 8, "0"); } } \ No newline at end of file diff --git a/src/main/java/com/fincatto/nfe310/webservices/NFSocketFactory.java b/src/main/java/com/fincatto/nfe310/webservices/NFSocketFactory.java index d0c5e675b..31ff4ce4f 100644 --- a/src/main/java/com/fincatto/nfe310/webservices/NFSocketFactory.java +++ b/src/main/java/com/fincatto/nfe310/webservices/NFSocketFactory.java @@ -9,9 +9,7 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.X509KeyManager; -import java.io.ByteArrayInputStream; import java.io.IOException; -import java.io.InputStream; import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Socket; @@ -30,18 +28,10 @@ class NFSocketFactory implements ProtocolSocketFactory { private final SSLContext sslContext; - NFSocketFactory(final NFeConfig config) throws KeyManagementException, UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { + NFSocketFactory(final NFeConfig config) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException { this.sslContext = this.createSSLContext(config); } - private SSLContext createSSLContext(final NFeConfig config) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException, KeyManagementException, UnrecoverableKeyException { - final KeyManager[] keyManagers = this.createKeyManagers(config); - final TrustManager[] trustManagers = this.createTrustManagers(config); - final SSLContext sslContext = SSLContext.getInstance(config.getSSLProtocolo()); - sslContext.init(keyManagers, trustManagers, null); - return sslContext; - } - @Override public Socket createSocket(final String host, final int port, final InetAddress localAddress, final int localPort, final HttpConnectionParams params) throws IOException { final Socket socket = this.sslContext.getSocketFactory().createSocket(); @@ -60,27 +50,25 @@ public Socket createSocket(final String host, final int port) throws IOException return this.sslContext.getSocketFactory().createSocket(host, port); } + private SSLContext createSSLContext(final NFeConfig config) throws UnrecoverableKeyException, CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, KeyManagementException { + final KeyManager[] keyManagers = this.createKeyManagers(config); + final TrustManager[] trustManagers = this.createTrustManagers(config); + final SSLContext sslContext = SSLContext.getInstance(config.getSSLProtocolo()); + sslContext.init(keyManagers, trustManagers, null); + return sslContext; + } + private KeyManager[] createKeyManagers(final NFeConfig config) throws UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { - try (InputStream certificado = new ByteArrayInputStream(config.getCertificado())) { - final KeyStore ks = KeyStore.getInstance("PKCS12"); - ks.load(certificado, config.getCertificadoSenha().toCharArray()); - - final String alias = NFSocketFactory.getAlias(ks); - final X509Certificate certificate = (X509Certificate) ks.getCertificate(alias); - final PrivateKey privateKey = (PrivateKey) ks.getKey(alias, config.getCertificadoSenha().toCharArray()); - return new KeyManager[]{new HSKeyManager(certificate, privateKey)}; - } + final String alias = getAlias(config.getCertificadoKeyStore()); + final X509Certificate certificate = (X509Certificate) config.getCertificadoKeyStore().getCertificate(alias); + final PrivateKey privateKey = (PrivateKey) config.getCertificadoKeyStore().getKey(alias, config.getCertificadoSenha().toCharArray()); + return new KeyManager[]{new NFKeyManager(certificate, privateKey)}; } private TrustManager[] createTrustManagers(final NFeConfig config) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { - try (ByteArrayInputStream cadeia = new ByteArrayInputStream(config.getCadeiaCertificados())) { - final KeyStore trustStore = KeyStore.getInstance("JKS"); - trustStore.load(cadeia, config.getCadeiaCertificadosSenha().toCharArray()); - - final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - trustManagerFactory.init(trustStore); - return trustManagerFactory.getTrustManagers(); - } + final TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init(config.getCadeiaCertificadosKeyStore()); + return trustManagerFactory.getTrustManagers(); } private static String getAlias(final KeyStore ks) throws KeyStoreException { @@ -91,16 +79,16 @@ private static String getAlias(final KeyStore ks) throws KeyStoreException { return alias; } } - return ""; + throw new KeyStoreException("Nenhum alias encontrado no certificado"); } } -class HSKeyManager implements X509KeyManager { +class NFKeyManager implements X509KeyManager { private final X509Certificate certificate; private final PrivateKey privateKey; - HSKeyManager(final X509Certificate certificate, final PrivateKey privateKey) { + NFKeyManager(final X509Certificate certificate, final PrivateKey privateKey) { this.certificate = certificate; this.privateKey = privateKey; } diff --git a/src/main/java/com/fincatto/nfe310/webservices/WSFacade.java b/src/main/java/com/fincatto/nfe310/webservices/WSFacade.java index f55b67040..a193ea894 100755 --- a/src/main/java/com/fincatto/nfe310/webservices/WSFacade.java +++ b/src/main/java/com/fincatto/nfe310/webservices/WSFacade.java @@ -33,7 +33,6 @@ public class WSFacade { private final WSInutilizacao wsInutilizacao; public WSFacade(final NFeConfig config) throws IOException, KeyManagementException, UnrecoverableKeyException, KeyStoreException, NoSuchAlgorithmException, CertificateException { - // registra o protocolo e o socket factory correspondente Protocol.registerProtocol("https", new Protocol("https", new NFSocketFactory(config), 443)); // inicia os servicos disponiveis da nfe diff --git a/src/main/java/com/fincatto/nfe310/webservices/gerado/CadConsultaCadastro2Stub.java b/src/main/java/com/fincatto/nfe310/webservices/gerado/CadConsultaCadastro2Stub.java index 3c00168a9..4394a68b5 100644 --- a/src/main/java/com/fincatto/nfe310/webservices/gerado/CadConsultaCadastro2Stub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/gerado/CadConsultaCadastro2Stub.java @@ -1,11 +1,13 @@ package com.fincatto.nfe310.webservices.gerado; -import java.io.Serializable; -import java.lang.reflect.Constructor; - import org.apache.axiom.om.OMAttribute; import org.apache.axis2.client.Stub; +import org.apache.axis2.databinding.utils.Constants; + +import javax.xml.namespace.QName; +import java.io.Serializable; +import java.lang.reflect.Constructor; /* * CadConsultaCadastro2Stub java implementation @@ -159,26 +161,11 @@ public CadConsultaCadastro2Stub.ConsultaCadastro2Result consultaCadastro2( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "consultaCadastro2")); final Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -196,7 +183,7 @@ public CadConsultaCadastro2Stub.ConsultaCadastro2Result consultaCadastro2( } private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); + final java.util.Map returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { @@ -213,8 +200,8 @@ private boolean optimizeContent(final javax.xml.namespace.QName opName) { if (this.opNameArray == null) { return false; } - for (int i = 0; i < this.opNameArray.length; i++) { - if (opName.equals(this.opNameArray[i])) { + for (QName anOpNameArray : this.opNameArray) { + if (opName.equals(anOpNameArray)) { return true; } } @@ -318,12 +305,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -344,8 +331,8 @@ public void serialize(final javax.xml.namespace.QName parentQName, final javax.x } if (this.localExtraAttributes != null) { - for (int i = 0; i < this.localExtraAttributes.length; i++) { - this.writeAttribute(this.localExtraAttributes[i].getNamespace().getNamespaceURI(), this.localExtraAttributes[i].getLocalName(), this.localExtraAttributes[i].getAttributeValue(), xmlWriter); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + this.writeAttribute(localExtraAttribute.getNamespace().getNamespaceURI(), localExtraAttribute.getLocalName(), localExtraAttribute.getAttributeValue(), xmlWriter); } } if (this.localVersaoDadosTracker) { @@ -448,8 +435,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); + final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localVersaoDadosTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/CadConsultaCadastro2", "versaoDados")); @@ -469,9 +456,9 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("cUF cannot be null!!"); } } - for (int i = 0; i < this.localExtraAttributes.length; i++) { - attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); - attribList.add(this.localExtraAttributes[i]); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + attribList.add(Constants.OM_ATTRIBUTE_KEY); + attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); @@ -494,7 +481,7 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -625,12 +612,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -719,12 +706,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -807,7 +794,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { @@ -836,7 +823,7 @@ public static ConsultaCadastro2Result parse(final javax.xml.stream.XMLStreamRead final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -939,12 +926,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -1027,7 +1014,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { @@ -1056,7 +1043,7 @@ public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; diff --git a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeAutorizacaoStub.java b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeAutorizacaoStub.java index df59e35ce..9ae44b685 100644 --- a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeAutorizacaoStub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeAutorizacaoStub.java @@ -1,13 +1,15 @@ package com.fincatto.nfe310.webservices.gerado; +import org.apache.axiom.om.OMAttribute; +import org.apache.axis2.client.Stub; +import org.apache.axis2.databinding.utils.Constants; + +import javax.xml.namespace.QName; import java.io.Serializable; import java.lang.reflect.Constructor; import java.util.ArrayList; -import org.apache.axiom.om.OMAttribute; -import org.apache.axis2.client.Stub; - /* * NfeAutorizacaoStub java implementation */ @@ -167,26 +169,11 @@ public NfeAutorizacaoStub.NfeAutorizacaoLoteZipResult nfeAutorizacaoLoteZip( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeAutorizacaoLoteZip")); final Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -269,26 +256,11 @@ public NfeAutorizacaoStub.NfeAutorizacaoLoteResult nfeAutorizacaoLote( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeAutorizacaoLote")); final Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -306,7 +278,7 @@ public NfeAutorizacaoStub.NfeAutorizacaoLoteResult nfeAutorizacaoLote( } private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); + final java.util.Map returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { @@ -323,8 +295,8 @@ private boolean optimizeContent(final javax.xml.namespace.QName opName) { if (this.opNameArray == null) { return false; } - for (int i = 0; i < this.opNameArray.length; i++) { - if (opName.equals(this.opNameArray[i])) { + for (QName anOpNameArray : this.opNameArray) { + if (opName.equals(anOpNameArray)) { return true; } } @@ -358,12 +330,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -446,7 +418,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); elementList.add(this.localExtraElement); @@ -454,7 +426,7 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList().toArray()); + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList<>().toArray()); } @@ -473,7 +445,7 @@ public static NfeAutorizacaoLoteZipResult parse(final javax.xml.stream.XMLStream final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -564,12 +536,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -658,12 +630,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -746,7 +718,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); elementList.add(this.localExtraElement); @@ -754,7 +726,7 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList().toArray()); + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList<>().toArray()); } @@ -773,7 +745,7 @@ public static NfeAutorizacaoLoteResult parse(final javax.xml.stream.XMLStreamRea final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -935,12 +907,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -961,8 +933,8 @@ public void serialize(final javax.xml.namespace.QName parentQName, final javax.x } if (this.localExtraAttributes != null) { - for (int i = 0; i < this.localExtraAttributes.length; i++) { - this.writeAttribute(this.localExtraAttributes[i].getNamespace().getNamespaceURI(), this.localExtraAttributes[i].getLocalName(), this.localExtraAttributes[i].getAttributeValue(), xmlWriter); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + this.writeAttribute(localExtraAttribute.getNamespace().getNamespaceURI(), localExtraAttribute.getLocalName(), localExtraAttribute.getAttributeValue(), xmlWriter); } } if (this.localCUFTracker) { @@ -1065,8 +1037,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); + final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeAutorizacao", "cUF")); @@ -1086,9 +1058,9 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("versaoDados cannot be null!!"); } } - for (int i = 0; i < this.localExtraAttributes.length; i++) { - attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); - attribList.add(this.localExtraAttributes[i]); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + attribList.add(Constants.OM_ATTRIBUTE_KEY); + attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); @@ -1111,7 +1083,7 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -1257,12 +1229,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -1428,12 +1400,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -1515,7 +1487,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); elementList.add(this.localExtraElement); @@ -1523,7 +1495,7 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new ArrayList().toArray()); + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new ArrayList<>().toArray()); } @@ -1542,7 +1514,7 @@ public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; diff --git a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeConsulta2Stub.java b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeConsulta2Stub.java index d56b928aa..3eb1313f6 100644 --- a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeConsulta2Stub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeConsulta2Stub.java @@ -1,10 +1,12 @@ package com.fincatto.nfe310.webservices.gerado; -import java.io.Serializable; -import java.lang.reflect.Constructor; - import org.apache.axiom.om.OMAttribute; import org.apache.axis2.client.Stub; +import org.apache.axis2.databinding.utils.Constants; + +import javax.xml.namespace.QName; +import java.io.Serializable; +import java.lang.reflect.Constructor; /* * NfeConsulta2Stub java implementation @@ -158,26 +160,11 @@ public NfeConsulta2Stub.NfeConsultaNF2Result nfeConsultaNF2( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeConsultaNF2")); final Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -195,7 +182,7 @@ public NfeConsulta2Stub.NfeConsultaNF2Result nfeConsultaNF2( } private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); + final java.util.Map returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { @@ -212,8 +199,8 @@ private boolean optimizeContent(final javax.xml.namespace.QName opName) { if (this.opNameArray == null) { return false; } - for (int i = 0; i < this.opNameArray.length; i++) { - if (opName.equals(this.opNameArray[i])) { + for (QName anOpNameArray : this.opNameArray) { + if (opName.equals(anOpNameArray)) { return true; } } @@ -317,12 +304,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -343,8 +330,8 @@ public void serialize(final javax.xml.namespace.QName parentQName, final javax.x } if (this.localExtraAttributes != null) { - for (int i = 0; i < this.localExtraAttributes.length; i++) { - this.writeAttribute(this.localExtraAttributes[i].getNamespace().getNamespaceURI(), this.localExtraAttributes[i].getLocalName(), this.localExtraAttributes[i].getAttributeValue(), xmlWriter); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + this.writeAttribute(localExtraAttribute.getNamespace().getNamespaceURI(), localExtraAttribute.getLocalName(), localExtraAttribute.getAttributeValue(), xmlWriter); } } if (this.localCUFTracker) { @@ -447,8 +434,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); + final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "cUF")); @@ -468,9 +455,9 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("versaoDados cannot be null!!"); } } - for (int i = 0; i < this.localExtraAttributes.length; i++) { - attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); - attribList.add(this.localExtraAttributes[i]); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + attribList.add(Constants.OM_ATTRIBUTE_KEY); + attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); @@ -493,7 +480,7 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -624,12 +611,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -712,7 +699,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); elementList.add(this.localExtraElement); @@ -720,7 +707,7 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList().toArray()); + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList<>().toArray()); } @@ -739,7 +726,7 @@ public static NfeConsultaNF2Result parse(final javax.xml.stream.XMLStreamReader final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -830,12 +817,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -939,12 +926,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -1027,7 +1014,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); elementList.add(this.localExtraElement); @@ -1035,7 +1022,7 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList().toArray()); + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), new java.util.ArrayList<>().toArray()); } @@ -1054,7 +1041,7 @@ public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; diff --git a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeInutilizacao2Stub.java b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeInutilizacao2Stub.java index 663ca4376..b2dc119ea 100644 --- a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeInutilizacao2Stub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeInutilizacao2Stub.java @@ -1,10 +1,12 @@ package com.fincatto.nfe310.webservices.gerado; -import java.io.Serializable; -import java.lang.reflect.Constructor; - import org.apache.axiom.om.OMAttribute; import org.apache.axis2.client.Stub; +import org.apache.axis2.databinding.utils.Constants; + +import javax.xml.namespace.QName; +import java.io.Serializable; +import java.lang.reflect.Constructor; public class NfeInutilizacao2Stub extends org.apache.axis2.client.Stub { protected org.apache.axis2.description.AxisOperation[] _operations; @@ -154,26 +156,11 @@ public NfeInutilizacao2Stub.NfeInutilizacaoNF2Result nfeInutilizacaoNF2( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeInutilizacaoNF2")); final Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -191,7 +178,7 @@ public NfeInutilizacao2Stub.NfeInutilizacaoNF2Result nfeInutilizacaoNF2( } private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); + final java.util.Map returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { @@ -208,8 +195,8 @@ private boolean optimizeContent(final javax.xml.namespace.QName opName) { if (this.opNameArray == null) { return false; } - for (int i = 0; i < this.opNameArray.length; i++) { - if (opName.equals(this.opNameArray[i])) { + for (QName anOpNameArray : this.opNameArray) { + if (opName.equals(anOpNameArray)) { return true; } } @@ -243,12 +230,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -331,7 +318,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); @@ -358,7 +345,7 @@ public static NfeInutilizacaoNF2Result parse(final javax.xml.stream.XMLStreamRea final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -448,12 +435,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -557,12 +544,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -645,7 +632,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); @@ -673,7 +660,7 @@ public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -831,12 +818,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -857,8 +844,8 @@ public void serialize(final javax.xml.namespace.QName parentQName, final javax.x } if (this.localExtraAttributes != null) { - for (int i = 0; i < this.localExtraAttributes.length; i++) { - this.writeAttribute(this.localExtraAttributes[i].getNamespace().getNamespaceURI(), this.localExtraAttributes[i].getLocalName(), this.localExtraAttributes[i].getAttributeValue(), xmlWriter); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + this.writeAttribute(localExtraAttribute.getNamespace().getNamespaceURI(), localExtraAttribute.getLocalName(), localExtraAttribute.getAttributeValue(), xmlWriter); } } if (this.localCUFTracker) { @@ -961,8 +948,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); + final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeInutilizacao2", "cUF")); @@ -982,9 +969,9 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("versaoDados cannot be null!!"); } } - for (int i = 0; i < this.localExtraAttributes.length; i++) { - attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); - attribList.add(this.localExtraAttributes[i]); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + attribList.add(Constants.OM_ATTRIBUTE_KEY); + attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); @@ -1007,7 +994,7 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; diff --git a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeRetAutorizacaoStub.java b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeRetAutorizacaoStub.java index 45697e944..8626884dd 100644 --- a/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeRetAutorizacaoStub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/gerado/NfeRetAutorizacaoStub.java @@ -1,11 +1,13 @@ package com.fincatto.nfe310.webservices.gerado; -import java.io.Serializable; -import java.lang.reflect.Constructor; - import org.apache.axiom.om.OMAttribute; import org.apache.axis2.client.Stub; +import org.apache.axis2.databinding.utils.Constants; + +import javax.xml.namespace.QName; +import java.io.Serializable; +import java.lang.reflect.Constructor; /* * NfeRetAutorizacaoStub java implementation @@ -159,26 +161,11 @@ public NfeRetAutorizacaoStub.NfeRetAutorizacaoLoteResult nfeRetAutorizacaoLote( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeRetAutorizacaoLote")); final Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -196,7 +183,7 @@ public NfeRetAutorizacaoStub.NfeRetAutorizacaoLoteResult nfeRetAutorizacaoLote( } private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); + final java.util.Map returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { @@ -213,8 +200,8 @@ private boolean optimizeContent(final javax.xml.namespace.QName opName) { if (this.opNameArray == null) { return false; } - for (int i = 0; i < this.opNameArray.length; i++) { - if (opName.equals(this.opNameArray[i])) { + for (QName anOpNameArray : this.opNameArray) { + if (opName.equals(anOpNameArray)) { return true; } } @@ -318,12 +305,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -344,8 +331,8 @@ public void serialize(final javax.xml.namespace.QName parentQName, final javax.x } if (this.localExtraAttributes != null) { - for (int i = 0; i < this.localExtraAttributes.length; i++) { - this.writeAttribute(this.localExtraAttributes[i].getNamespace().getNamespaceURI(), this.localExtraAttributes[i].getLocalName(), this.localExtraAttributes[i].getAttributeValue(), xmlWriter); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + this.writeAttribute(localExtraAttribute.getNamespace().getNamespaceURI(), localExtraAttribute.getLocalName(), localExtraAttribute.getAttributeValue(), xmlWriter); } } if (this.localCUFTracker) { @@ -448,8 +435,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); + final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeRetAutorizacao", "cUF")); @@ -469,9 +456,9 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("versaoDados cannot be null!!"); } } - for (int i = 0; i < this.localExtraAttributes.length; i++) { - attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); - attribList.add(this.localExtraAttributes[i]); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + attribList.add(Constants.OM_ATTRIBUTE_KEY); + attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); @@ -494,7 +481,7 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -626,12 +613,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -735,12 +722,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -823,7 +810,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { @@ -852,7 +839,7 @@ public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -943,12 +930,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -1031,7 +1018,7 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localExtraElement != null) { @@ -1059,7 +1046,7 @@ public static NfeRetAutorizacaoLoteResult parse(final javax.xml.stream.XMLStream final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; diff --git a/src/main/java/com/fincatto/nfe310/webservices/gerado/RecepcaoEventoStub.java b/src/main/java/com/fincatto/nfe310/webservices/gerado/RecepcaoEventoStub.java index 7f00b5e19..cd1853332 100644 --- a/src/main/java/com/fincatto/nfe310/webservices/gerado/RecepcaoEventoStub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/gerado/RecepcaoEventoStub.java @@ -1,15 +1,17 @@ package com.fincatto.nfe310.webservices.gerado; +import org.apache.axiom.om.OMAttribute; +import org.apache.axis2.client.Stub; +import org.apache.axis2.databinding.utils.Constants; + +import javax.xml.namespace.QName; import java.io.Serializable; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; import java.util.Vector; -import org.apache.axiom.om.OMAttribute; -import org.apache.axis2.client.Stub; - /* * RecepcaoEventoStub java implementation */ @@ -162,26 +164,11 @@ public RecepcaoEventoStub.NfeRecepcaoEventoResult nfeRecepcaoEvento( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeRecepcaoEvento")); final Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -199,7 +186,7 @@ public RecepcaoEventoStub.NfeRecepcaoEventoResult nfeRecepcaoEvento( } private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { - final java.util.Map returnMap = new java.util.HashMap(); + final java.util.Map returnMap = new java.util.HashMap<>(); @SuppressWarnings("rawtypes") final java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); while (namespaceIterator.hasNext()) { @@ -216,8 +203,8 @@ private boolean optimizeContent(final javax.xml.namespace.QName opName) { if (this.opNameArray == null) { return false; } - for (int i = 0; i < this.opNameArray.length; i++) { - if (opName.equals(this.opNameArray[i])) { + for (QName anOpNameArray : this.opNameArray) { + if (opName.equals(anOpNameArray)) { return true; } } @@ -251,12 +238,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -339,8 +326,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final List elementList = new ArrayList(); - final List attribList = new ArrayList(); + final List elementList = new ArrayList<>(); + final List attribList = new ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); @@ -368,7 +355,7 @@ public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -474,12 +461,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -562,8 +549,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final List elementList = new ArrayList(); - final List attribList = new ArrayList(); + final List elementList = new ArrayList<>(); + final List attribList = new ArrayList<>(); if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); @@ -591,7 +578,7 @@ public static NfeRecepcaoEventoResult parse(final javax.xml.stream.XMLStreamRead final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -682,12 +669,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -846,12 +833,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -872,8 +859,8 @@ public void serialize(final javax.xml.namespace.QName parentQName, final javax.x } if (this.localExtraAttributes != null) { - for (int i = 0; i < this.localExtraAttributes.length; i++) { - this.writeAttribute(this.localExtraAttributes[i].getNamespace().getNamespaceURI(), this.localExtraAttributes[i].getLocalName(), this.localExtraAttributes[i].getAttributeValue(), xmlWriter); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + this.writeAttribute(localExtraAttribute.getNamespace().getNamespaceURI(), localExtraAttribute.getLocalName(), localExtraAttribute.getAttributeValue(), xmlWriter); } } if (this.localCUFTracker) { @@ -976,8 +963,8 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - final java.util.ArrayList elementList = new java.util.ArrayList(); - final java.util.ArrayList attribList = new java.util.ArrayList(); + final java.util.ArrayList elementList = new java.util.ArrayList<>(); + final java.util.ArrayList attribList = new java.util.ArrayList<>(); if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/RecepcaoEvento", "cUF")); @@ -997,9 +984,9 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. throw new org.apache.axis2.databinding.ADBException("versaoDados cannot be null!!"); } } - for (int i = 0; i < this.localExtraAttributes.length; i++) { - attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); - attribList.add(this.localExtraAttributes[i]); + for (OMAttribute localExtraAttribute : this.localExtraAttributes) { + attribList.add(Constants.OM_ATTRIBUTE_KEY); + attribList.add(localExtraAttribute); } return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); @@ -1022,7 +1009,7 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; diff --git a/src/main/java/com/fincatto/nfe310/webservices/nota/consulta/NfeConsulta2Stub.java b/src/main/java/com/fincatto/nfe310/webservices/nota/consulta/NfeConsulta2Stub.java index c5806e84a..9115293fa 100755 --- a/src/main/java/com/fincatto/nfe310/webservices/nota/consulta/NfeConsulta2Stub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/nota/consulta/NfeConsulta2Stub.java @@ -6,11 +6,11 @@ */ package com.fincatto.nfe310.webservices.nota.consulta; -import javax.xml.namespace.QName; - import org.apache.axiom.om.OMAttribute; import org.apache.axis2.client.Stub; +import javax.xml.namespace.QName; + /* * NfeConsulta2Stub java implementation */ @@ -21,9 +21,9 @@ class NfeConsulta2Stub extends org.apache.axis2.client.Stub { private final java.util.HashMap faultExceptionNameMap = new java.util.HashMap(); private final java.util.HashMap faultExceptionClassNameMap = new java.util.HashMap(); private final java.util.HashMap faultMessageMap = new java.util.HashMap(); - + private static int counter = 0; - + private static synchronized java.lang.String getUniqueSuffix() { // reset the counter if it is greater than 99999 if (NfeConsulta2Stub.counter > 99999) { @@ -32,7 +32,7 @@ private static synchronized java.lang.String getUniqueSuffix() { NfeConsulta2Stub.counter = NfeConsulta2Stub.counter + 1; return java.lang.Long.toString(java.lang.System.currentTimeMillis()) + "_" + NfeConsulta2Stub.counter; } - + private void populateAxisService() throws org.apache.axis2.AxisFault { this._service = new org.apache.axis2.description.AxisService("NfeConsulta2" + NfeConsulta2Stub.getUniqueSuffix()); this.addAnonymousOperations(); @@ -43,14 +43,14 @@ private void populateAxisService() throws org.apache.axis2.AxisFault { this._service.addOperation(__operation); this._operations[0] = __operation; } - + private void populateFaults() { } - + public NfeConsulta2Stub(final org.apache.axis2.context.ConfigurationContext configurationContext, final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { this(configurationContext, targetEndpoint, false); } - + public NfeConsulta2Stub(final org.apache.axis2.context.ConfigurationContext configurationContext, final java.lang.String targetEndpoint, final boolean useSeparateListener) throws org.apache.axis2.AxisFault { this.populateAxisService(); this.populateFaults(); @@ -59,70 +59,70 @@ public NfeConsulta2Stub(final org.apache.axis2.context.ConfigurationContext conf this._serviceClient.getOptions().setUseSeparateListener(useSeparateListener); this._serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI); } - + public NfeConsulta2Stub(final org.apache.axis2.context.ConfigurationContext configurationContext) throws org.apache.axis2.AxisFault { this(configurationContext, "https://nfe.sefaz.rs.gov.br/ws/nfeConsulta/nfeConsulta2.asmx"); } - + public NfeConsulta2Stub() throws org.apache.axis2.AxisFault { this("https://nfe.sefaz.rs.gov.br/ws/nfeConsulta/nfeConsulta2.asmx"); } - + public NfeConsulta2Stub(final java.lang.String targetEndpoint) throws org.apache.axis2.AxisFault { this(null, targetEndpoint); } - + public NfeConsulta2Stub.NfeConsultaNF2Result nfeConsultaNF2( - + final NfeConsulta2Stub.NfeDadosMsg nfeDadosMsg0, final NfeConsulta2Stub.NfeCabecMsgE nfeCabecMsg1) - + throws java.rmi.RemoteException { org.apache.axis2.context.MessageContext _messageContext = null; try { org.apache.axis2.client.OperationClient _operationClient = this._serviceClient.createClient(this._operations[0].getName()); _operationClient.getOptions().setAction("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2/nfeConsultaNF2"); _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - + this.addPropertyToOperationClient(_operationClient, org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, "&"); - + // create a message context _messageContext = new org.apache.axis2.context.MessageContext(); - + // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env = null; - + env = this.toEnvelope(Stub.getFactory(_operationClient.getOptions().getSoapVersionURI()), nfeDadosMsg0, this.optimizeContent(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeConsultaNF2")), new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeConsultaNF2")); - + env.build(); - + // add the children only if the parameter is not null if (nfeCabecMsg1 != null) { - + org.apache.axiom.om.OMElement omElementnfeCabecMsg1 = this.toOM(nfeCabecMsg1, this.optimizeContent(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeConsultaNF2"))); this.addHeader(omElementnfeCabecMsg1, env); - + } - + // adding SOAP soap_headers this._serviceClient.addHeadersToEnvelope(env); // set the message context with that soap envelope _messageContext.setEnvelope(env); - + // add the message contxt to the operation client _operationClient.addMessageContext(_messageContext); - + // execute the operation client _operationClient.execute(true); - + org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); - + java.lang.Object object = this.fromOM(_returnEnv.getBody().getFirstElement(), NfeConsulta2Stub.NfeConsultaNF2Result.class, this.getEnvelopeNamespaces(_returnEnv)); - + return (NfeConsulta2Stub.NfeConsultaNF2Result) object; - + } catch (org.apache.axis2.AxisFault f) { - + org.apache.axiom.om.OMElement faultElt = f.getDetail(); if (faultElt != null) { if (this.faultExceptionNameMap.containsKey(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeConsultaNF2"))) { @@ -136,26 +136,11 @@ public NfeConsulta2Stub.NfeConsultaNF2Result nfeConsultaNF2( java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeConsultaNF2")); java.lang.Class messageClass = java.lang.Class.forName(messageClassName); java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); - + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); + throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (java.lang.InstantiationException e) { + } catch (ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -171,59 +156,59 @@ public NfeConsulta2Stub.NfeConsultaNF2Result nfeConsultaNF2( } } } - + public void startnfeConsultaNF2( - - final NfeConsulta2Stub.NfeDadosMsg nfeDadosMsg0, final NfeConsulta2Stub.NfeCabecMsgE nfeCabecMsg1, - - final NfeConsulta2CallbackHandler callback) - - throws java.rmi.RemoteException { - + + final NfeConsulta2Stub.NfeDadosMsg nfeDadosMsg0, final NfeConsulta2Stub.NfeCabecMsgE nfeCabecMsg1, + + final NfeConsulta2CallbackHandler callback) + + throws java.rmi.RemoteException { + org.apache.axis2.client.OperationClient _operationClient = this._serviceClient.createClient(this._operations[0].getName()); _operationClient.getOptions().setAction("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2/nfeConsultaNF2"); _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); - + this.addPropertyToOperationClient(_operationClient, org.apache.axis2.description.WSDL2Constants.ATTR_WHTTP_QUERY_PARAMETER_SEPARATOR, "&"); - + // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env = null; final org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext(); - + // Style is Doc. - + env = this.toEnvelope(Stub.getFactory(_operationClient.getOptions().getSoapVersionURI()), nfeDadosMsg0, this.optimizeContent(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeConsultaNF2")), new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeConsultaNF2")); - + // add the soap_headers only if they are not null if (nfeCabecMsg1 != null) { - + org.apache.axiom.om.OMElement omElementnfeCabecMsg1 = this.toOM(nfeCabecMsg1, this.optimizeContent(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeConsultaNF2"))); this.addHeader(omElementnfeCabecMsg1, env); - + } - + // adding SOAP soap_headers this._serviceClient.addHeadersToEnvelope(env); // create message context with that soap envelope _messageContext.setEnvelope(env); - + // add the message context to the operation client _operationClient.addMessageContext(_messageContext); - + _operationClient.setCallback(new org.apache.axis2.client.async.AxisCallback() { @Override public void onMessage(final org.apache.axis2.context.MessageContext resultContext) { try { org.apache.axiom.soap.SOAPEnvelope resultEnv = resultContext.getEnvelope(); - + java.lang.Object object = NfeConsulta2Stub.this.fromOM(resultEnv.getBody().getFirstElement(), NfeConsulta2Stub.NfeConsultaNF2Result.class, NfeConsulta2Stub.this.getEnvelopeNamespaces(resultEnv)); callback.receiveResultnfeConsultaNF2((NfeConsulta2Stub.NfeConsultaNF2Result) object); - + } catch (org.apache.axis2.AxisFault e) { callback.receiveErrornfeConsultaNF2(e); } } - + @Override public void onError(final java.lang.Exception error) { if (error instanceof org.apache.axis2.AxisFault) { @@ -241,29 +226,11 @@ public void onError(final java.lang.Exception error) { java.lang.String messageClassName = (java.lang.String) NfeConsulta2Stub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeConsultaNF2")); java.lang.Class messageClass = java.lang.Class.forName(messageClassName); java.lang.Object messageObject = NfeConsulta2Stub.this.fromOM(faultElt, messageClass, null); - java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); - + java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); + callback.receiveErrornfeConsultaNF2(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch (java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeConsultaNF2(f); - } catch (java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeConsultaNF2(f); - } catch (java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeConsultaNF2(f); - } catch (java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeConsultaNF2(f); - } catch (java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeConsultaNF2(f); - } catch (java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeConsultaNF2(f); - } catch (org.apache.axis2.AxisFault e) { + } catch (ClassCastException | org.apache.axis2.AxisFault | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrornfeConsultaNF2(f); } @@ -277,13 +244,13 @@ public void onError(final java.lang.Exception error) { callback.receiveErrornfeConsultaNF2(error); } } - + @Override public void onFault(final org.apache.axis2.context.MessageContext faultContext) { org.apache.axis2.AxisFault fault = org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(faultContext); this.onError(fault); } - + @Override public void onComplete() { try { @@ -293,18 +260,18 @@ public void onComplete() { } } }); - + org.apache.axis2.util.CallbackReceiver _callbackReceiver = null; if (this._operations[0].getMessageReceiver() == null && _operationClient.getOptions().isUseSeparateListener()) { _callbackReceiver = new org.apache.axis2.util.CallbackReceiver(); this._operations[0].setMessageReceiver(_callbackReceiver); } - + // execute the operation client _operationClient.execute(false); - + } - + private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnvelope env) { java.util.Map returnMap = new java.util.HashMap(); java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); @@ -314,11 +281,11 @@ private java.util.Map getEnvelopeNamespaces(final org.apache.axiom.soap.SOAPEnve } return returnMap; } - + private final javax.xml.namespace.QName[] opNameArray = null; - + private boolean optimizeContent(final javax.xml.namespace.QName opName) { - + if (this.opNameArray == null) { return false; } @@ -329,127 +296,127 @@ private boolean optimizeContent(final javax.xml.namespace.QName opName) { } return false; } - + // https://nfe.sefaz.rs.gov.br/ws/nfeConsulta/nfeConsulta2.asmx public static class NfeCabecMsg implements org.apache.axis2.databinding.ADBBean { /* * This type was generated from the piece of schema that had name = nfeCabecMsg Namespace URI = http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2 Namespace Prefix = ns1 */ - + protected java.lang.String localCUF; - + /* * This tracker boolean wil be used to detect whether the user called the set method for this attribute. It will be used to determine whether to include this field in the serialized XML */ protected boolean localCUFTracker = false; - + public boolean isCUFSpecified() { return this.localCUFTracker; } - + public java.lang.String getCUF() { return this.localCUF; } - + public void setCUF(final java.lang.String param) { this.localCUFTracker = param != null; - + this.localCUF = param; - + } - + protected java.lang.String localVersaoDados; - + /* * This tracker boolean wil be used to detect whether the user called the set method for this attribute. It will be used to determine whether to include this field in the serialized XML */ protected boolean localVersaoDadosTracker = false; - + public boolean isVersaoDadosSpecified() { return this.localVersaoDadosTracker; } - + public java.lang.String getVersaoDados() { return this.localVersaoDados; } - + public void setVersaoDados(final java.lang.String param) { this.localVersaoDadosTracker = param != null; - + this.localVersaoDados = param; - + } - + protected org.apache.axiom.om.OMAttribute[] localExtraAttributes; - + public org.apache.axiom.om.OMAttribute[] getExtraAttributes() { return this.localExtraAttributes; } - + protected void validateExtraAttributes(final org.apache.axiom.om.OMAttribute[] param) { - + if (param != null && param.length > 1) { throw new java.lang.RuntimeException(); } - + if (param != null && param.length < 1) { throw new java.lang.RuntimeException(); } - + } - + public void setExtraAttributes(final org.apache.axiom.om.OMAttribute[] param) { - + this.validateExtraAttributes(param); - + this.localExtraAttributes = param; } - + public void addExtraAttributes(final org.apache.axiom.om.OMAttribute param) { if (this.localExtraAttributes == null) { this.localExtraAttributes = new org.apache.axiom.om.OMAttribute[] {}; } - + java.util.List list = org.apache.axis2.databinding.utils.ConverterUtil.toList(this.localExtraAttributes); list.add(param); this.localExtraAttributes = (org.apache.axiom.om.OMAttribute[]) list.toArray(new org.apache.axiom.om.OMAttribute[list.size()]); - + } - + @Override public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - + org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this, parentQName); return factory.createOMElement(dataSource, parentQName); - + } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { - + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = null; java.lang.String namespace = null; - + prefix = parentQName.getPrefix(); namespace = parentQName.getNamespaceURI(); this.writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - + if (serializeType) { - + java.lang.String namespacePrefix = this.registerPrefix(xmlWriter, "http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2"); if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":nfeCabecMsg", xmlWriter); } else { this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "nfeCabecMsg", xmlWriter); } - + } - + if (this.localExtraAttributes != null) { for (OMAttribute localExtraAttribute : this.localExtraAttributes) { this.writeAttribute(localExtraAttribute.getNamespace().getName(), localExtraAttribute.getLocalName(), localExtraAttribute.getAttributeValue(), xmlWriter); @@ -458,48 +425,48 @@ public void serialize(final javax.xml.namespace.QName parentQName, final javax.x if (this.localCUFTracker) { namespace = "http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2"; this.writeStartElement(null, namespace, "cUF", xmlWriter); - + if (this.localCUF == null) { // write the nil attribute - + throw new org.apache.axis2.databinding.ADBException("cUF cannot be null!!"); - + } else { - + xmlWriter.writeCharacters(this.localCUF); - + } - + xmlWriter.writeEndElement(); } if (this.localVersaoDadosTracker) { namespace = "http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2"; this.writeStartElement(null, namespace, "versaoDados", xmlWriter); - + if (this.localVersaoDados == null) { // write the nil attribute - + throw new org.apache.axis2.databinding.ADBException("versaoDados cannot be null!!"); - + } else { - + xmlWriter.writeCharacters(this.localVersaoDados); - + } - + xmlWriter.writeEndElement(); } xmlWriter.writeEndElement(); - + } - + private static java.lang.String generatePrefix(final java.lang.String namespace) { if (namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2")) { return "ns1"; } return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } - + private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, final java.lang.String localPart, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { @@ -510,13 +477,13 @@ private void writeStartElement(java.lang.String prefix, final java.lang.String n } else if (prefix == null) { prefix = NfeCabecMsg.generatePrefix(namespace); } - + xmlWriter.writeStartElement(prefix, localPart, namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } } - + private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); @@ -524,7 +491,7 @@ private void writeAttribute(final java.lang.String prefix, final java.lang.Strin } xmlWriter.writeAttribute(namespace, attName, attValue); } - + private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attValue); @@ -533,9 +500,9 @@ private void writeAttribute(final java.lang.String namespace, final java.lang.St xmlWriter.writeAttribute(namespace, attName, attValue); } } - + private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { @@ -547,7 +514,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la } else { attributeValue = qname.getLocalPart(); } - + if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { @@ -555,7 +522,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la xmlWriter.writeAttribute(namespace, attName, attributeValue); } } - + private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { @@ -565,28 +532,28 @@ private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.s xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } - + } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } - + private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; - + for (int i = 0; i < qnames.length; i++) { if (i > 0) { stringToWrite.append(" "); @@ -599,7 +566,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } else { @@ -611,9 +578,9 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x } xmlWriter.writeCharacters(stringToWrite.toString()); } - + } - + private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { @@ -631,16 +598,16 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x } return prefix; } - + @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - + java.util.ArrayList elementList = new java.util.ArrayList(); java.util.ArrayList attribList = new java.util.ArrayList(); - + if (this.localCUFTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "cUF")); - + if (this.localCUF != null) { elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localCUF)); } else { @@ -649,7 +616,7 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. } if (this.localVersaoDadosTracker) { elementList.add(new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "versaoDados")); - + if (this.localVersaoDados != null) { elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(this.localVersaoDados)); } else { @@ -660,51 +627,51 @@ public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace. attribList.add(org.apache.axis2.databinding.utils.Constants.OM_ATTRIBUTE_KEY); attribList.add(localExtraAttribute); } - + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - + } - + public static class Factory { - + public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { NfeCabecMsg object = new NfeCabecMsg(); - + int event; java.lang.String nillableValue = null; java.lang.String prefix = ""; java.lang.String namespaceuri = ""; try { - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; - + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - + if (!"nfeCabecMsg".equals(type)) { // find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (NfeCabecMsg) ExtensionMapper.getTypeObject(nsUri, type, reader); } - + } - + } - + // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); - + // now run through all any or extra attributes // which were not reflected until now for (int i = 0; i < reader.getAttributeCount(); i++) { @@ -713,149 +680,149 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t // an OMAttribute for this org.apache.axiom.om.OMFactory factory = org.apache.axiom.om.OMAbstractFactory.getOMFactory(); org.apache.axiom.om.OMAttribute attr = factory.createOMAttribute(reader.getAttributeLocalName(i), factory.createOMNamespace(reader.getAttributeNamespace(i), reader.getAttributePrefix(i)), reader.getAttributeValue(i)); - + // and add it to the extra attributes - + object.addExtraAttributes(attr); - + } } - + reader.next(); - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "cUF").equals(reader.getName())) { - + nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); if ("true".equals(nillableValue) || "1".equals(nillableValue)) { throw new org.apache.axis2.databinding.ADBException("The element: " + "cUF" + " cannot be null"); } - + java.lang.String content = reader.getElementText(); - + object.setCUF(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - + reader.next(); - + } // End of if for expected property start element - + else { - + } - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "versaoDados").equals(reader.getName())) { - + nillableValue = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "nil"); if ("true".equals(nillableValue) || "1".equals(nillableValue)) { throw new org.apache.axis2.databinding.ADBException("The element: " + "versaoDados" + " cannot be null"); } - + java.lang.String content = reader.getElementText(); - + object.setVersaoDados(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); - + reader.next(); - + } // End of if for expected property start element - + else { - + } - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.isStartElement()) { // A start element we are not expecting indicates a trailing invalid property throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } - + } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } - + return object; } - + }// end of factory class - + } - + public static class NfeConsultaNF2Result implements org.apache.axis2.databinding.ADBBean { - + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeConsultaNF2Result", "ns1"); - + protected org.apache.axiom.om.OMElement localExtraElement; - + public org.apache.axiom.om.OMElement getExtraElement() { return this.localExtraElement; } - + public void setExtraElement(final org.apache.axiom.om.OMElement param) { - + this.localExtraElement = param; - + } - + @Override public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - + org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this, NfeConsultaNF2Result.MY_QNAME); return factory.createOMElement(dataSource, NfeConsultaNF2Result.MY_QNAME); - + } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { - + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = null; java.lang.String namespace = null; - + prefix = parentQName.getPrefix(); namespace = parentQName.getNamespaceURI(); this.writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - + if (serializeType) { - + java.lang.String namespacePrefix = this.registerPrefix(xmlWriter, "http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2"); if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":nfeConsultaNF2Result", xmlWriter); } else { this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "nfeConsultaNF2Result", xmlWriter); } - + } - + if (this.localExtraElement != null) { this.localExtraElement.serialize(xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - + xmlWriter.writeEndElement(); - + } - + private static java.lang.String generatePrefix(final java.lang.String namespace) { if (namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2")) { return "ns1"; } return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } - + private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, final java.lang.String localPart, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { @@ -866,13 +833,13 @@ private void writeStartElement(java.lang.String prefix, final java.lang.String n } else if (prefix == null) { prefix = NfeConsultaNF2Result.generatePrefix(namespace); } - + xmlWriter.writeStartElement(prefix, localPart, namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } } - + private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); @@ -880,7 +847,7 @@ private void writeAttribute(final java.lang.String prefix, final java.lang.Strin } xmlWriter.writeAttribute(namespace, attName, attValue); } - + private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attValue); @@ -889,9 +856,9 @@ private void writeAttribute(final java.lang.String namespace, final java.lang.St xmlWriter.writeAttribute(namespace, attName, attValue); } } - + private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { @@ -903,7 +870,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la } else { attributeValue = qname.getLocalPart(); } - + if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { @@ -911,7 +878,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la xmlWriter.writeAttribute(namespace, attName, attributeValue); } } - + private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { @@ -921,28 +888,28 @@ private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.s xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } - + } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } - + private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; - + for (int i = 0; i < qnames.length; i++) { if (i > 0) { stringToWrite.append(" "); @@ -955,7 +922,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } else { @@ -967,9 +934,9 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x } xmlWriter.writeCharacters(stringToWrite.toString()); } - + } - + private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { @@ -987,157 +954,157 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x } return prefix; } - + @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - + java.util.ArrayList elementList = new java.util.ArrayList(); java.util.ArrayList attribList = new java.util.ArrayList(); - + if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); elementList.add(this.localExtraElement); } else { throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - + } - + public static class Factory { - + public static NfeConsultaNF2Result parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { NfeConsultaNF2Result object = new NfeConsultaNF2Result(); - + int event; java.lang.String nillableValue = null; java.lang.String prefix = ""; java.lang.String namespaceuri = ""; try { - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; - + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - + if (!"nfeConsultaNF2Result".equals(type)) { // find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (NfeConsultaNF2Result) ExtensionMapper.getTypeObject(nsUri, type, reader); } - + } - + } - + // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); - + reader.next(); - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.isStartElement()) { - + // use the QName from the parser as the name for the builder javax.xml.namespace.QName startQname1 = reader.getName(); - + // We need to wrap the reader so that it produces a fake START_DOCUMENT event // this is needed by the builder classes org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = new org.apache.axis2.databinding.utils.NamedStaxOMBuilder(new org.apache.axis2.util.StreamWrapper(reader), startQname1); object.setExtraElement(builder1.getOMElement()); - + reader.next(); - + } // End of if for expected property start element - + else { // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.isStartElement()) { // A start element we are not expecting indicates a trailing invalid property throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } - + } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } - + return object; } - + }// end of factory class - + } - + public static class NfeCabecMsgE implements org.apache.axis2.databinding.ADBBean { - + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeCabecMsg", "ns1"); - + protected NfeCabecMsg localNfeCabecMsg; - + public NfeCabecMsg getNfeCabecMsg() { return this.localNfeCabecMsg; } - + public void setNfeCabecMsg(final NfeCabecMsg param) { - + this.localNfeCabecMsg = param; - + } - + @Override public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - + org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this, NfeCabecMsgE.MY_QNAME); return factory.createOMElement(dataSource, NfeCabecMsgE.MY_QNAME); - + } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { - + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { + // We can safely assume an element has only one type associated with it - + if (this.localNfeCabecMsg == null) { throw new org.apache.axis2.databinding.ADBException("nfeCabecMsg cannot be null!"); } this.localNfeCabecMsg.serialize(NfeCabecMsgE.MY_QNAME, xmlWriter); - + } - + private static java.lang.String generatePrefix(final java.lang.String namespace) { if (namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2")) { return "ns1"; } return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } - + private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, final java.lang.String localPart, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { @@ -1148,13 +1115,13 @@ private void writeStartElement(java.lang.String prefix, final java.lang.String n } else if (prefix == null) { prefix = NfeCabecMsgE.generatePrefix(namespace); } - + xmlWriter.writeStartElement(prefix, localPart, namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } } - + private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); @@ -1162,7 +1129,7 @@ private void writeAttribute(final java.lang.String prefix, final java.lang.Strin } xmlWriter.writeAttribute(namespace, attName, attValue); } - + private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attValue); @@ -1171,9 +1138,9 @@ private void writeAttribute(final java.lang.String namespace, final java.lang.St xmlWriter.writeAttribute(namespace, attName, attValue); } } - + private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { @@ -1185,7 +1152,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la } else { attributeValue = qname.getLocalPart(); } - + if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { @@ -1193,7 +1160,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la xmlWriter.writeAttribute(namespace, attName, attributeValue); } } - + private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { @@ -1203,28 +1170,28 @@ private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.s xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } - + } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } - + private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; - + for (int i = 0; i < qnames.length; i++) { if (i > 0) { stringToWrite.append(" "); @@ -1237,7 +1204,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } else { @@ -1249,9 +1216,9 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x } xmlWriter.writeCharacters(stringToWrite.toString()); } - + } - + private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { @@ -1269,146 +1236,146 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x } return prefix; } - + @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - + // We can safely assume an element has only one type associated with it return this.localNfeCabecMsg.getPullParser(NfeCabecMsgE.MY_QNAME); - + } - + public static class Factory { - + public static NfeCabecMsgE parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { NfeCabecMsgE object = new NfeCabecMsgE(); - + int event; java.lang.String nillableValue = null; java.lang.String prefix = ""; java.lang.String namespaceuri = ""; try { - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); - + while (!reader.isEndElement()) { if (reader.isStartElement()) { - + if (reader.isStartElement() && new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeCabecMsg").equals(reader.getName())) { - + object.setNfeCabecMsg(NfeCabecMsg.Factory.parse(reader)); - + } // End of if for expected property start element - + else { // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } - + } else { reader.next(); } } // end of while loop - + } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } - + return object; } - + }// end of factory class - + } - + public static class ExtensionMapper { - + public static java.lang.Object getTypeObject(final java.lang.String namespaceURI, final java.lang.String typeName, final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { - + if ("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2".equals(namespaceURI) && "nfeCabecMsg".equals(typeName)) { - + return NfeCabecMsg.Factory.parse(reader); - + } - + throw new org.apache.axis2.databinding.ADBException("Unsupported type " + namespaceURI + " " + typeName); } - + } - + public static class NfeDadosMsg implements org.apache.axis2.databinding.ADBBean { - + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2", "nfeDadosMsg", "ns1"); - + protected org.apache.axiom.om.OMElement localExtraElement; - + public org.apache.axiom.om.OMElement getExtraElement() { return this.localExtraElement; } - + public void setExtraElement(final org.apache.axiom.om.OMElement param) { - + this.localExtraElement = param; - + } - + @Override public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QName parentQName, final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException { - + org.apache.axiom.om.OMDataSource dataSource = new org.apache.axis2.databinding.ADBDataSource(this, NfeDadosMsg.MY_QNAME); return factory.createOMElement(dataSource, NfeDadosMsg.MY_QNAME); - + } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } - + @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { - + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = null; java.lang.String namespace = null; - + prefix = parentQName.getPrefix(); namespace = parentQName.getNamespaceURI(); this.writeStartElement(prefix, namespace, parentQName.getLocalPart(), xmlWriter); - + if (serializeType) { - + java.lang.String namespacePrefix = this.registerPrefix(xmlWriter, "http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2"); if (namespacePrefix != null && namespacePrefix.trim().length() > 0) { this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", namespacePrefix + ":nfeDadosMsg", xmlWriter); } else { this.writeAttribute("xsi", "http://www.w3.org/2001/XMLSchema-instance", "type", "nfeDadosMsg", xmlWriter); } - + } - + if (this.localExtraElement != null) { this.localExtraElement.serialize(xmlWriter); } else { throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - + xmlWriter.writeEndElement(); - + } - + private static java.lang.String generatePrefix(final java.lang.String namespace) { if (namespace.equals("http://www.portalfiscal.inf.br/nfe/wsdl/NfeConsulta2")) { return "ns1"; } return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); } - + private void writeStartElement(java.lang.String prefix, final java.lang.String namespace, final java.lang.String localPart, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); if (writerPrefix != null) { @@ -1419,13 +1386,13 @@ private void writeStartElement(java.lang.String prefix, final java.lang.String n } else if (prefix == null) { prefix = NfeDadosMsg.generatePrefix(namespace); } - + xmlWriter.writeStartElement(prefix, localPart, namespace); xmlWriter.writeNamespace(prefix, namespace); xmlWriter.setPrefix(prefix, namespace); } } - + private void writeAttribute(final java.lang.String prefix, final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (xmlWriter.getPrefix(namespace) == null) { xmlWriter.writeNamespace(prefix, namespace); @@ -1433,7 +1400,7 @@ private void writeAttribute(final java.lang.String prefix, final java.lang.Strin } xmlWriter.writeAttribute(namespace, attName, attValue); } - + private void writeAttribute(final java.lang.String namespace, final java.lang.String attName, final java.lang.String attValue, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attValue); @@ -1442,9 +1409,9 @@ private void writeAttribute(final java.lang.String namespace, final java.lang.St xmlWriter.writeAttribute(namespace, attName, attValue); } } - + private void writeQNameAttribute(final java.lang.String namespace, final java.lang.String attName, final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + java.lang.String attributeNamespace = qname.getNamespaceURI(); java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); if (attributePrefix == null) { @@ -1456,7 +1423,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la } else { attributeValue = qname.getLocalPart(); } - + if (namespace.equals("")) { xmlWriter.writeAttribute(attName, attributeValue); } else { @@ -1464,7 +1431,7 @@ private void writeQNameAttribute(final java.lang.String namespace, final java.la xmlWriter.writeAttribute(namespace, attName, attributeValue); } } - + private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { java.lang.String namespaceURI = qname.getNamespaceURI(); if (namespaceURI != null) { @@ -1474,28 +1441,28 @@ private void writeQName(final javax.xml.namespace.QName qname, final javax.xml.s xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } else { // i.e this is the default namespace xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } - + } else { xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); } } - + private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { - + if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; - + for (int i = 0; i < qnames.length; i++) { if (i > 0) { stringToWrite.append(" "); @@ -1508,7 +1475,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x xmlWriter.writeNamespace(prefix, namespaceURI); xmlWriter.setPrefix(prefix, namespaceURI); } - + if (prefix.trim().length() > 0) { stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); } else { @@ -1520,9 +1487,9 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x } xmlWriter.writeCharacters(stringToWrite.toString()); } - + } - + private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter xmlWriter, final java.lang.String namespace) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = xmlWriter.getPrefix(namespace); if (prefix == null) { @@ -1540,109 +1507,109 @@ private java.lang.String registerPrefix(final javax.xml.stream.XMLStreamWriter x } return prefix; } - + @Override public javax.xml.stream.XMLStreamReader getPullParser(final javax.xml.namespace.QName qName) throws org.apache.axis2.databinding.ADBException { - + java.util.ArrayList elementList = new java.util.ArrayList(); java.util.ArrayList attribList = new java.util.ArrayList(); - + if (this.localExtraElement != null) { elementList.add(org.apache.axis2.databinding.utils.Constants.OM_ELEMENT_KEY); elementList.add(this.localExtraElement); } else { throw new org.apache.axis2.databinding.ADBException("extraElement cannot be null!!"); } - + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); - + } - + public static class Factory { - + public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception { NfeDadosMsg object = new NfeDadosMsg(); - + int event; java.lang.String nillableValue = null; java.lang.String prefix = ""; java.lang.String namespaceuri = ""; try { - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type") != null) { java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; - + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":") + 1); - + if (!"nfeDadosMsg".equals(type)) { // find namespace for the prefix java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); return (NfeDadosMsg) ExtensionMapper.getTypeObject(nsUri, type, reader); } - + } - + } - + // Note all attributes that were handled. Used to differ normal attributes // from anyAttributes. java.util.Vector handledAttributes = new java.util.Vector(); - + reader.next(); - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.isStartElement()) { - + // use the QName from the parser as the name for the builder javax.xml.namespace.QName startQname1 = reader.getName(); - + // We need to wrap the reader so that it produces a fake START_DOCUMENT event // this is needed by the builder classes org.apache.axis2.databinding.utils.NamedStaxOMBuilder builder1 = new org.apache.axis2.databinding.utils.NamedStaxOMBuilder(new org.apache.axis2.util.StreamWrapper(reader), startQname1); object.setExtraElement(builder1.getOMElement()); - + reader.next(); - + } // End of if for expected property start element - + else { // A start element we are not expecting indicates an invalid parameter was passed throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } - + while (!reader.isStartElement() && !reader.isEndElement()) { reader.next(); } - + if (reader.isStartElement()) { // A start element we are not expecting indicates a trailing invalid property throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getName()); } - + } catch (javax.xml.stream.XMLStreamException e) { throw new java.lang.Exception(e); } - + return object; } - + }// end of factory class - + } - + private org.apache.axiom.om.OMElement toOM(final NfeConsulta2Stub.NfeDadosMsg param, final boolean optimizeContent) throws org.apache.axis2.AxisFault { try { return param.getOMElement(NfeConsulta2Stub.NfeDadosMsg.MY_QNAME, org.apache.axiom.om.OMAbstractFactory.getOMFactory()); @@ -1650,7 +1617,7 @@ private org.apache.axiom.om.OMElement toOM(final NfeConsulta2Stub.NfeDadosMsg pa throw org.apache.axis2.AxisFault.makeFault(e); } } - + private org.apache.axiom.om.OMElement toOM(final NfeConsulta2Stub.NfeConsultaNF2Result param, final boolean optimizeContent) throws org.apache.axis2.AxisFault { try { return param.getOMElement(NfeConsulta2Stub.NfeConsultaNF2Result.MY_QNAME, org.apache.axiom.om.OMAbstractFactory.getOMFactory()); @@ -1658,7 +1625,7 @@ private org.apache.axiom.om.OMElement toOM(final NfeConsulta2Stub.NfeConsultaNF2 throw org.apache.axis2.AxisFault.makeFault(e); } } - + private org.apache.axiom.om.OMElement toOM(final NfeConsulta2Stub.NfeCabecMsgE param, final boolean optimizeContent) throws org.apache.axis2.AxisFault { try { return param.getOMElement(NfeConsulta2Stub.NfeCabecMsgE.MY_QNAME, org.apache.axiom.om.OMAbstractFactory.getOMFactory()); @@ -1666,7 +1633,7 @@ private org.apache.axiom.om.OMElement toOM(final NfeConsulta2Stub.NfeCabecMsgE p throw org.apache.axis2.AxisFault.makeFault(e); } } - + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soap.SOAPFactory factory, final NfeConsulta2Stub.NfeDadosMsg param, final boolean optimizeContent, final javax.xml.namespace.QName methodQName) throws org.apache.axis2.AxisFault { try { org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); @@ -1676,12 +1643,12 @@ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soa throw org.apache.axis2.AxisFault.makeFault(e); } } - + /* methods to provide back word compatibility */ private org.apache.axiom.soap.SOAPEnvelope toEnvelope(final org.apache.axiom.soap.SOAPFactory factory) { return factory.getDefaultEnvelope(); } - + private java.lang.Object fromOM(final org.apache.axiom.om.OMElement param, final java.lang.Class type, final java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault { try { if (NfeConsulta2Stub.NfeDadosMsg.class.equals(type)) { diff --git a/src/main/java/com/fincatto/nfe310/webservices/statusservico/consulta/NfeStatusServico2Stub.java b/src/main/java/com/fincatto/nfe310/webservices/statusservico/consulta/NfeStatusServico2Stub.java index 55acc9e0d..765125873 100755 --- a/src/main/java/com/fincatto/nfe310/webservices/statusservico/consulta/NfeStatusServico2Stub.java +++ b/src/main/java/com/fincatto/nfe310/webservices/statusservico/consulta/NfeStatusServico2Stub.java @@ -1,10 +1,10 @@ package com.fincatto.nfe310.webservices.statusservico.consulta; -import javax.xml.namespace.QName; - import org.apache.axiom.om.OMAttribute; import org.apache.axis2.client.Stub; +import javax.xml.namespace.QName; + @SuppressWarnings({ "rawtypes", "unchecked", "serial", "unused", "deprecation" }) public class NfeStatusServico2Stub extends org.apache.axis2.client.Stub { protected org.apache.axis2.description.AxisOperation[] _operations; @@ -127,26 +127,11 @@ public NfeStatusServico2Stub.NfeStatusServicoNF2Result nfeStatusServicoNF2( final java.lang.String messageClassName = (java.lang.String) this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeStatusServicoNF2")); final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); throw new java.rmi.RemoteException(ex.getMessage(), ex); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - throw f; - } catch (final java.lang.InstantiationException e) { + } catch (final ClassCastException | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault throw f; } @@ -232,29 +217,11 @@ public void onError(final java.lang.Exception error) { final java.lang.String messageClassName = (java.lang.String) NfeStatusServico2Stub.this.faultMessageMap.get(new org.apache.axis2.client.FaultMapKey(faultElt.getQName(), "nfeStatusServicoNF2")); final java.lang.Class messageClass = java.lang.Class.forName(messageClassName); final java.lang.Object messageObject = NfeStatusServico2Stub.this.fromOM(faultElt, messageClass, null); - final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", new java.lang.Class[] { messageClass }); - m.invoke(ex, new java.lang.Object[] { messageObject }); + final java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage", messageClass); + m.invoke(ex, messageObject); callback.receiveErrornfeStatusServicoNF2(new java.rmi.RemoteException(ex.getMessage(), ex)); - } catch (final java.lang.ClassCastException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeStatusServicoNF2(f); - } catch (final java.lang.ClassNotFoundException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeStatusServicoNF2(f); - } catch (final java.lang.NoSuchMethodException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeStatusServicoNF2(f); - } catch (final java.lang.reflect.InvocationTargetException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeStatusServicoNF2(f); - } catch (final java.lang.IllegalAccessException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeStatusServicoNF2(f); - } catch (final java.lang.InstantiationException e) { - // we cannot intantiate the class - throw the original Axis fault - callback.receiveErrornfeStatusServicoNF2(f); - } catch (final org.apache.axis2.AxisFault e) { + } catch (final ClassCastException | org.apache.axis2.AxisFault | InstantiationException | IllegalAccessException | java.lang.reflect.InvocationTargetException | NoSuchMethodException | ClassNotFoundException e) { // we cannot intantiate the class - throw the original Axis fault callback.receiveErrornfeStatusServicoNF2(f); } @@ -347,12 +314,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { // We can safely assume an element has only one type associated with it @@ -453,7 +420,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + final StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; @@ -584,12 +551,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -709,7 +676,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + final StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; @@ -794,7 +761,7 @@ public static NfeStatusServicoNF2Result parse(final javax.xml.stream.XMLStreamRe final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -969,12 +936,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -1127,7 +1094,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + final StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; @@ -1228,7 +1195,7 @@ public static NfeCabecMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; @@ -1358,12 +1325,12 @@ public org.apache.axiom.om.OMElement getOMElement(final javax.xml.namespace.QNam } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { this.serialize(parentQName, xmlWriter, false); } @Override - public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException { + public void serialize(final javax.xml.namespace.QName parentQName, final javax.xml.stream.XMLStreamWriter xmlWriter, final boolean serializeType) throws javax.xml.stream.XMLStreamException { java.lang.String prefix = null; java.lang.String namespace = null; @@ -1483,7 +1450,7 @@ private void writeQNames(final javax.xml.namespace.QName[] qnames, final javax.x if (qnames != null) { // we have to store this data until last moment since it is not possible to write any // namespace data after writing the charactor data - final java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + final StringBuilder stringToWrite = new StringBuilder(); java.lang.String namespaceURI = null; java.lang.String prefix = null; @@ -1568,7 +1535,7 @@ public static NfeDadosMsg parse(final javax.xml.stream.XMLStreamReader reader) t final java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", "type"); if (fullTypeName != null) { java.lang.String nsPrefix = null; - if (fullTypeName.indexOf(":") > -1) { + if (fullTypeName.contains(":")) { nsPrefix = fullTypeName.substring(0, fullTypeName.indexOf(":")); } nsPrefix = nsPrefix == null ? "" : nsPrefix; diff --git a/src/test/java/com/fincatto/nfe310/FabricaDeObjetosFake.java b/src/test/java/com/fincatto/nfe310/FabricaDeObjetosFake.java index 215fef8aa..245c61e51 100755 --- a/src/test/java/com/fincatto/nfe310/FabricaDeObjetosFake.java +++ b/src/test/java/com/fincatto/nfe310/FabricaDeObjetosFake.java @@ -1,36 +1,6 @@ package com.fincatto.nfe310; -import com.fincatto.nfe310.classes.NFAmbiente; -import com.fincatto.nfe310.classes.NFEndereco; -import com.fincatto.nfe310.classes.NFFinalidade; -import com.fincatto.nfe310.classes.NFFormaPagamentoPrazo; -import com.fincatto.nfe310.classes.NFModalidadeFrete; -import com.fincatto.nfe310.classes.NFModelo; -import com.fincatto.nfe310.classes.NFNotaInfoCombustivelTipo; -import com.fincatto.nfe310.classes.NFNotaInfoEspecieVeiculo; -import com.fincatto.nfe310.classes.NFNotaInfoImpostoTributacaoICMS; -import com.fincatto.nfe310.classes.NFNotaInfoItemImpostoICMSModalidadeBaseCalculo; -import com.fincatto.nfe310.classes.NFNotaInfoItemProdutoArmamentoTipo; -import com.fincatto.nfe310.classes.NFNotaInfoItemProdutoVeiculoCondicao; -import com.fincatto.nfe310.classes.NFNotaInfoItemProdutoVeiculoCondicaoChassi; -import com.fincatto.nfe310.classes.NFNotaInfoItemProdutoVeiculoRestricao; -import com.fincatto.nfe310.classes.NFNotaInfoItemProdutoVeiculoTipoOperacao; -import com.fincatto.nfe310.classes.NFNotaInfoSituacaoTributariaCOFINS; -import com.fincatto.nfe310.classes.NFNotaInfoSituacaoTributariaIPI; -import com.fincatto.nfe310.classes.NFNotaInfoSituacaoTributariaPIS; -import com.fincatto.nfe310.classes.NFNotaInfoTipoVeiculo; -import com.fincatto.nfe310.classes.NFNotaInfoVeiculoCor; -import com.fincatto.nfe310.classes.NFOrigem; -import com.fincatto.nfe310.classes.NFOrigemProcesso; -import com.fincatto.nfe310.classes.NFProcessoEmissor; -import com.fincatto.nfe310.classes.NFProdutoCompoeValorNota; -import com.fincatto.nfe310.classes.NFProtocolo; -import com.fincatto.nfe310.classes.NFProtocoloInfo; -import com.fincatto.nfe310.classes.NFRegimeTributario; -import com.fincatto.nfe310.classes.NFTipo; -import com.fincatto.nfe310.classes.NFTipoEmissao; -import com.fincatto.nfe310.classes.NFTipoImpressao; -import com.fincatto.nfe310.classes.NFUnidadeFederativa; +import com.fincatto.nfe310.classes.*; import com.fincatto.nfe310.classes.evento.NFEvento; import com.fincatto.nfe310.classes.evento.NFInfoEvento; import com.fincatto.nfe310.classes.evento.NFTipoEvento; @@ -41,100 +11,17 @@ import com.fincatto.nfe310.classes.lote.envio.NFLoteEnvio; import com.fincatto.nfe310.classes.lote.envio.NFLoteEnvioRetornoRecebimentoInfo; import com.fincatto.nfe310.classes.lote.envio.NFLoteIndicadorProcessamento; -import com.fincatto.nfe310.classes.nota.NFFormaImportacaoIntermediacao; -import com.fincatto.nfe310.classes.nota.NFFormaPagamentoMoeda; -import com.fincatto.nfe310.classes.nota.NFIdentificadorLocalDestinoOperacao; -import com.fincatto.nfe310.classes.nota.NFImpostoDevolvido; -import com.fincatto.nfe310.classes.nota.NFIndicadorIEDestinatario; -import com.fincatto.nfe310.classes.nota.NFIndicadorPresencaComprador; -import com.fincatto.nfe310.classes.nota.NFInfoCupomFiscalReferenciado; -import com.fincatto.nfe310.classes.nota.NFInfoModelo1Por1AReferenciada; -import com.fincatto.nfe310.classes.nota.NFInfoProdutorRuralReferenciada; -import com.fincatto.nfe310.classes.nota.NFInfoReferenciada; -import com.fincatto.nfe310.classes.nota.NFInformacaoImpostoDevolvido; -import com.fincatto.nfe310.classes.nota.NFNota; -import com.fincatto.nfe310.classes.nota.NFNotaInfo; -import com.fincatto.nfe310.classes.nota.NFNotaInfoAvulsa; -import com.fincatto.nfe310.classes.nota.NFNotaInfoCana; -import com.fincatto.nfe310.classes.nota.NFNotaInfoCanaDeducao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoCanaFornecimentoDiario; -import com.fincatto.nfe310.classes.nota.NFNotaInfoCartao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoCobranca; -import com.fincatto.nfe310.classes.nota.NFNotaInfoCompra; -import com.fincatto.nfe310.classes.nota.NFNotaInfoDestinatario; -import com.fincatto.nfe310.classes.nota.NFNotaInfoDuplicata; -import com.fincatto.nfe310.classes.nota.NFNotaInfoEmitente; -import com.fincatto.nfe310.classes.nota.NFNotaInfoExportacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoFatura; -import com.fincatto.nfe310.classes.nota.NFNotaInfoICMSTotal; -import com.fincatto.nfe310.classes.nota.NFNotaInfoISSQNTotal; -import com.fincatto.nfe310.classes.nota.NFNotaInfoIdentificacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoInformacoesAdicionais; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItem; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemDetalheExportacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemExportacaoIndireta; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImposto; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoCOFINS; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoCOFINSAliquota; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoCOFINSNaoTributavel; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoCOFINSOutrasOperacoes; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoCOFINSQuantidade; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoCOFINSST; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoICMS; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoICMS00; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoICMSUFDestino; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoIPI; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoIPINaoTributado; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoIPITributado; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoISSQN; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoImportacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoPIS; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoPISAliquota; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoPISNaoTributado; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoPISOutrasOperacoes; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoPISQuantidade; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemImpostoPISST; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemIndicadorExigibilidadeISS; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemIndicadorIncentivoFiscal; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProduto; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoArmamento; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoCombustivel; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoCombustivelCIDE; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoDeclaracaoImportacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoDeclaracaoImportacaoAdicao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoMedicamento; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoVeiculo; -import com.fincatto.nfe310.classes.nota.NFNotaInfoLacre; -import com.fincatto.nfe310.classes.nota.NFNotaInfoLocal; -import com.fincatto.nfe310.classes.nota.NFNotaInfoObservacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoPagamento; -import com.fincatto.nfe310.classes.nota.NFNotaInfoProcessoReferenciado; -import com.fincatto.nfe310.classes.nota.NFNotaInfoReboque; -import com.fincatto.nfe310.classes.nota.NFNotaInfoRegimeEspecialTributacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoRetencaoICMSTransporte; -import com.fincatto.nfe310.classes.nota.NFNotaInfoRetencoesTributos; -import com.fincatto.nfe310.classes.nota.NFNotaInfoTotal; -import com.fincatto.nfe310.classes.nota.NFNotaInfoTransportador; -import com.fincatto.nfe310.classes.nota.NFNotaInfoTransporte; -import com.fincatto.nfe310.classes.nota.NFNotaInfoVeiculo; -import com.fincatto.nfe310.classes.nota.NFNotaInfoVolume; -import com.fincatto.nfe310.classes.nota.NFNotaProcessada; -import com.fincatto.nfe310.classes.nota.NFOperacaoConsumidorFinal; -import com.fincatto.nfe310.classes.nota.NFOperadoraCartao; -import com.fincatto.nfe310.classes.nota.NFPessoaAutorizadaDownloadNFe; -import com.fincatto.nfe310.classes.nota.NFTipoIntegracaoPagamento; -import com.fincatto.nfe310.classes.nota.NFViaTransporteInternacional; +import com.fincatto.nfe310.classes.nota.*; import com.fincatto.nfe310.classes.nota.assinatura.NFReference; import com.fincatto.nfe310.classes.nota.assinatura.NFSignature; import com.fincatto.nfe310.classes.nota.assinatura.NFSignedInfo; import org.joda.time.DateTime; import org.joda.time.LocalDate; -import java.io.IOException; import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; public class FabricaDeObjetosFake { @@ -178,7 +65,7 @@ public static NFInfoEventoCancelamento getNFInfoEventoCancelamento() { infoEventoCancelamento.setChave("81568004734874930428983724940883089298523837"); infoEventoCancelamento.setCnpj("12345678901234"); infoEventoCancelamento.setCodigoEvento("123456"); - infoEventoCancelamento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEventoCancelamento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEventoCancelamento.setId("hluU2zKt4QK5bEktOiGfpZw64535p2A4Z5m5egLQbMpjnCH48c1aw6"); infoEventoCancelamento.setNumeroSequencialEvento(2); infoEventoCancelamento.setOrgao(NFUnidadeFederativa.SC); @@ -226,7 +113,7 @@ public static NFInfoEvento getNFInfoEvento() { infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); @@ -273,66 +160,11 @@ public static NFLoteEnvio getNFLoteEnvio() { final NFLoteEnvio loteEnvio = new NFLoteEnvio(); loteEnvio.setIdLote("333972757970401"); loteEnvio.setVersao("3.10"); - loteEnvio.setNotas(Arrays.asList(FabricaDeObjetosFake.getNFNota1())); + loteEnvio.setNotas(Collections.singletonList(FabricaDeObjetosFake.getNFNota1())); loteEnvio.setIndicadorProcessamento(NFLoteIndicadorProcessamento.PROCESSAMENTO_ASSINCRONO); return loteEnvio; } - public static NFeConfig getConfig() { - return new NFeConfig() { - - @Override - public String getCertificadoSenha() { - return "abc"; - } - - @Override - public NFUnidadeFederativa getCUF() { - return null; - } - - @Override - public NFAmbiente getAmbiente() { - return null; - } - - @Override - public NFTipoEmissao getTipoEmissao() { - return null; - } - - @Override - public String getCadeiaCertificadosSenha() { - return null; - } - - @Override - public String getSSLProtocolo() { - return null; - } - - @Override - public byte[] getCertificado() throws IOException { - return null; - } - - @Override - public byte[] getCadeiaCertificados() throws IOException { - return null; - } - - @Override - public Integer getCodigoSegurancaContribuinteID() { - return null; - } - - @Override - public String getCodigoSegurancaContribuinte() { - return null; - } - }; - } - public static NFNota getNFNota1() { final NFNota nota = new NFNota(); final NFNotaInfo info = new NFNotaInfo(); @@ -346,7 +178,7 @@ public static NFNota getNFNota1() { info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); final NFNotaInfoItem item = new NFNotaInfoItem(); final NFNotaInfoItemImposto imposto = new NFNotaInfoItemImposto(); @@ -370,7 +202,7 @@ public static NFNota getNFNota1() { item.setProduto(FabricaDeObjetosFake.getProdutoMedicamento()); item.setImpostoDevolvido(FabricaDeObjetosFake.getNFImpostoDevolvido()); - info.setItens(Arrays.asList(item)); + info.setItens(Collections.singletonList(item)); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); @@ -392,7 +224,7 @@ public static NFNota getNFNota1() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(referenciada)); + identificacao.setReferenciadas(Collections.singletonList(referenciada)); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -448,7 +280,7 @@ private static NFNotaInfoItemProduto getProdutoMedicamento() { produtoMedicamento.setCodigoDeBarras("36811963532505"); produtoMedicamento.setCodigoDeBarrasTributavel("36811963532505"); produtoMedicamento.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produtoMedicamento.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produtoMedicamento.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produtoMedicamento.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produtoMedicamento.setExtipi("999"); produtoMedicamento.setNcm("99999999"); @@ -466,7 +298,7 @@ private static NFNotaInfoItemProduto getProdutoMedicamento() { produtoMedicamento.setValorUnitario(new BigDecimal("9999999999.9999999999")); produtoMedicamento.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produtoMedicamento.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); - produtoMedicamento.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produtoMedicamento.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); return produtoMedicamento; } @@ -522,43 +354,43 @@ public static NFNotaInfo getNFNotaInfo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("3.10")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); return info; } - + public static NFNota getNotaQRCode(){ //CAMPOS CONTIDOS NO EXEMPLO DO MANUAL DA RECEITA PARA GERAÇÃO DO QRCODE NFNota nota = new NFNota(); nota.setInfo(new NFNotaInfo()); nota.getInfo().setIdentificador("28140300156225000131650110000151341562040824"); - + nota.getInfo().setDestinatario(new NFNotaInfoDestinatario()); nota.getInfo().getDestinatario().setCnpj("13017959000181"); - + nota.getInfo().setIdentificacao(new NFNotaInfoIdentificacao()); nota.getInfo().getIdentificacao().setDataHoraEmissao(DateTime.parse("2014-03-18T10:55:33-03:00")); nota.getInfo().getIdentificacao().setUf(NFUnidadeFederativa.SE); - + nota.getInfo().setTotal(new NFNotaInfoTotal()); nota.getInfo().getTotal().setIcmsTotal(new NFNotaInfoICMSTotal()); nota.getInfo().getTotal().getIcmsTotal().getValorTotalNFe(); nota.getInfo().getTotal().getIcmsTotal().setValorTotalNFe(new BigDecimal("60.90")); nota.getInfo().getTotal().getIcmsTotal().setValorTotalICMS(new BigDecimal("12.75")); - + nota.setAssinatura(new NFSignature()); nota.getAssinatura().setSignedInfo(new NFSignedInfo()); nota.getAssinatura().getSignedInfo().setReference(new NFReference()); nota.getAssinatura().getSignedInfo().getReference().setDigestValue("yzGYhUx1/XYYzksWB+fPR3Qc50c="); - + return nota; } @@ -566,9 +398,9 @@ public static NFNotaInfoTransporte getNFNotaInfoTransporte() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); - transporte.setVolumes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoVolume())); + transporte.setVolumes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoVolume())); return transporte; } @@ -595,15 +427,15 @@ public static NFNotaInfoInformacoesAdicionais getNFNotaInfoInformacoesAdicionais infoAdicionais.setInformacoesAdicionaisInteresseFisco("qe7Qi21GMSBan0iZLatpXAQAEhXEWZAO0HhHlQLlX18rryo9e1IX5Prav6fvNgZwfppMXa2RzJ7wyDH4gK3VEjeTARJ2iOLtZFDWrEaNMcGnKiusILw5bnRqBLxQfrtkTwcikLpsoI3ULurBUMMbSh1nJboZzwHUhWfArMie6CK1qBWeqgDUqMLXvkyZN66tOcBU4gv6oPZLaIJkblNYTZTEe4L1B5fx2TWec7P5Fi6HTWZiupnonWvZ51tPotK8g52ZUPXSl0lDbtWEkCGgWch0LX5xaalPL4taLgXJo1aJ1KwqSGh2SXPX9Vp316yZX6kiw6Z2yQnBN0cEfbVLp8wlYaAtsyWRGBSpqg6L3yjyciUeXkIWziOzuK0mtHsgqlXVcXLbh6sfx1zv9R3E3ITMbWOKMknfnrvoffPGJYj6p3300K4vfvUBo8ryf54eEHDhNHeegc4LMtrg2KYmr1a3QweF5B2lgNsWoyKkZ1eBU81vBNJsK9qwgeRxwBj5wqbYkk6JIKKiSbhPgP0IE7NsuobmoSyraX5QJCNyayP1oGJxLSuHR7YCGNXYJIDv3LErhgyo3qKPsLHznYP0PfSrlOSjkJzMT4A0jUrXBH3g2coofv5kug8EmOnG0u6NG2pXwClLfI3GD14H12iugRcfYU5qMWSK09bbDcMH7XuLZumguvIMsZcPxjrhbMjokxYaMLTohkPCnUNXfAPZaayNpEnRhJwRUwFKBvNPLRXbPNjxYJKjMhgtoiSur7lWwPDtkoawI0OaJZpZFUDF7qRV9oaBnNBq0xtwN4YzoCFkNok5gtcIE6VJljMOAkT1RuRhyg5hsIxaxqJWN37NBYBJvR2m9QakYNun5eRwmkIC2ejGzyK4GlqsvkT0HZ37j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G57SR3h5zUB7X9vEFBEvCWpa2E26fEOiqJxi3hPJkJT8BYZEmezCiG7hme64ovvAKEmG1qgphblDoDYeX3mrvSzSrhIhFGGT1Qup39hIijFhMCGj54MHreV9KA6vMbGoqlI9AUwGjf7YwDLJ1KhU2a8RZ6oWYh7UZbOklkqHa6FcJbHAK7WUjyoyptlTZwmQ2ORJ4J4CKFk4H41iBJJkS6Aszj0zmCJqikJRB7SGkHMgiELk45TwnihqEKbGiPW1IvHo1Z0u9kTyD9HhTCFQbtUIqEYmbmyUlTx6QN23VrZJ7qy8WQ6NRt51GiaLscNaym8JLWByNqnJkNM690CJ3WYCu0oTIxch0rXgv4A2wZkz1g7q1VgnawWTU9T7APpjh7CZJ5mlOAZLmKVCOEFn3Tkm1kLWCBQfhg6VCXt11VsSF3bXcmZkjFcLB05aNBT8esbDO0uBVJ7wPA35xapjuLyPgt7ucGiSPrMn7acIzKWUhFjKMUrhgih2AHkm5RVoEDaaKhXFpKZS0g9yBTeRq3S6ik4QVQz755g54IwJQsS99E82wsx4uiBFCVHa6BxEKIeMchPZ1fzx9oYP1wmk6wejvraBAAK9c2TYSGaW5ENqB1TvlDMstwGpU9XncE9mogXzpoylr4vXj0GoDB27AIxyzlZBM4wSeo96mDgyNwUGnIZeJl9YLk6Y33V7eBVpumQK3j7fzq8sQ6xn7RIYze4F4GlnzUnXG4uTM5WfDH"); - final ArrayList observacoesFisco = new ArrayList(); + final ArrayList observacoesFisco = new ArrayList<>(); observacoesFisco.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesFisco(observacoesFisco); - final ArrayList observacoesContribuinte = new ArrayList(); + final ArrayList observacoesContribuinte = new ArrayList<>(); observacoesContribuinte.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesContribuinte(observacoesContribuinte); - final ArrayList processosRefenciado = new ArrayList(); + final ArrayList processosRefenciado = new ArrayList<>(); processosRefenciado.add(FabricaDeObjetosFake.getNFNotaInfoProcessoReferenciado()); infoAdicionais.setProcessosRefenciado(processosRefenciado); return infoAdicionais; @@ -623,7 +455,7 @@ public static NFNotaInfoIdentificacao getNFNotaInfoIdentificacao() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -697,7 +529,7 @@ public static NFNotaInfoCompra getNFNotaInfoCompra() { public static NFNotaInfoCobranca getNFNotaInfoCobranca() { final NFNotaInfoCobranca cobranca = new NFNotaInfoCobranca(); cobranca.setFatura(FabricaDeObjetosFake.getNFNotaInfoFatura()); - cobranca.setDuplicatas(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoDuplicata())); + cobranca.setDuplicatas(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoDuplicata())); return cobranca; } @@ -784,11 +616,11 @@ public static NFNotaInfoItemProduto getNFNotaInfoItemProduto() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); produto.setCodigoEspecificadorSituacaoTributaria("9999999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -802,7 +634,7 @@ public static NFNotaInfoItemProduto getNFNotaInfoItemProduto() { produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); return produto; } @@ -862,7 +694,7 @@ public static NFNotaInfoItemProdutoMedicamento getNFNotaInfoItemProdutoMedicamen public static NFNotaInfoItemProdutoDeclaracaoImportacao getNFNotaInfoItemProdutoDeclaracaoImportacao() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -1103,7 +935,7 @@ public static NFNotaInfoISSQNTotal getNFNotaInfoISSQNTotal() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -1230,7 +1062,7 @@ public static NFNotaInfoFatura getNFNotaInfoFatura() { public static NFNotaInfoDuplicata getNFNotaInfoDuplicata() { final NFNotaInfoDuplicata duplicata = new NFNotaInfoDuplicata(); - duplicata.setDataVencimento(new LocalDate(2014, 07, 10)); + duplicata.setDataVencimento(new LocalDate(2014, 7, 10)); duplicata.setNumeroDuplicata("TQ49cyOL5KtBAUTF0LShhThpUbtCK1fQH1PH4AMcKzMNLxyDbV957IRhWK8Z"); duplicata.setValorDuplicata(new BigDecimal("999999.99")); return duplicata; @@ -1241,7 +1073,7 @@ public static NFNotaInfoVolume getNFNotaInfoVolume() { volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb"); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2"); - volume.setLacres(Arrays.asList(notaInfoLacre)); + volume.setLacres(Collections.singletonList(notaInfoLacre)); volume.setMarca("lc0w13Xw2PxsSD4u4q3N6Qix9ZuCFm0HXo6BxBmKnjVbh9Xwy3k9UwBNfuYo"); volume.setNumeracaoVolumesTransportados("mcBUtZwnI5DKj2YZNAcLP7W9h6j1xKmF5SX1BTKmsvyg0H5xSrfVw8HGn8eb"); volume.setPesoBruto(new BigDecimal("1.358")); diff --git a/src/test/java/com/fincatto/nfe310/classes/NFAutorizador31Test.java b/src/test/java/com/fincatto/nfe310/classes/NFAutorizador31Test.java index eaaff2b21..4e30158ff 100644 --- a/src/test/java/com/fincatto/nfe310/classes/NFAutorizador31Test.java +++ b/src/test/java/com/fincatto/nfe310/classes/NFAutorizador31Test.java @@ -1,11 +1,11 @@ package com.fincatto.nfe310.classes; -import java.util.Arrays; -import java.util.List; - import org.junit.Assert; import org.junit.Test; +import java.util.Arrays; +import java.util.List; + public class NFAutorizador31Test { @Test @@ -242,27 +242,31 @@ public void deveBuscarCorretamenteURLWebServiceSCAN() { Assert.assertEquals("https://www.svc.fazenda.gov.br/NfeRetAutorizacao/NfeRetAutorizacao.asmx", autorizador.getNfeRetAutorizacao(NFAmbiente.PRODUCAO)); Assert.assertEquals("https://www.svc.fazenda.gov.br/NfeStatusServico2/NfeStatusServico2.asmx", autorizador.getNfeStatusServico(NFAmbiente.PRODUCAO)); Assert.assertEquals("https://www.svc.fazenda.gov.br/RecepcaoEvento/RecepcaoEvento.asmx", autorizador.getRecepcaoEvento(NFAmbiente.PRODUCAO)); + } - try { - autorizador.getNfeInutilizacao(NFAmbiente.HOMOLOGACAO); - Assert.fail("SCAN nao possui servico de inutilizacao"); - } catch (final UnsupportedOperationException e) { - } - try { - autorizador.getNfeInutilizacao(NFAmbiente.PRODUCAO); - Assert.fail("SCAN nao possui servico de inutilizacao"); - } catch (final UnsupportedOperationException e) { - } + @Test(expected = UnsupportedOperationException.class) + public void naoPodeInutilizarNotasNoSCANEmProducao() { + NFAutorizador31.SCAN.getNfeInutilizacao(NFAmbiente.PRODUCAO); + } + + @Test(expected = UnsupportedOperationException.class) + public void naoPodeInutilizarNotasNoSCANEmHomologacao() { + NFAutorizador31.SCAN.getNfeInutilizacao(NFAmbiente.HOMOLOGACAO); } @Test(expected = UnsupportedOperationException.class) - public void deveLancarExcecaoCasoTenteObterServicoIndisponivelSCAN() { + public void naoPodeConsultarCadastroNoSCANEmHomologacao() { NFAutorizador31.SCAN.getConsultaCadastro(NFAmbiente.HOMOLOGACAO); } + @Test(expected = UnsupportedOperationException.class) + public void naoPodeConsultarCadastroNoSCANEmProducao() { + NFAutorizador31.SCAN.getConsultaCadastro(NFAmbiente.PRODUCAO); + } + @Test public void naoDeveTerUFsAtreladaAoSCAN() { - Assert.assertArrayEquals(new NFUnidadeFederativa[] {}, NFAutorizador31.SCAN.getUFs()); + Assert.assertArrayEquals(new NFUnidadeFederativa[]{}, NFAutorizador31.SCAN.getUFs()); } @Test @@ -310,7 +314,7 @@ public void deveLancarExcecaoCasoTenteObterServicoIndisponivelSVAN() { @Test public void deveObterAsFederacoesQueSVANEhResponsavel() { - Assert.assertTrue(Arrays.deepEquals(NFAutorizador31.SVAN.getUFs(), new NFUnidadeFederativa[] { NFUnidadeFederativa.MA, NFUnidadeFederativa.PA, NFUnidadeFederativa.PI })); + Assert.assertTrue(Arrays.deepEquals(NFAutorizador31.SVAN.getUFs(), new NFUnidadeFederativa[]{NFUnidadeFederativa.MA, NFUnidadeFederativa.PA, NFUnidadeFederativa.PI})); } @Test diff --git a/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFEnviaEventoTest.java b/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFEnviaEventoTest.java index 654c61bb0..b65991256 100644 --- a/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFEnviaEventoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFEnviaEventoTest.java @@ -1,13 +1,12 @@ package com.fincatto.nfe310.classes.cartacorrecao; -import java.math.BigDecimal; -import java.util.Arrays; - +import com.fincatto.nfe310.FabricaDeObjetosFake; +import com.fincatto.nfe310.classes.evento.cartacorrecao.NFEnviaEventoCartaCorrecao; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.evento.cartacorrecao.NFEnviaEventoCartaCorrecao; +import java.math.BigDecimal; +import java.util.Collections; public class NFEnviaEventoTest { @@ -27,7 +26,7 @@ public void naoDevePermitirEventoNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirIdLoteNulo() { final NFEnviaEventoCartaCorrecao enviaEvento = new NFEnviaEventoCartaCorrecao(); - enviaEvento.setEvento(Arrays.asList(FabricaDeObjetosFake.getNFEvento())); + enviaEvento.setEvento(Collections.singletonList(FabricaDeObjetosFake.getNFEvento())); enviaEvento.setVersao(new BigDecimal("1.00")); enviaEvento.toString(); } @@ -35,7 +34,7 @@ public void naoDevePermitirIdLoteNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirVersaoNulo() { final NFEnviaEventoCartaCorrecao enviaEvento = new NFEnviaEventoCartaCorrecao(); - enviaEvento.setEvento(Arrays.asList(FabricaDeObjetosFake.getNFEvento())); + enviaEvento.setEvento(Collections.singletonList(FabricaDeObjetosFake.getNFEvento())); enviaEvento.setIdLote("999999999999999"); enviaEvento.toString(); } @@ -43,7 +42,7 @@ public void naoDevePermitirVersaoNulo() { @Test public void deveGerarXMLDeAcordoComOPadraoEstabelecido() { final NFEnviaEventoCartaCorrecao enviaEvento = new NFEnviaEventoCartaCorrecao(); - enviaEvento.setEvento(Arrays.asList(FabricaDeObjetosFake.getNFEvento())); + enviaEvento.setEvento(Collections.singletonList(FabricaDeObjetosFake.getNFEvento())); enviaEvento.setIdLote("999999999999999"); enviaEvento.setVersao(new BigDecimal("1.00")); diff --git a/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFInfoEventoCartaCorrecaoTest.java b/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFInfoEventoCartaCorrecaoTest.java index e5bd18da8..b1ece5720 100644 --- a/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFInfoEventoCartaCorrecaoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/cartacorrecao/NFInfoEventoCartaCorrecaoTest.java @@ -1,15 +1,14 @@ package com.fincatto.nfe310.classes.cartacorrecao; -import java.math.BigDecimal; - -import org.joda.time.DateTime; -import org.junit.Assert; -import org.junit.Test; - import com.fincatto.nfe310.FabricaDeObjetosFake; import com.fincatto.nfe310.classes.NFAmbiente; import com.fincatto.nfe310.classes.NFUnidadeFederativa; import com.fincatto.nfe310.classes.evento.NFInfoEvento; +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Test; + +import java.math.BigDecimal; public class NFInfoEventoCartaCorrecaoTest { @@ -37,7 +36,7 @@ public void naoDevePermitirAmbienteNulo() { infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); @@ -52,7 +51,7 @@ public void naoDevePermitirCartaCorrecaoNulo() { infoEvento.setAmbiente(NFAmbiente.HOMOLOGACAO); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); @@ -67,7 +66,7 @@ public void naoDevePermitirChaveNulo() { infoEvento.setAmbiente(NFAmbiente.HOMOLOGACAO); infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); @@ -82,7 +81,7 @@ public void devePermitirCnpjNulo() { infoEvento.setAmbiente(NFAmbiente.HOMOLOGACAO); infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); @@ -113,7 +112,7 @@ public void naoDevePermitirIdNulo() { infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); infoEvento.setTipoEvento("110110"); @@ -128,7 +127,7 @@ public void naoDevePermitirNumeroSequencialEventoNulo() { infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setOrgao(NFUnidadeFederativa.SC); infoEvento.setTipoEvento("110110"); @@ -143,7 +142,7 @@ public void naoDevePermitirOrgaoNulo() { infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setTipoEvento("110110"); @@ -158,7 +157,7 @@ public void naoDevePermitirTipoEventoNulo() { infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); @@ -173,7 +172,7 @@ public void naoDevePermitirVersaoEventoNulo() { infoEvento.setDadosEvento(FabricaDeObjetosFake.getNFInfoCartaCorrecao()); infoEvento.setChave("81568004734874930428983724940883089298523837"); infoEvento.setCnpj("02224343323426"); - infoEvento.setDataHoraEvento(new DateTime(2014, 01, 01, 10, 10, 10)); + infoEvento.setDataHoraEvento(new DateTime(2014, 1, 1, 10, 10, 10)); infoEvento.setId("ID1101108156800473487493042898372494088308929852383799"); infoEvento.setNumeroSequencialEvento(99); infoEvento.setOrgao(NFUnidadeFederativa.SC); diff --git a/src/test/java/com/fincatto/nfe310/classes/evento/NFEnviaEventoRetornoTest.java b/src/test/java/com/fincatto/nfe310/classes/evento/NFEnviaEventoRetornoTest.java index 39a064091..9fe1e96d8 100644 --- a/src/test/java/com/fincatto/nfe310/classes/evento/NFEnviaEventoRetornoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/evento/NFEnviaEventoRetornoTest.java @@ -1,12 +1,11 @@ package com.fincatto.nfe310.classes.evento; -import java.util.ArrayList; - +import com.fincatto.nfe310.classes.NFAmbiente; +import com.fincatto.nfe310.classes.NFUnidadeFederativa; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.classes.NFAmbiente; -import com.fincatto.nfe310.classes.NFUnidadeFederativa; +import java.util.ArrayList; public class NFEnviaEventoRetornoTest { @@ -29,7 +28,7 @@ public void deveObterCodigoStatusRepostaComoFoiSetado() { @Test public void deveObterEventoRetornoComoFoiSetado() { final NFEnviaEventoRetorno eventoRetorno = new NFEnviaEventoRetorno(); - final ArrayList eventosRetorno = new ArrayList(); + final ArrayList eventosRetorno = new ArrayList<>(); eventoRetorno.setEventoRetorno(eventosRetorno); Assert.assertEquals(eventosRetorno, eventoRetorno.getEventoRetorno()); } diff --git a/src/test/java/com/fincatto/nfe310/classes/evento/cancelamento/NFEnviaEventoCancelamentoTest.java b/src/test/java/com/fincatto/nfe310/classes/evento/cancelamento/NFEnviaEventoCancelamentoTest.java index 3fab2a3a7..68c19b3ca 100644 --- a/src/test/java/com/fincatto/nfe310/classes/evento/cancelamento/NFEnviaEventoCancelamentoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/evento/cancelamento/NFEnviaEventoCancelamentoTest.java @@ -1,21 +1,20 @@ package com.fincatto.nfe310.classes.evento.cancelamento; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import com.fincatto.nfe310.FabricaDeObjetosFake; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class NFEnviaEventoCancelamentoTest { @Test public void deveObterEventosComoFoiSetado() { final NFEnviaEventoCancelamento eventoCancelamento = new NFEnviaEventoCancelamento(); - final ArrayList eventosCancelamento = new ArrayList(); + final ArrayList eventosCancelamento = new ArrayList<>(); eventoCancelamento.setEvento(eventosCancelamento); Assert.assertEquals(eventosCancelamento, eventoCancelamento.getEvento()); } @@ -86,7 +85,7 @@ public void naoDevePermitirVersaoNulo() { @Test public void deveGerarXMLDeAcordoComOPadraoEstabelecido() { final NFEnviaEventoCancelamento eventoCancelamento = new NFEnviaEventoCancelamento(); - eventoCancelamento.setEvento(Arrays.asList(FabricaDeObjetosFake.getNFEventoCancelamento())); + eventoCancelamento.setEvento(Collections.singletonList(FabricaDeObjetosFake.getNFEventoCancelamento())); eventoCancelamento.setVersao(new BigDecimal("3.10")); eventoCancelamento.setIdLote("1"); diff --git a/src/test/java/com/fincatto/nfe310/classes/lote/consulta/NFLoteConsultaRetornoTest.java b/src/test/java/com/fincatto/nfe310/classes/lote/consulta/NFLoteConsultaRetornoTest.java index e30524a22..54602d4f5 100755 --- a/src/test/java/com/fincatto/nfe310/classes/lote/consulta/NFLoteConsultaRetornoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/lote/consulta/NFLoteConsultaRetornoTest.java @@ -1,14 +1,13 @@ package com.fincatto.nfe310.classes.lote.consulta; -import java.util.Arrays; - +import com.fincatto.nfe310.FabricaDeObjetosFake; +import com.fincatto.nfe310.classes.NFAmbiente; +import com.fincatto.nfe310.classes.NFUnidadeFederativa; import org.joda.time.LocalDateTime; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.NFAmbiente; -import com.fincatto.nfe310.classes.NFUnidadeFederativa; +import java.util.Collections; public class NFLoteConsultaRetornoTest { @@ -18,7 +17,7 @@ public void deveGerarXMLDeAcordoComOPadraoEstabelecido() { retorno.setAmbiente(NFAmbiente.HOMOLOGACAO); retorno.setMotivo("8CwtnC5gWwUncMBYAZl9p4fvVx8RkCH2EKx2mtUNVA5tLoJsjNWL5CJ6DXNUHTWKpPl6fMKKxA0aXBu6IfmJLIHlPxtF0oZkKrNsGyGpwKqWxvDZ9HQGqscmhtTrp5NbNzk9TOsCJaMU59tF8kOxu0EUZAMLF8bGJteg86T4hQ6ej5Zi0n1Tin0vFAtN1ue68NWrfQWM11VPpqvSXRlaa8qIw1Qal8tWCFGJA0wZpl7eV98bAYL18pt3e71yKcX"); retorno.setNumeroRecibo("123456789012345"); - retorno.setProtocolos(Arrays.asList(FabricaDeObjetosFake.getNFProtocolo())); + retorno.setProtocolos(Collections.singletonList(FabricaDeObjetosFake.getNFProtocolo())); retorno.setStatus("eeowo"); retorno.setUf(NFUnidadeFederativa.SC); retorno.setVersao("3.10"); diff --git a/src/test/java/com/fincatto/nfe310/classes/lote/envio/NFLoteEnvioTest.java b/src/test/java/com/fincatto/nfe310/classes/lote/envio/NFLoteEnvioTest.java index ebb0ebd19..2724dea09 100755 --- a/src/test/java/com/fincatto/nfe310/classes/lote/envio/NFLoteEnvioTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/lote/envio/NFLoteEnvioTest.java @@ -6,7 +6,7 @@ import org.junit.Test; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.List; public class NFLoteEnvioTest { @@ -44,7 +44,7 @@ public void naoDevePermitirIndicadorProcessamentoNulo() { final NFLoteEnvio loteEnvio = new NFLoteEnvio(); loteEnvio.setVersao("3.10"); loteEnvio.setIdLote("333972757970401"); - loteEnvio.setNotas(Arrays.asList(FabricaDeObjetosFake.getNFNota())); + loteEnvio.setNotas(Collections.singletonList(FabricaDeObjetosFake.getNFNota())); loteEnvio.toString(); } @@ -52,7 +52,7 @@ public void naoDevePermitirIndicadorProcessamentoNulo() { public void naoDevePermitirVersaoNulo() { final NFLoteEnvio loteEnvio = new NFLoteEnvio(); loteEnvio.setIdLote("333972757970401"); - loteEnvio.setNotas(Arrays.asList(FabricaDeObjetosFake.getNFNota())); + loteEnvio.setNotas(Collections.singletonList(FabricaDeObjetosFake.getNFNota())); loteEnvio.setIndicadorProcessamento(NFLoteIndicadorProcessamento.PROCESSAMENTO_ASSINCRONO); loteEnvio.toString(); } @@ -61,7 +61,7 @@ public void naoDevePermitirVersaoNulo() { public void naoDevePermitirIdLoteNulo() { final NFLoteEnvio loteEnvio = new NFLoteEnvio(); loteEnvio.setVersao("3.10"); - loteEnvio.setNotas(Arrays.asList(FabricaDeObjetosFake.getNFNota())); + loteEnvio.setNotas(Collections.singletonList(FabricaDeObjetosFake.getNFNota())); loteEnvio.setIndicadorProcessamento(NFLoteIndicadorProcessamento.PROCESSAMENTO_ASSINCRONO); loteEnvio.toString(); } @@ -81,7 +81,7 @@ public void deveGerarXMLDeAcordoComOPadraoEstabelecido() { loteEnvio.setIdLote("333972757970401"); loteEnvio.setVersao("3.10"); loteEnvio.setIndicadorProcessamento(NFLoteIndicadorProcessamento.PROCESSAMENTO_ASSINCRONO); - loteEnvio.setNotas(Arrays.asList(FabricaDeObjetosFake.getNFNota())); + loteEnvio.setNotas(Collections.singletonList(FabricaDeObjetosFake.getNFNota())); final String xmlEsperado = "33397275797040104399999999qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ1559999999999992010-10-27T10:10:10-02:002013-09-24T10:10:10-03:0001161267521811100532ng7VURPgovC5BYaZy2014-10-10T10:10:10-03:00b1Aj7VBU5I0LDthlrWTk73otsFXSVbiNYyAgGZjLYT0pftpjhGzQEAtnolQoAEB3omnxNq8am4iMqwwviuaXRHjiYWY7YaPITlDN7cDN9obnhEqhDhkgKphRBY5frTfD6unwTB4w7j6hpY2zNNzWwbNJzPGgDmQ8WhBDnpq1fQOilrcDspY7SGkNDfjxpGTQyNSNsmF4B2uHHLhGhhxG2qVq2bFUvHFqSL8atQAuYpyn3wplW21v88N96PnF0MEV1950618829399366663076081370906478143894581612345678901Rhass3yMarv7W26gljGNMGXXyPZfSFDEiN472mTU7UWxokviyHMfeD7vCVg3TKuTABBqcwEOeMwQepTIAvhOPx8qDf8Q5C8fbGgjonxl1ML9NErg9yVk2bGnNKwaAJ5ZJ49aQYmqBvxMhBzkGUqvtXnqusGEtjDzKCXPGwrEZCS8LGKHyBbV11mzXHR8rZTgfE35EqfGhiShiIwQfLCAziFDXVgs3EjLSPkZkCvfGNLMEf5yFr3gSvoAeKbGpQD3r98KFeB50P3Gq14XBVsv5fpiaBvJ3HTOpREiwYGs20Xw67LQFlXOBK0JqAE1rFi2CEyUGW5Z8QmmHhzmZ9GABVLKa9AbV0uFR0onl7nU9999999s1Cr2hWP6bptQ80A9vWBuTaODR1U82LtKQi1DEm3LsAXu9AbkSeCtfXJVTKGRS880955501058123456789013241234567890123484371964648860zjfBnFVG8TBq8iW0111111312345678901234qNre0x2eJthUYIoKBuBbbGSeA4R2wrDLxNwCuDFkYD54flBLbBBMakGDgQUVNn5PPREBbkfmmk4lBFwgvkuKg8prnY5CPqHIzqGiD1lTnZJ37nAZ4NBc8XwMlkLip3hIYSAIzH3Tf1LWQsaybqB76V66lMgWBcHVwcOKInuJ8mGUyY8DT4NL81579357RSqqDt1f1ulcahrBnUH0otPFkjYqD2tH4ktYsR71WSYZLFW1zZObAqajHHkyxi2014-01-13999999999999.99YQFmDI2HBjjfZpRjR2ghwmSo1oWk5QgUEYf2oG46uEHwY4zsXyH1ORSr8oq32014-03-2112345678901234F7HL85M9v7jW5lX4Z9V7sF3kshuj967gj4uACEmpmVQgM9yYeQAgaY5EcSfRNKwaAJ5ZJ49aQYmqBvxMhBzkGUqvtXnqusGEtjDzKCXPGwrEZCS8LGKHyBbV11mzXHR8rZTgfE35EqfGhiShiIwQfLCAziFDXVgs3EjLSPkZkCvfGNLMEf5yFr3gSvoAeKbGpQD3r98KFeB50P3Gq14XBVsv5fpiaBvJ3HTOpREiwYGs20Xw67LQFlXOBK0JqAE1rFi2CEyUGW5Z8QmmHhzmZ9GABVLKa9AbV0uFR0onl7nU9999999s1Cr2hWP6bptQ80A9vWBuTaODR1U82LtKQi1DEm3LsAXu9AbkSeCtfXJVTKGRS880955501058123456789013249132456789012349999999995ow5E1mZQPe1VURivU3ctXKzImStrYzRpDTXRyCfSzxlEe5GTbeyVZ1OlIvgKGLJJMJlaKtYj8K12345678901234t59le7pl2eVn390y026Ebgh3HXtvEBzsMp4BzZJEwIazezToxeeKJCvm1GoGYHTewrLNvzYaBmSbwxkDYcEZTCMORFVPAc6t6C5p0Bfu1globey70KWnaHHaifyKIg3j3eZtlNVAj3XJYZiJCrul6VLL85E7x6Kx6DVeChwlRLEkCQn7k5peJE17uXBNBnYTSTSQgqXcGLOR6f22SnahtFHr5MoHQZtZhTowVe3SVwl57kil9999999OpXKhaHINo7OwLkVGvRq43HNwyBAgXTKcarl6Jsq8NzOBs70eZM4zL6fELOIRS12345678901234t59le7pl2eVn390y026Ebgh3HXtvEBzsMp4BzZJEwIazezToxeeKJCvm1GoGYHTewrLNvzYaBmSbwxkDYcEZTCMORFVPAc6t6C5p0Bfu1globey70KWnaHHaifyKIg3j3eZtlNVAj3XJYZiJCrul6VLL85E7x6Kx6DVeChwlRLEkCQn7k5peJE17uXBNBnYTSTSQgqXcGLOR6f22SnahtFHr5MoHQZtZhTowVe3SVwl57kil9999999OpXKhaHINo7OwLkVGvRq43HNwyBAgXTKcarl6Jsq8NzOBs70eZM4zL6fELOIRS12345678901234ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq36811963532505OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP99999999AZ012399999999991302Bta64y9999999999.99999999999999.9999999999999999999999.99368119635325057wqG4h9999999999.99999999999999.9999999999999999999999.99999999999999.99999999999999.99999999999999.991ZRJihqWLyHnb2014-02-02kiVfWKB94ggsrWND0XBXwEjJkoiTXhkmX9qKGKzjpnEHHp852bDkYeEUkzpURS2014-01-014999999999999.99312345678901234RSE9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU999999sA2FBRFMMNgF1AKRDDXYOlc3zGvzEc69l6zQ5O5uAUe82XZ3szQfw01DW0Ki999999999999.9999999999999NNxQ9nrQ3HCe5Mc999999yq50jVDZsvQVNuWoS45U9999999.9992014-01-012015-01-01999999999999.99999999999999.990001999999999999.9999.99999999999999.99157br12345678901234iNEFifS1jexTxcCvgjlQ186nR6JAwM2koyjbWKA1DJSLmZy432GoSwoygXc5999999999999aT249999999999999.9999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.9901999999999999.9999.99999999999999.9999999999999.99999999999999.9999999999999999.9901999999999999.9999.99999999999999.99999999999999.9999.99999999999999.009999999999999.99999.9999999.99997.00999.99999999999999999.999999999999999.999999999999999.99100.009999999999999.99R3s36BVI9k15xOe3hnlEpZRpPHEom9inv4hE1oo8hzHYG8X6D9sQjt6oLYiH6yToSFM95zueMhE4s270GB7iLUKcQTRHWLcHb1TU2fSYx2NAz5ZflI3hoTnN8zmqJtGzneaNpDRA5gJW7wxMg9IXIuUCxg25MlIQ46AbDQNc3HLl82g3awWKigBMli0bUEWIMf8C2GG2sB2Y9w1GnsfiDvw7RUuU5vATfWWvYFRCehm2UpDhBlrBjjXcWKYzXsT3x2PNtCC82JqY1nkKrgt2AHCPUjM0tCQk5EHFcssb8I0Rkc4s8aNcARXtFrBzmWqXDQPmCpLIGaAo7LlypOKKaqUNqkRkf8c930p8HaRDvQJealZsVnpwJn3Ev7yEaBZ9INe5PXFwkTQEfpNE3B8IokFMh0aUbu8mfzjKLBazSKW2qA4faIo2Wp5FmOmTzCMiPqznOq3Bl0zM4wmuo0rOXbswjaCUzPB0KpM8Yaze9TArOEDrV6Li999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.992014-01-01999999999999.99999999999999.99999999999999.99999999999999.99999999999999.993999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.99999999999999.999348432740001644lb4Qv5yi9oYq7s8fF98a0EEv98oAxl0CIs5gzyKNVp1skE3IHD9Z7JbjHCnISENTOD8nOWsHxI5K4RgYTUGwWgIKajhiUf4Q7aOOmaTV2wnYV0kQ5MezOjqfoPcNY4lb4Qv5yi9oYq7s8fF98a0EEv98oAxl0CIs5gzyKNVp1skE3IHD9Z7JbjHCnSP999999999999.99999999999999.9999.99999999999999.9953519999999MKZ4891SC999999999993Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecblc0w13Xw2PxsSD4u4q3N6Qix9ZuCFm0HXo6BxBmKnjVbh9Xwy3k9UwBNfuYomcBUtZwnI5DKj2YZNAcLP7W9h6j1xKmF5SX1BTKmsvyg0H5xSrfVw8HGn8eb1.0001.358gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2KDVAp0aewPjmHaTsjbDX1O6NOR9tc7TxGflFLXsMZt2hEKar3oqzZ11uzEQF3001.150.153000.00TQ49cyOL5KtBAUTF0LShhThpUbtCK1fQH1PH4AMcKzMNLxyDbV957IRhWK8Z2014-07-10999999.9903999999999999.99112345678901234029ItpS1hBk3TyhjUB3I90qe7Qi21GMSBan0iZLatpXAQAEhXEWZAO0HhHlQLlX18rryo9e1IX5Prav6fvNgZwfppMXa2RzJ7wyDH4gK3VEjeTARJ2iOLtZFDWrEaNMcGnKiusILw5bnRqBLxQfrtkTwcikLpsoI3ULurBUMMbSh1nJboZzwHUhWfArMie6CK1qBWeqgDUqMLXvkyZN66tOcBU4gv6oPZLaIJkblNYTZTEe4L1B5fx2TWec7P5Fi6HTWZiupnonWvZ51tPotK8g52ZUPXSl0lDbtWEkCGgWch0LX5xaalPL4taLgXJo1aJ1KwqSGh2SXPX9Vp316yZX6kiw6Z2yQnBN0cEfbVLp8wlYaAtsyWRGBSpqg6L3yjyciUeXkIWziOzuK0mtHsgqlXVcXLbh6sfx1zv9R3E3ITMbWOKMknfnrvoffPGJYj6p3300K4vfvUBo8ryf54eEHDhNHeegc4LMtrg2KYmr1a3QweF5B2lgNsWoyKkZ1eBU81vBNJsK9qwgeRxwBj5wqbYkk6JIKK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HML73tIXUvsLEMijwgwjHVRfpP6upxiuipvEcQcSp8fpV402GXe3nXEHXJKJoML73tIXUvsLEMijwgwjHVRfpP6upxiuipvEcQcSp8fpV402GXe3nXEHXJKJoSziSRSIRZvYWlxcbmmJfRZsLgVHaHTurUL9ea1kwFe7fssrxTVSK6uaFwGO51RSxEb99u9TExujbhMIcO9u9ycsZAg2gtKzIFgsUogoVjuyDAhnlkZz3I5HpccmxEb99u9TExujbhMIcO9u9ycsZAg2gtKzIFgsUogoVjuyDAhnlkZz3I5Hpccmabcefghijklmnopqrstuvx1kG8gghJ0YTrUZnt00BJlOsFCtj43eV5mEHHXUzp3rD6QwwUwX4GPavXkMB19tQtearTIcXmO9vxNr3TPhSaItw5mk3zyTVlf2aIFXqqvtXrHoa0qPWKzUzc2013/201406/2013330.00000011080900.002000.70980.00"; Assert.assertEquals(xmlEsperado, loteEnvio.toString()); diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFGeraQRCodeTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFGeraQRCodeTest.java index d117ab7f9..d0881d479 100644 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFGeraQRCodeTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFGeraQRCodeTest.java @@ -1,36 +1,29 @@ package com.fincatto.nfe310.classes.nota; -import java.io.IOException; -import java.security.NoSuchAlgorithmException; - -import org.junit.Assert; -import org.junit.Test; - import com.fincatto.nfe310.FabricaDeObjetosFake; import com.fincatto.nfe310.NFeConfig; -import com.fincatto.nfe310.classes.NFAmbiente; -import com.fincatto.nfe310.classes.NFTipoEmissao; import com.fincatto.nfe310.classes.NFUnidadeFederativa; import com.fincatto.nfe310.utils.NFGeraQRCode; +import org.junit.Assert; +import org.junit.Test; + +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; public class NFGeraQRCodeTest { //EXEMPLO DO MANUAL DA RECEITA - public static final String URL_TEST = "?chNFe=28140300156225000131650110000151341562040824&nVersao=100&tpAmb=1&cDest=13017959000181&dhEmi=323031342d30332d31385431303a35353a33332d30333a3030&vNF=60.90&vICMS=12.75&digVal=797a4759685578312f5859597a6b7357422b6650523351633530633d&cIdToken=000001&cHashQRCode=329f9d7b9fc5650372c1b2699ab88e9e22e0d33a"; + private static final String URL_TEST = "?chNFe=28140300156225000131650110000151341562040824&nVersao=100&tpAmb=2&cDest=13017959000181&dhEmi=323031342d30332d31385431303a35353a33332d30333a3030&vNF=60.90&vICMS=12.75&digVal=797a4759685578312f5859597a6b7357422b6650523351633530633d&cIdToken=000001&cHashQRCode=fb49da11e94fccbbccb6862617f7d77163ab6bc2"; @Test public void geraQRCodeConformeEsperado() throws NoSuchAlgorithmException { - final NFNota nota = FabricaDeObjetosFake.getNotaQRCode(); - - final NFGeraQRCode qr = new NFGeraQRCode(nota, this.createConfigTest()); - final String qrCode = qr.getQRCode(); - nota.setInfoSuplementar(new NFNotaInfoSuplementar()); - nota.getInfoSuplementar().setQrCode(qrCode); + nota.getInfoSuplementar().setQrCode(new NFGeraQRCode(nota, this.createConfigTest()).getQRCode()); - final String urlUf = nota.getInfo().getIdentificacao().getUf().getQrCodeProducao(); - Assert.assertEquals(urlUf + NFGeraQRCodeTest.URL_TEST, nota.getInfoSuplementar().getQrCode()); + final String urlEsperada = nota.getInfo().getIdentificacao().getUf().getQrCodeHomologacao() + NFGeraQRCodeTest.URL_TEST; + Assert.assertEquals(urlEsperada, nota.getInfoSuplementar().getQrCode()); } @Test @@ -58,17 +51,7 @@ public NFUnidadeFederativa getCUF() { } @Override - public NFAmbiente getAmbiente() { - return NFAmbiente.PRODUCAO; - } - - @Override - public NFTipoEmissao getTipoEmissao() { - return null; - } - - @Override - public String getSSLProtocolo() { + public KeyStore getCertificadoKeyStore() throws KeyStoreException { return null; } @@ -78,7 +61,7 @@ public String getCertificadoSenha() { } @Override - public byte[] getCertificado() throws IOException { + public KeyStore getCadeiaCertificadosKeyStore() throws KeyStoreException { return null; } @@ -86,11 +69,6 @@ public byte[] getCertificado() throws IOException { public String getCadeiaCertificadosSenha() { return null; } - - @Override - public byte[] getCadeiaCertificados() throws IOException { - return null; - } }; } } \ No newline at end of file diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoDuplicataTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoDuplicataTest.java index d84151f0f..df2700c82 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoDuplicataTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoDuplicataTest.java @@ -1,13 +1,11 @@ package com.fincatto.nfe310.classes.nota; -import java.math.BigDecimal; - +import com.fincatto.nfe310.FabricaDeObjetosFake; import org.joda.time.LocalDate; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoDuplicata; +import java.math.BigDecimal; public class NFNotaInfoDuplicataTest { @@ -19,7 +17,7 @@ public void naoDevePermitirNumeroDuplicataTamanhoInvalido() { @Test(expected = IllegalStateException.class) public void naoDevePermitirValorDuplicataNulo() { final NFNotaInfoDuplicata duplicata = new NFNotaInfoDuplicata(); - duplicata.setDataVencimento(new LocalDate(2014, 07, 10)); + duplicata.setDataVencimento(new LocalDate(2014, 7, 10)); duplicata.setNumeroDuplicata("TQ49cyOL5KtBAUTF0LShhThpUbtCK1fQH1PH4AMcKzMNLxyDbV957IRhWK8Z"); duplicata.toString(); } @@ -27,7 +25,7 @@ public void naoDevePermitirValorDuplicataNulo() { @Test public void devePermitirNumeroDuplicataNulo() { final NFNotaInfoDuplicata duplicata = new NFNotaInfoDuplicata(); - duplicata.setDataVencimento(new LocalDate(2014, 07, 10)); + duplicata.setDataVencimento(new LocalDate(2014, 7, 10)); duplicata.setValorDuplicata(new BigDecimal("999999.99")); duplicata.toString(); } 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 247d5632e..0ddf5e4e0 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoISSQNTotalTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoISSQNTotalTest.java @@ -1,12 +1,11 @@ package com.fincatto.nfe310.classes.nota; -import java.math.BigDecimal; - +import com.fincatto.nfe310.FabricaDeObjetosFake; import org.joda.time.LocalDate; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; +import java.math.BigDecimal; public class NFNotaInfoISSQNTotalTest { @@ -60,7 +59,7 @@ public void devePermitirTributacaoNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -78,7 +77,7 @@ public void devePermitirValorTotalRetencaoISSNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -96,7 +95,7 @@ public void devePermitirValorTotalDescontoCondicionadoNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -114,7 +113,7 @@ public void devePermitirValorTotalDescontoIncondicionadoNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoCondicionado(new BigDecimal("999999999999.99")); @@ -132,7 +131,7 @@ public void devePermitirValorOutrosNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoCondicionado(new BigDecimal("999999999999.99")); @@ -150,7 +149,7 @@ public void devePermitirValorDeducaoNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoCondicionado(new BigDecimal("999999999999.99")); @@ -185,7 +184,7 @@ public void deverPermitirTotalServicosSobNaoIncidenciaNaoTributadosICMSNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -202,7 +201,7 @@ public void devePermitirISSNulo() { issqnTotal.setValorCOFINSsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -219,7 +218,7 @@ public void devePermitirPISNulo() { issqnTotal.setValorCOFINSsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -236,7 +235,7 @@ public void devePermitirCOFINSSobreServicosNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); @@ -253,7 +252,7 @@ public void devePermitirBaseCalculoISSNulo() { issqnTotal.setValorPISsobreServicos(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalISS(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalServicosSobNaoIncidenciaNaoTributadosICMS(new BigDecimal("999999999999.99")); - issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 01, 01)); + issqnTotal.setDataPrestacaoServico(new LocalDate(2014, 1, 1)); issqnTotal.setValorDeducao(new BigDecimal("999999999999.99")); issqnTotal.setValorOutros(new BigDecimal("999999999999.99")); issqnTotal.setValorTotalDescontoIncondicionado(new BigDecimal("999999999999.99")); 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 d73b1a4fd..317fecd9b 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoIdentificacaoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoIdentificacaoTest.java @@ -1,13 +1,5 @@ package com.fincatto.nfe310.classes.nota; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.joda.time.DateTime; -import org.junit.Assert; -import org.junit.Test; - import com.fincatto.nfe310.FabricaDeObjetosFake; import com.fincatto.nfe310.classes.NFAmbiente; import com.fincatto.nfe310.classes.NFFinalidade; @@ -18,6 +10,13 @@ import com.fincatto.nfe310.classes.NFTipoEmissao; import com.fincatto.nfe310.classes.NFTipoImpressao; import com.fincatto.nfe310.classes.NFUnidadeFederativa; +import org.joda.time.DateTime; +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class NFNotaInfoIdentificacaoTest { @@ -114,7 +113,7 @@ public void naoDevePermitirIndicadorPresencaCompradorNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -143,7 +142,7 @@ public void naoDevePermitirOperacaoConsumidorFinalNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -172,7 +171,7 @@ public void naoDevePermitirIdentificadorLocalDestinoOperacaoNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -200,7 +199,7 @@ public void naoDevePermitirAmbienteNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -229,7 +228,7 @@ public void naoDevePermitirCodigoMunicipioNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -258,7 +257,7 @@ public void naoDevePermitirCodigoRandomicoNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -287,7 +286,7 @@ public void naoDevePermitirDataEmissaoNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -316,7 +315,7 @@ public void devePermitirDataSaidaNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -345,7 +344,7 @@ public void naoDevePermitirDigitoVerificadorNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -374,7 +373,7 @@ public void naoDevePermitirFinalidadeNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -403,7 +402,7 @@ public void naoDevePermitirFormaPagamentoNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -432,7 +431,7 @@ public void naoDevePermitirModeloNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -461,7 +460,7 @@ public void naoDevePermitirNaturezaOperacaoNulo() { identificacao.setModelo(NFModelo.NFE); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -490,7 +489,7 @@ public void naoDevePermitirNumeroNotaNulo() { identificacao.setModelo(NFModelo.NFE); identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -519,7 +518,7 @@ public void naoDevePermitirProgramaEmissorNulo() { identificacao.setModelo(NFModelo.NFE); identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -578,7 +577,7 @@ public void naoDevePermitirSerieNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); identificacao.setTipoImpressao(NFTipoImpressao.DANFE_NORMAL_PAISAGEM); @@ -607,7 +606,7 @@ public void naoDevePermitirTipoNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); identificacao.setTipoImpressao(NFTipoImpressao.DANFE_NORMAL_PAISAGEM); @@ -636,7 +635,7 @@ public void naoDevePermitirTipoEmissaoNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoImpressao(NFTipoImpressao.DANFE_NORMAL_PAISAGEM); @@ -665,7 +664,7 @@ public void naoDevePermitirTipoImpressaoNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -694,7 +693,7 @@ public void naoDevePermitirUfNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -723,7 +722,7 @@ public void naoDevePermitirVersaoEmissorNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -752,7 +751,7 @@ public void devePermitirDataHoraContigenciaNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); @@ -781,7 +780,7 @@ public void devePermitirJustificativaEntradaContingenciaNulo() { identificacao.setNaturezaOperacao("qGYcW8I1iak14NF7vnfc8XpPYkrHWB5J7Vm3eOAe57azf1fVP7vEOY7TrRVQ"); identificacao.setNumeroNota("999999999"); identificacao.setProgramaEmissor(NFProcessoEmissor.CONTRIBUINTE); - identificacao.setReferenciadas(Arrays.asList(FabricaDeObjetosFake.getNFInfoReferenciada())); + identificacao.setReferenciadas(Collections.singletonList(FabricaDeObjetosFake.getNFInfoReferenciada())); identificacao.setSerie("999"); identificacao.setTipo(NFTipo.ENTRADA); identificacao.setTipoEmissao(NFTipoEmissao.EMISSAO_NORMAL); diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoInformacoesAdicionaisTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoInformacoesAdicionaisTest.java index 2dbad6483..34d532277 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoInformacoesAdicionaisTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoInformacoesAdicionaisTest.java @@ -1,15 +1,11 @@ package com.fincatto.nfe310.classes.nota; -import java.util.ArrayList; -import java.util.List; - +import com.fincatto.nfe310.FabricaDeObjetosFake; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.nota.NFNotaInfoInformacoesAdicionais; -import com.fincatto.nfe310.classes.nota.NFNotaInfoObservacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoProcessoReferenciado; +import java.util.ArrayList; +import java.util.List; public class NFNotaInfoInformacoesAdicionaisTest { @@ -87,11 +83,11 @@ public void devePermitirProcessosReferenciadosNulo() { infoAdicionais.setInformacoesAdicionaisInteresseFisco("qe7Qi21GMSBan0iZLatpXAQAEhXEWZAO0HhHlQLlX18rryo9e1IX5Prav6fvNgZwfppMXa2RzJ7wyDH4gK3VEjeTARJ2iOLtZFDWrEaNMcGnKiusILw5bnRqBLxQfrtkTwcikLpsoI3ULurBUMMbSh1nJboZzwHUhWfArMie6CK1qBWeqgDUqMLXvkyZN66tOcBU4gv6oPZLaIJkblNYTZTEe4L1B5fx2TWec7P5Fi6HTWZiupnonWvZ51tPotK8g52ZUPXSl0lDbtWEkCGgWch0LX5xaalPL4taLgXJo1aJ1KwqSGh2SXPX9Vp316yZX6kiw6Z2yQnBN0cEfbVLp8wlYaAtsyWRGBSpqg6L3yjyciUeXkIWziOzuK0mtHsg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6BxEKIeMchPZ1fzx9oYP1wmk6wejvraBAAK9c2TYSGaW5ENqB1TvlDMstwGpU9XncE9mogXzpoylr4vXj0GoDB27AIxyzlZBM4wSeo96mDgyNwUGnIZeJl9YLk6Y33V7eBVpumQK3j7fzq8sQ6xn7RIYze4F4GlnzUnXG4uTM5WfDH"); - final ArrayList observacoesFisco = new ArrayList(); + final ArrayList observacoesFisco = new ArrayList<>(); observacoesFisco.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesFisco(observacoesFisco); - final ArrayList observacoesContribuinte = new ArrayList(); + final ArrayList observacoesContribuinte = new ArrayList<>(); observacoesContribuinte.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesContribuinte(observacoesContribuinte); @@ -104,11 +100,11 @@ public void devePermitirObservacoesContribuinteNulo() { infoAdicionais.setInformacoesAdicionaisInteresseFisco("qe7Qi21GMSBan0iZLatpXAQAEhXEWZAO0HhHlQLlX18rryo9e1IX5Prav6fvNgZwfppMXa2RzJ7wyDH4gK3VEjeTARJ2iOLtZFDWrEaNMcGnKiusILw5bnRqBLxQfrtkTwcikLpsoI3ULurBUMMbSh1nJboZzwHUhWfArMie6CK1qBWeqgDUqMLXvkyZN66tOcBU4gv6oPZLaIJkblNYTZTEe4L1B5fx2TWec7P5Fi6HTWZiupnonWvZ51tPotK8g52ZUPXSl0lDbtWEkCGgWch0LX5xaalPL4taLgXJo1aJ1KwqSGh2SXPX9Vp316yZX6kiw6Z2yQnBN0cEfbVLp8wlYaAtsyWRGBSpqg6L3yjyciUeXkIWziOzuK0mtHsgqlXVcXLbh6sfx1zv9R3E3ITMbWOKMknfnrvoffPGJYj6p3300K4vfvUBo8ryf54eEHDhNHeegc4LMtrg2KYmr1a3QweF5B2lgNsWoyKkZ1eBU81vBNJsK9qwgeRxwBj5wqbYkk6JIKKiSbhPgP0IE7NsuobmoSyraX5QJCNyayP1oGJxLSuHR7YCGNXYJIDv3LErhgyo3qKPs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rayList observacoesFisco = new ArrayList<>(); observacoesFisco.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesFisco(observacoesFisco); - final ArrayList processosRefenciado = new ArrayList(); + final ArrayList processosRefenciado = new ArrayList<>(); processosRefenciado.add(FabricaDeObjetosFake.getNFNotaInfoProcessoReferenciado()); infoAdicionais.setProcessosRefenciado(processosRefenciado); infoAdicionais.toString(); @@ -120,11 +116,11 @@ public void devePermitirObservacoesFiscoNulo() { infoAdicionais.setInformacoesAdicionaisInteresseFisco("qe7Qi21GMSBan0iZLatpXAQAEhXEWZAO0HhHlQLlX18rryo9e1IX5Prav6fvNgZwfppMXa2RzJ7wyDH4gK3VEjeTARJ2iOLtZFDWrEaNMcGnKiusILw5bnRqBLxQfrtkTwcikLpsoI3ULurBUMMbSh1nJboZzwHUhWfArMie6CK1qBWeqgDUqMLXvkyZN66tOcBU4gv6oPZLaIJkblNYTZTEe4L1B5fx2TWec7P5Fi6HTWZiupnonWvZ51tPotK8g52ZUPXSl0lDbtWEkCGgWch0LX5xaalPL4taLgXJo1aJ1KwqSGh2SXPX9Vp316yZX6kiw6Z2yQnBN0cEfbVLp8wlYaAtsyWRGBSpqg6L3yjyciUeXkIWziOzuK0mtHsgqlXVcXLbh6sfx1zv9R3E3ITMbWOKMknfnrvoffPGJYj6p3300K4vfvUBo8ryf54eEHDhNHeegc4LMtrg2KYmr1a3QweF5B2lgNsWoyKkZ1eBU81vBNJsK9qwgeRxwBj5wqbYkk6JIKKiSbhPgP0IE7NsuobmoSyraX5QJCNyayP1oGJxLSuHR7YCGNXYJIDv3LErhgyo3qKPsLHznYP0PfSrlOSjkJzMT4A0jUrXBH3g2coofv5kug8EmOnG0u6NG2pXwClLfI3GD14H12iugRcfYU5qMWSK09bbDcMH7XuLZumguvIMsZcPxjrhbMjokxYaMLTohkPCnUNXfAPZaayNpEnRhJwRUwFKBvNPLRXbPNjxYJKjMhgtoiSur7lWwPDtkoawI0OaJZpZFUDF7qRV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l5RqEH09eQh7NUbBEBW3qMYo9inP0aGkPzFyMQJnQ49ZqSTuxqSmWQeWHh4xGHYwMrwg9GRTS8uRvkf2v86e6OkHZwjB27HcW7QIpTAG57SR3h5zUB7X9vEFBEvCWpa2E26fEOiqJxi3hPJkJT8BYZEmezCiG7hme64ovvAKEmG1qgphblDoDYeX3mrvSzSrhIhFGGT1Qup39hIijFhMCGj54MHreV9KA6vMbGoqlI9AUwGjf7YwDLJ1KhU2a8RZ6oWYh7UZbOklkqHa6FcJbHAK7WUjyoyptlTZwmQ2ORJ4J4CKFk4H41iBJJkS6Aszj0zmCJqikJRB7SGkHMgiELk45TwnihqEKbGiPW1IvHo1Z0u9kTyD9HhTCFQbtUIqEYmbmyUlTx6QN23VrZJ7qy8WQ6NRt51GiaLscNaym8JLWByNqnJkNM690CJ3WYCu0oTIxch0rXgv4A2wZkz1g7q1VgnawWTU9T7APpjh7CZJ5mlOAZLmKVCOEFn3Tkm1kLWCBQfhg6VCXt11VsSF3bXcmZkjFcLB05aNBT8esbDO0uBVJ7wPA35xapjuLyPgt7ucGiSPrMn7acIzKWUhFjKMUrhgih2AHkm5RVoEDaaKhXFpKZS0g9yBTeRq3S6ik4QVQz755g54IwJQsS99E82wsx4uiBFCVHa6BxEKIeMchPZ1fzx9oYP1wmk6wejvraBAAK9c2TYSGaW5ENqB1TvlDMstwGpU9XncE9mogXzpoylr4vXj0GoDB27AIxyzlZBM4wSeo96mDgyNwUGnIZeJl9YLk6Y33V7eBVpumQK3j7fzq8sQ6xn7RIYze4F4GlnzUnXG4uTM5WfDH"); - final ArrayList observacoesContribuinte = new ArrayList(); + final ArrayList observacoesContribuinte = new ArrayList<>(); observacoesContribuinte.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesContribuinte(observacoesContribuinte); - final ArrayList processosRefenciado = new ArrayList(); + final ArrayList processosRefenciado = new ArrayList<>(); processosRefenciado.add(FabricaDeObjetosFake.getNFNotaInfoProcessoReferenciado()); infoAdicionais.setProcessosRefenciado(processosRefenciado); infoAdicionais.toString(); @@ -135,15 +131,15 @@ public void devePermitirInformacoesComplementaresInteresseContribuinteNulo() { final NFNotaInfoInformacoesAdicionais infoAdicionais = new NFNotaInfoInformacoesAdicionais(); infoAdicionais.setInformacoesAdicionaisInteresseFisco("qe7Qi21GMSBan0iZLatpXAQAEhXEWZAO0HhHlQLlX18rryo9e1IX5Prav6fvNgZwfppMXa2RzJ7wyDH4gK3VEjeTARJ2iOLtZFDWrEaNMcGnKiusILw5bnRqBLxQfrtkTwcikLpsoI3ULurBUMMbSh1nJboZzwHUhWfArMie6CK1qBWeqgDUqMLXvkyZN66tOcBU4gv6oPZLaIJkblNYTZTEe4L1B5fx2TWec7P5Fi6HTWZiupnonWvZ51tPotK8g52ZUPXSl0lDbtWEkCGgWch0LX5xaalPL4taLgXJo1aJ1KwqSGh2SXPX9Vp316yZX6kiw6Z2yQnBN0cEfbVLp8wlYaAtsyWRGBSpqg6L3yjyciUeXkIWziOzuK0mtHsgqlXVcXLbh6sfx1zv9R3E3ITMbWOKMknfnrvoffPGJYj6p3300K4vfvUBo8ryf54eEHDhNHeegc4LMtrg2KYmr1a3QweF5B2lgNsWoyKkZ1eBU81vBNJsK9qwgeRxwBj5wqbYkk6JIKKiSbhPgP0IE7NsuobmoSyraX5QJCNyayP1oGJxLSuHR7YCGNXYJIDv3LErhgyo3qKPsLHznYP0PfSrlOSjkJzMT4A0jUrXBH3g2coofv5kug8EmOnG0u6NG2pXwClLfI3GD14H12iugRcfYU5qMWSK09bbDcMH7XuLZumguvIMsZcPxjrhbMjokxYaMLTohkPCnUNXfAPZaayNpEnRhJwRUwFKBvNPLRXbPNjxYJKjMhgtoiSur7lWwPDtkoawI0OaJZpZFUDF7qRV9oaBnNBq0xtwN4YzoCFkNok5gtcIE6VJljMOAkT1RuRhyg5hsIxaxqJWN37NBYBJvR2m9QakYNun5eRwmkIC2ejGzyK4GlqsvkT0HZ37j6SbMajFQ50jS7bY2x4zez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J3plj"); - final ArrayList observacoesFisco = new ArrayList(); + final ArrayList observacoesFisco = new ArrayList<>(); observacoesFisco.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesFisco(observacoesFisco); - final ArrayList observacoesContribuinte = new ArrayList(); + final ArrayList observacoesContribuinte = new ArrayList<>(); observacoesContribuinte.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesContribuinte(observacoesContribuinte); - final ArrayList processosRefenciado = new ArrayList(); + final ArrayList processosRefenciado = new ArrayList<>(); processosRefenciado.add(FabricaDeObjetosFake.getNFNotaInfoProcessoReferenciado()); infoAdicionais.setProcessosRefenciado(processosRefenciado); infoAdicionais.toString(); @@ -154,15 +150,15 @@ public void devePermitirInformacoesAdicionaisInteresseFiscoNulo() { final NFNotaInfoInformacoesAdicionais infoAdicionais = new NFNotaInfoInformacoesAdicionais(); infoAdicionais.setInformacoesComplementaresInteresseContribuinte("ll8DABEZYq9OrSPlxxYlfUN9tOfpNPZ4n6K5tJ2qw2P4OXey2IkREQXzwZrA6yFLF6MtUZbu0fGqmr67RjPaHuptcEg0CpCBoSJ30P6lIeeJG3o2JLeKFzYGoaTcgQws0XqsUe0nAuX4DWWQYTMhWmlgQ60NNuaQkkS10bfDhawLK4zQAZZQzU8C6aIjApFNSMqHNWXNP3rGhvEir6SB2rsm5bcgCLyGLXTJwBl8nqZoJms3bH6wToV9HkDtUmRqQRuBhlmpr6uPlrRXUFBZUu7wHvlTQttkCQzukDZl3rxKa5mv5F8zBkMeCJDUkQiGcNq27STUJLJReip1cOEaKWBiB7r0ZDsULm1q5yKMUBbtmbMLm1rPeVJOZXtFMQo5frViL3NOZqKioH02kZzhnMTc0ySHBxlDkePRXsVkSHZSfTKxf59pMskmkg0rLDUxtcoAuD2ShGn2H4KFpTfXxrDvh6KuNRFxB0igpl2cuJFSsQwWEeDbEKRngPXY0m725n0sT7n3kSZ3ysIDsOK58Sqa7S7goKkHHms7sLDEeRI4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W5ENqB1TvlDMstwGpU9XncE9mogXzpoylr4vXj0GoDB27AIxyzlZBM4wSeo96mDgyNwUGnIZeJl9YLk6Y33V7eBVpumQK3j7fzq8sQ6xn7RIYze4F4GlnzUnXG4uTM5WfDH"); - final ArrayList observacoesFisco = new ArrayList(); + final ArrayList observacoesFisco = new ArrayList<>(); observacoesFisco.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesFisco(observacoesFisco); - final ArrayList observacoesContribuinte = new ArrayList(); + final ArrayList observacoesContribuinte = new ArrayList<>(); observacoesContribuinte.add(FabricaDeObjetosFake.getNFNotaInfoObservacao()); infoAdicionais.setObservacoesContribuinte(observacoesContribuinte); - final ArrayList processosRefenciado = new ArrayList(); + final ArrayList processosRefenciado = new ArrayList<>(); processosRefenciado.add(FabricaDeObjetosFake.getNFNotaInfoProcessoReferenciado()); infoAdicionais.setProcessosRefenciado(processosRefenciado); infoAdicionais.toString(); diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoTest.java index 61c209448..fec40f4d7 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoDeclaracaoImportacaoTest.java @@ -1,17 +1,13 @@ package com.fincatto.nfe310.classes.nota; -import java.math.BigDecimal; -import java.util.Arrays; - +import com.fincatto.nfe310.FabricaDeObjetosFake; +import com.fincatto.nfe310.classes.NFUnidadeFederativa; import org.joda.time.LocalDate; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.NFUnidadeFederativa; -import com.fincatto.nfe310.classes.nota.NFFormaImportacaoIntermediacao; -import com.fincatto.nfe310.classes.nota.NFNotaInfoItemProdutoDeclaracaoImportacao; -import com.fincatto.nfe310.classes.nota.NFViaTransporteInternacional; +import java.math.BigDecimal; +import java.util.Collections; public class NFNotaInfoItemProdutoDeclaracaoImportacaoTest { @@ -54,7 +50,7 @@ public void naoDevePermitirNumeroRegistroComTamanhoInvalido() { @Test(expected = IllegalStateException.class) public void naoDevePermitirTransporteInternacionalNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -71,7 +67,7 @@ public void naoDevePermitirTransporteInternacionalNulo() { @Test public void devePermitirValorAFRMMNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -88,7 +84,7 @@ public void devePermitirValorAFRMMNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirFormaImportacaoNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -105,7 +101,7 @@ public void naoDevePermitirFormaImportacaoNulo() { @Test public void devePermitirCnpjNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -122,7 +118,7 @@ public void devePermitirCnpjNulo() { @Test public void devePermitirUfTerceiroNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -156,7 +152,7 @@ public void naoDevePermitirAdicoesNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirCodigoExportadorNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); declaraoImportacao.setLocalDesembaraco("kiVfWKB94ggsrWND0XBXwEjJkoiTXhkmX9qKGKzjpnEHHp852bDkYeEUkzpU"); @@ -173,7 +169,7 @@ public void naoDevePermitirCodigoExportadorNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirDataDesembaracoNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); declaraoImportacao.setLocalDesembaraco("kiVfWKB94ggsrWND0XBXwEjJkoiTXhkmX9qKGKzjpnEHHp852bDkYeEUkzpU"); @@ -190,7 +186,7 @@ public void naoDevePermitirDataDesembaracoNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirDataRegistroNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setLocalDesembaraco("kiVfWKB94ggsrWND0XBXwEjJkoiTXhkmX9qKGKzjpnEHHp852bDkYeEUkzpU"); @@ -207,7 +203,7 @@ public void naoDevePermitirDataRegistroNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirLocalDesembaracoNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -224,7 +220,7 @@ public void naoDevePermitirLocalDesembaracoNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirNumeroRegistroNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); @@ -241,7 +237,7 @@ public void naoDevePermitirNumeroRegistroNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirUFDesembaracoNulo() { final NFNotaInfoItemProdutoDeclaracaoImportacao declaraoImportacao = new NFNotaInfoItemProdutoDeclaracaoImportacao(); - declaraoImportacao.setAdicoes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); + declaraoImportacao.setAdicoes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacaoAdicao())); declaraoImportacao.setCodigoExportador("E9jBqM65b0MiCiRnYil203iNGJOSZs8iU1KGmQsj2N0kw6QMuvhbsQosFGcU"); declaraoImportacao.setDataDesembaraco(new LocalDate(2014, 1, 1)); declaraoImportacao.setDataRegistro(new LocalDate(2014, 2, 2)); 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 3708b1dc3..e175ca011 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoItemProdutoTest.java @@ -1,22 +1,21 @@ package com.fincatto.nfe310.classes.nota; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import org.junit.Assert; -import org.junit.Test; - import com.fincatto.nfe310.FabricaDeObjetosFake; import com.fincatto.nfe310.classes.NFProdutoCompoeValorNota; import com.fincatto.nfe310.persister.NFPersister; +import org.junit.Assert; +import org.junit.Test; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class NFNotaInfoItemProdutoTest { @Test(expected = IllegalStateException.class) public void naoDevePermitirNomeclaturaForaDoPadrao() { - new NFNotaInfoItemProduto().setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("ABC0123")); + new NFNotaInfoItemProduto().setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("ABC0123")); } @Test(expected = NumberFormatException.class) @@ -230,10 +229,10 @@ public void devePermitirsetNomeclaturaValorAduaneiroEstatisticaNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -241,7 +240,7 @@ public void devePermitirsetNomeclaturaValorAduaneiroEstatisticaNulo() { produto.setQuantidadeTributavel(new BigDecimal("9999999999.9999")); produto.setUnidadeComercial("Bta64y"); produto.setUnidadeTributavel("7wqG4h"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorDesconto(new BigDecimal("999999999999.99")); produto.setValorFrete(new BigDecimal("999999999999.99")); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); @@ -261,10 +260,10 @@ public void devePermitirArmamentosNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -277,27 +276,27 @@ public void devePermitirArmamentosNulo() { produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirCfopNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -310,28 +309,28 @@ public void naoDevePermitirCfopNulo() { produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirCodigoNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -342,30 +341,30 @@ public void naoDevePermitirCodigoNulo() { produto.setValorDesconto(new BigDecimal("999999999999.99")); produto.setValorFrete(new BigDecimal("999999999999.99")); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirCodigoDeBarrasNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -375,7 +374,7 @@ public void naoDevePermitirCodigoDeBarrasNulo() { produto.setUnidadeTributavel("7wqG4h"); produto.setValorDesconto(new BigDecimal("999999999999.99")); produto.setValorFrete(new BigDecimal("999999999999.99")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); @@ -383,23 +382,23 @@ public void naoDevePermitirCodigoDeBarrasNulo() { produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirCodigoDeBarrasTributavelNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -416,7 +415,7 @@ public void naoDevePermitirCodigoDeBarrasTributavelNulo() { produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -424,15 +423,15 @@ public void naoDevePermitirCodigoDeBarrasTributavelNulo() { public void devePermitirCombustivelNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); produto.setCfop("1302"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -448,7 +447,7 @@ public void devePermitirCombustivelNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -460,11 +459,11 @@ public void naoDevePermitirCompoeValotNotaNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -480,7 +479,7 @@ public void naoDevePermitirCompoeValotNotaNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -494,7 +493,7 @@ public void devePermitirDeclaracoesImportacaoNulo() { produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -502,7 +501,7 @@ public void devePermitirDeclaracoesImportacaoNulo() { produto.setQuantidadeTributavel(new BigDecimal("9999999999.9999")); produto.setUnidadeComercial("Bta64y"); produto.setUnidadeTributavel("7wqG4h"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorDesconto(new BigDecimal("999999999999.99")); produto.setValorFrete(new BigDecimal("999999999999.99")); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); @@ -511,7 +510,7 @@ public void devePermitirDeclaracoesImportacaoNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -523,9 +522,9 @@ public void devePermitirDescricaoNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -538,7 +537,7 @@ public void devePermitirDescricaoNulo() { produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); @@ -553,10 +552,10 @@ public void devePermitirExtipiNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -571,7 +570,7 @@ public void devePermitirExtipiNulo() { produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); produto.toString(); } @@ -581,11 +580,11 @@ public void devePermitirMedicamentosNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); produto.setNcm("99999999"); @@ -603,7 +602,7 @@ public void devePermitirMedicamentosNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); produto.toString(); } @@ -617,10 +616,10 @@ public void naoDevePermitirNcmNulo() { produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); produto.setQuantidadeComercial(new BigDecimal("9999999999.9999")); @@ -635,8 +634,8 @@ public void naoDevePermitirNcmNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.toString(); } @@ -644,15 +643,15 @@ public void naoDevePermitirNcmNulo() { public void devePermitirNumeroPedidoClienteNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); produto.setCfop("1302"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoItemCliente(999999); produto.setQuantidadeComercial(new BigDecimal("9999999999.9999")); @@ -667,7 +666,7 @@ public void devePermitirNumeroPedidoClienteNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -677,13 +676,13 @@ public void devePermitirNumeroPedidoItemClienteNulo() { produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setQuantidadeComercial(new BigDecimal("9999999999.9999")); @@ -698,7 +697,7 @@ public void devePermitirNumeroPedidoItemClienteNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -710,10 +709,10 @@ public void naoDevePermitirQuantidadeComercialNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -726,31 +725,31 @@ public void naoDevePermitirQuantidadeComercialNulo() { produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirQuantidadeTributavelNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setQuantidadeComercial(new BigDecimal("9999999999.9999")); produto.setUnidadeComercial("Bta64y"); produto.setUnidadeTributavel("7wqG4h"); @@ -763,24 +762,24 @@ public void naoDevePermitirQuantidadeTributavelNulo() { produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirUnidadeComercialNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -789,14 +788,14 @@ public void naoDevePermitirUnidadeComercialNulo() { produto.setUnidadeTributavel("7wqG4h"); produto.setValorDesconto(new BigDecimal("999999999999.99")); produto.setValorFrete(new BigDecimal("999999999999.99")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); produto.toString(); } @@ -804,18 +803,18 @@ public void naoDevePermitirUnidadeComercialNulo() { @Test(expected = IllegalStateException.class) public void naoDevePermitirUnidadeTributavelNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -831,7 +830,7 @@ public void naoDevePermitirUnidadeTributavelNulo() { produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -843,17 +842,17 @@ public void devePermitirValorDescontoNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); produto.setQuantidadeComercial(new BigDecimal("9999999999.9999")); produto.setQuantidadeTributavel(new BigDecimal("9999999999.9999")); produto.setUnidadeComercial("Bta64y"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setUnidadeTributavel("7wqG4h"); produto.setValorFrete(new BigDecimal("999999999999.99")); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); @@ -862,7 +861,7 @@ public void devePermitirValorDescontoNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -874,11 +873,11 @@ public void devePermitirValorFreteNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -893,7 +892,7 @@ public void devePermitirValorFreteNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -905,11 +904,11 @@ public void devePermitirValorOutrasDespesasAcessoriasNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -923,7 +922,7 @@ public void devePermitirValorOutrasDespesasAcessoriasNulo() { produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -935,11 +934,11 @@ public void devePermitirValorSeguroNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -954,7 +953,7 @@ public void devePermitirValorSeguroNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -966,12 +965,12 @@ public void naoDevePermitirValorTotalBrutoNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); produto.setQuantidadeComercial(new BigDecimal("9999999999.9999")); @@ -985,25 +984,25 @@ public void naoDevePermitirValorTotalBrutoNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirValorUnitarioNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -1019,24 +1018,24 @@ public void naoDevePermitirValorUnitarioNulo() { produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @Test(expected = IllegalStateException.class) public void naoDevePermitirValorUnitarioTributavelNulo() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - produto.setArmamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); + produto.setArmamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento())); produto.setCfop("1302"); produto.setCodigo("ohVRInAS7jw8LNDP4WWjssSjBHK8nJRERnAeRMcsUokF3YItT93fBto3zZcq"); produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCombustivel(FabricaDeObjetosFake.getNFNotaInfoItemProdutoCombustivel()); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -1052,7 +1051,7 @@ public void naoDevePermitirValorUnitarioTributavelNulo() { produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setVeiculo(FabricaDeObjetosFake.getNFNotaInfoItemProdutoVeiculo()); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -1192,10 +1191,10 @@ public void devePermitirVeiculoNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -1205,14 +1204,14 @@ public void devePermitirVeiculoNulo() { produto.setUnidadeTributavel("7wqG4h"); produto.setValorDesconto(new BigDecimal("999999999999.99")); produto.setValorFrete(new BigDecimal("999999999999.99")); - produto.setDetalhesExportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); + produto.setDetalhesExportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao())); produto.setValorOutrasDespesasAcessorias(new BigDecimal("999999999999.99")); produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); produto.setNumeroControleFCI("B01F70AF-10BF-4B1F-848C-65FF57F616FE"); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.toString(); } @@ -1224,11 +1223,11 @@ public void devePermitirDetalhesExportacaoNulo() { produto.setCodigoDeBarras("36811963532505"); produto.setCodigoDeBarrasTributavel("36811963532505"); produto.setCampoeValorNota(NFProdutoCompoeValorNota.SIM); - produto.setDeclaracoesImportacao(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); + produto.setDeclaracoesImportacao(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao())); produto.setDescricao("OBS0ztekCoG0DSSVcQwPKRV2fV842Pye7mED13P4zoDczcXi4AMNvQ7BKBLnHtLc2Z9fuIY1pcKmXSK1IJQSLEs5QWvVGyC74DyJuIM0X7L0cqWPZQii5JtP"); produto.setExtipi("999"); produto.setCodigoEspecificadorSituacaoTributaria("9999999"); - produto.setMedicamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); + produto.setMedicamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento())); produto.setNcm("99999999"); produto.setNumeroPedidoCliente("NNxQ9nrQ3HCe5Mc"); produto.setNumeroPedidoItemCliente(999999); @@ -1242,7 +1241,7 @@ public void devePermitirDetalhesExportacaoNulo() { produto.setValorSeguro(new BigDecimal("999999999999.99")); produto.setValorTotalBruto(new BigDecimal("999999999999.99")); produto.setValorUnitario(new BigDecimal("9999999999.9999999999")); - produto.setNomeclaturaValorAduaneiroEstatistica(Arrays.asList("AZ0123")); + produto.setNomeclaturaValorAduaneiroEstatistica(Collections.singletonList("AZ0123")); produto.setValorUnitarioTributavel(new BigDecimal("9999999999.9999999999")); } @@ -1300,7 +1299,7 @@ public void deveObterCampoeValorNotaComoFoiSetado() { @Test public void deveObterDeclaracoesImportacaoComoFoiSetado() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - final List declaracoesImportacao = Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao()); + final List declaracoesImportacao = Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoDeclaracaoImportacao()); produto.setDeclaracoesImportacao(declaracoesImportacao); Assert.assertEquals(declaracoesImportacao, produto.getDeclaracoesImportacao()); } @@ -1332,7 +1331,7 @@ public void deveObterCodigoEspecificadorSituacaoTributariaComoFoiSetado() { @Test public void deveObterMedicamentosComoFoiSetado() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - final List medicamentos = Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento()); + final List medicamentos = Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoMedicamento()); produto.setMedicamentos(medicamentos); Assert.assertEquals(medicamentos, produto.getMedicamentos()); } @@ -1444,7 +1443,7 @@ public void deveObterValorUnitarioComoFoiSetado() { @Test public void deveObterNomeclaturaValorAduaneiroEstatisticaComoFoiSetado() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - final List nomeclaturaValorAduaneiroEstatistica = Arrays.asList("AZ0123"); + final List nomeclaturaValorAduaneiroEstatistica = Collections.singletonList("AZ0123"); produto.setNomeclaturaValorAduaneiroEstatistica(nomeclaturaValorAduaneiroEstatistica); Assert.assertEquals(nomeclaturaValorAduaneiroEstatistica, produto.getNomeclaturaValorAduaneiroEstatistica()); } @@ -1460,7 +1459,7 @@ public void deveObterValorUnitarioTributavelComoFoiSetado() { @Test public void deveObterDetalhesExportacaoComoFoiSetado() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - final List detalhesExportacao = Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao()); + final List detalhesExportacao = Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemDetalheExportacao()); produto.setDetalhesExportacao(detalhesExportacao); Assert.assertEquals(detalhesExportacao, produto.getDetalhesExportacao()); } @@ -1476,7 +1475,7 @@ public void deveObterNumeroControleFCIComoFoiSetado() { @Test public void deveObterArmamentosComoFoiSetado() { final NFNotaInfoItemProduto produto = new NFNotaInfoItemProduto(); - final List armamentos = Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento()); + final List armamentos = Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItemProdutoArmamento()); produto.setArmamentos(armamentos); Assert.assertEquals(armamentos, produto.getArmamentos()); } 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 ebe9eb67a..38c605498 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTest.java @@ -5,7 +5,7 @@ import org.junit.Test; import java.math.BigDecimal; -import java.util.Arrays; +import java.util.Collections; import java.util.List; public class NFNotaInfoTest { @@ -30,7 +30,7 @@ public void deveObterIdentificacaoComoFoiSetado() { public void deveObterVersaoComoFoiSetado() { final NFNotaInfo notaInfo = new NFNotaInfo(); notaInfo.setVersao(new BigDecimal("3.1")); - Assert.assertEquals("3.10", notaInfo.getVersao().toString()); + Assert.assertEquals("3.10", notaInfo.getVersao()); } @Test @@ -76,7 +76,7 @@ public void deveObterEntregaComoFoiSetado() { @Test public void deveObterPessoasAutorizadasDownloadNFeComoFoiSetado() { final NFNotaInfo notaInfo = new NFNotaInfo(); - final List pessoasAutorizadasDownloadNFe = Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe()); + final List pessoasAutorizadasDownloadNFe = Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe()); notaInfo.setPessoasAutorizadasDownloadNFe(pessoasAutorizadasDownloadNFe); Assert.assertEquals(pessoasAutorizadasDownloadNFe, notaInfo.getPessoasAutorizadasDownloadNFe()); } @@ -84,7 +84,7 @@ public void deveObterPessoasAutorizadasDownloadNFeComoFoiSetado() { @Test public void deveObterItensComoFoiSetado() { final NFNotaInfo notaInfo = new NFNotaInfo(); - final List itens = Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem()); + final List itens = Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem()); notaInfo.setItens(itens); Assert.assertEquals(itens, notaInfo.getItens()); } @@ -116,7 +116,7 @@ public void deveObterCobrancaComoFoiSetado() { @Test public void deveObterPagamentosComoFoiSetado() { final NFNotaInfo notaInfo = new NFNotaInfo(); - final List pagamentos = Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento()); + final List pagamentos = Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento()); notaInfo.setPagamentos(pagamentos); Assert.assertEquals(pagamentos, notaInfo.getPagamentos()); } @@ -178,16 +178,16 @@ public void devePermitirPessoasAutorizadasDownloadNFeNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -201,17 +201,17 @@ public void devePermitirAvulsaNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -225,17 +225,17 @@ public void devePermitirCanaNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -249,17 +249,17 @@ public void devePermitirCobrancaNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -273,17 +273,17 @@ public void devePermitirCompraNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -297,17 +297,17 @@ public void devePermitirDestinatarioNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -321,17 +321,17 @@ public void naoDevePermitirEmitenteNulo() { info.setDestinatario(FabricaDeObjetosFake.getNFNotaInfoDestinatario()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -345,17 +345,17 @@ public void devePermitirEntregaNulo() { info.setDestinatario(FabricaDeObjetosFake.getNFNotaInfoDestinatario()); info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -369,17 +369,17 @@ public void devePermitirExportacaoNulo() { info.setDestinatario(FabricaDeObjetosFake.getNFNotaInfoDestinatario()); info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -394,16 +394,16 @@ public void naoDevePermitirIdentificacaoNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -418,16 +418,16 @@ public void naoDevePermitirIdentificadorNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -442,16 +442,16 @@ public void devePermitirInformacoesAdicionaisNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -466,7 +466,7 @@ public void naoDevePermitirItensNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); @@ -475,7 +475,7 @@ public void naoDevePermitirItensNulo() { info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -490,16 +490,16 @@ public void devePermitirRetiradaNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -514,16 +514,16 @@ public void naoDevePermitirTotalNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -538,16 +538,16 @@ public void naoDevePermitirTransporteNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setVersao(new BigDecimal("9.99")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -562,15 +562,15 @@ public void naoDevePermitirVersaoNulo() { info.setEmitente(FabricaDeObjetosFake.getNFNotaInfoEmitente()); info.setEntrega(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setExportacao(FabricaDeObjetosFake.getNFNotaInfoExportacao()); - info.setPagamentos(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); + info.setPagamentos(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoPagamento())); info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } @@ -588,12 +588,12 @@ public void devePermitirPagamentosNulo() { info.setIdentificacao(FabricaDeObjetosFake.getNFNotaInfoIdentificacao()); info.setIdentificador("89172658591754401086218048846976493475937081"); info.setInformacoesAdicionais(FabricaDeObjetosFake.getNFNotaInfoInformacoesAdicionais()); - info.setItens(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoItem())); + info.setItens(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoItem())); info.setRetirada(FabricaDeObjetosFake.getNFNotaInfoLocal()); info.setTotal(FabricaDeObjetosFake.getNFNotaInfoTotal()); info.setTransporte(FabricaDeObjetosFake.getNFNotaInfoTransporte()); info.setVersao(new BigDecimal("3.10")); - info.setPessoasAutorizadasDownloadNFe(Arrays.asList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); + info.setPessoasAutorizadasDownloadNFe(Collections.singletonList(FabricaDeObjetosFake.getPessoaAutorizadaDownloadNFe())); info.toString(); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTransporteTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTransporteTest.java index 036ff9769..826169f2c 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTransporteTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoTransporteTest.java @@ -1,14 +1,13 @@ package com.fincatto.nfe310.classes.nota; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - +import com.fincatto.nfe310.FabricaDeObjetosFake; +import com.fincatto.nfe310.classes.NFModalidadeFrete; import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.classes.NFModalidadeFrete; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class NFNotaInfoTransporteTest { @@ -35,7 +34,7 @@ public void devePermitirBalsaNulo() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); transporte.toString(); } @@ -45,7 +44,7 @@ public void devePermitirVagaoNulo() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); transporte.toString(); } @@ -55,7 +54,7 @@ public void devePermitirVolumesNulo() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); transporte.toString(); } @@ -66,7 +65,7 @@ public void devePermitirReboqueNulo() { transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); - transporte.setVolumes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoVolume())); + transporte.setVolumes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoVolume())); transporte.toString(); } @@ -75,9 +74,9 @@ public void devePermitirVeiculoNulo() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); - transporte.setVolumes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoVolume())); + transporte.setVolumes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoVolume())); transporte.toString(); } @@ -85,9 +84,9 @@ public void devePermitirVeiculoNulo() { public void devePermitirICMSTransporteNulo() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); - transporte.setVolumes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoVolume())); + transporte.setVolumes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoVolume())); transporte.toString(); } @@ -96,8 +95,8 @@ public void devePermitirTransportadorNulo() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); transporte.setModalidadeFrete(NFModalidadeFrete.SEM_FRETE); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); - transporte.setVolumes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoVolume())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setVolumes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoVolume())); transporte.toString(); } @@ -105,9 +104,9 @@ public void devePermitirTransportadorNulo() { public void naoDevePermitirModalidadeFreteNulo() { final NFNotaInfoTransporte transporte = new NFNotaInfoTransporte(); transporte.setIcmsTransporte(FabricaDeObjetosFake.getNFNotaInfoRetencaoICMSTransporte()); - transporte.setReboques(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoReboque())); + transporte.setReboques(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoReboque())); transporte.setTransportador(FabricaDeObjetosFake.getNFNotaInfoTransportador()); - transporte.setVolumes(Arrays.asList(FabricaDeObjetosFake.getNFNotaInfoVolume())); + transporte.setVolumes(Collections.singletonList(FabricaDeObjetosFake.getNFNotaInfoVolume())); transporte.toString(); } diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoVolumeTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoVolumeTest.java index 976588b78..7df2d647a 100755 --- a/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoVolumeTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/NFNotaInfoVolumeTest.java @@ -1,16 +1,15 @@ package com.fincatto.nfe310.classes.nota; +import com.fincatto.nfe310.FabricaDeObjetosFake; +import org.junit.Assert; +import org.junit.Test; + import java.math.BigDecimal; import java.math.BigInteger; import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; import java.util.List; -import org.junit.Assert; -import org.junit.Test; - -import com.fincatto.nfe310.FabricaDeObjetosFake; - public class NFNotaInfoVolumeTest { @Test @@ -82,7 +81,7 @@ public void devePermitirQuantidadeVolumesTransportadosNulo() { volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb"); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2"); - volume.setLacres(Arrays.asList(notaInfoLacre)); + volume.setLacres(Collections.singletonList(notaInfoLacre)); volume.setMarca("lc0w13Xw2PxsSD4u4q3N6Qix9ZuCFm0HXo6BxBmKnjVbh9Xwy3k9UwBNfuYo"); volume.setNumeracaoVolumesTransportados("mcBUtZwnI5DKj2YZNAcLP7W9h6j1xKmF5SX1BTKmsvyg0H5xSrfVw8HGn8eb"); volume.setPesoBruto(new BigDecimal("1.358")); @@ -96,7 +95,7 @@ public void devePermitirPesoLiquidoNulo() { volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb"); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2"); - volume.setLacres(Arrays.asList(notaInfoLacre)); + volume.setLacres(Collections.singletonList(notaInfoLacre)); volume.setMarca("lc0w13Xw2PxsSD4u4q3N6Qix9ZuCFm0HXo6BxBmKnjVbh9Xwy3k9UwBNfuYo"); volume.setNumeracaoVolumesTransportados("mcBUtZwnI5DKj2YZNAcLP7W9h6j1xKmF5SX1BTKmsvyg0H5xSrfVw8HGn8eb"); volume.setPesoBruto(new BigDecimal("1.358")); @@ -110,7 +109,7 @@ public void devePermitirPesoBrutoNulo() { volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb"); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2"); - volume.setLacres(Arrays.asList(notaInfoLacre)); + volume.setLacres(Collections.singletonList(notaInfoLacre)); volume.setMarca("lc0w13Xw2PxsSD4u4q3N6Qix9ZuCFm0HXo6BxBmKnjVbh9Xwy3k9UwBNfuYo"); volume.setNumeracaoVolumesTransportados("mcBUtZwnI5DKj2YZNAcLP7W9h6j1xKmF5SX1BTKmsvyg0H5xSrfVw8HGn8eb"); volume.setPesoLiquido(new BigDecimal("1")); @@ -124,7 +123,7 @@ public void devePermitirNumeracaoVolumesTransportadosNulo() { volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb"); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2"); - volume.setLacres(Arrays.asList(notaInfoLacre)); + volume.setLacres(Collections.singletonList(notaInfoLacre)); volume.setMarca("lc0w13Xw2PxsSD4u4q3N6Qix9ZuCFm0HXo6BxBmKnjVbh9Xwy3k9UwBNfuYo"); volume.setPesoBruto(new BigDecimal("1.358")); volume.setPesoLiquido(new BigDecimal("1")); @@ -138,7 +137,7 @@ public void devePermitirMarcaNulo() { volume.setEspecieVolumesTransportados("3Qf46HFs7FcWlhuQqLJ96vsrgJHu6B5ZXmmwMZ1RtvQVOV4Yp6M9VNqn5Ecb"); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2"); - volume.setLacres(Arrays.asList(notaInfoLacre)); + volume.setLacres(Collections.singletonList(notaInfoLacre)); volume.setNumeracaoVolumesTransportados("mcBUtZwnI5DKj2YZNAcLP7W9h6j1xKmF5SX1BTKmsvyg0H5xSrfVw8HGn8eb"); volume.setPesoBruto(new BigDecimal("1.358")); volume.setPesoLiquido(new BigDecimal("1")); @@ -151,7 +150,7 @@ public void devePermitirEspecieVolumesTransportadosNulo() { final NFNotaInfoVolume volume = new NFNotaInfoVolume(); final NFNotaInfoLacre notaInfoLacre = new NFNotaInfoLacre(); notaInfoLacre.setNumeroLacre("gvmjb9BB2cmwsLbzeR3Bsk8QbA7b1XEgXUhKeS9QZGiwhFnqDtEzS3377MP2"); - volume.setLacres(Arrays.asList(notaInfoLacre)); + volume.setLacres(Collections.singletonList(notaInfoLacre)); volume.setMarca("lc0w13Xw2PxsSD4u4q3N6Qix9ZuCFm0HXo6BxBmKnjVbh9Xwy3k9UwBNfuYo"); volume.setNumeracaoVolumesTransportados("mcBUtZwnI5DKj2YZNAcLP7W9h6j1xKmF5SX1BTKmsvyg0H5xSrfVw8HGn8eb"); volume.setPesoBruto(new BigDecimal("1.358")); diff --git a/src/test/java/com/fincatto/nfe310/classes/nota/assinatura/NFReferenceTest.java b/src/test/java/com/fincatto/nfe310/classes/nota/assinatura/NFReferenceTest.java index fe52d5933..cd8eec0de 100644 --- a/src/test/java/com/fincatto/nfe310/classes/nota/assinatura/NFReferenceTest.java +++ b/src/test/java/com/fincatto/nfe310/classes/nota/assinatura/NFReferenceTest.java @@ -1,11 +1,11 @@ package com.fincatto.nfe310.classes.nota.assinatura; -import java.util.ArrayList; -import java.util.List; - import org.junit.Assert; import org.junit.Test; +import java.util.ArrayList; +import java.util.List; + public class NFReferenceTest { @Test @@ -19,7 +19,7 @@ public void deveObterDigestValueComoFoiSetado() { @Test public void deveObterTransformComoFoiSetado() { final NFReference reference = new NFReference(); - final List transform = new ArrayList(); + final List transform = new ArrayList<>(); reference.setTransform(transform); Assert.assertEquals(transform, reference.getTransform()); } diff --git a/src/test/java/com/fincatto/nfe310/integracao/ValidacaoXML.java b/src/test/java/com/fincatto/nfe310/integracao/ValidacaoXML.java index d68f274f6..46996c7c9 100755 --- a/src/test/java/com/fincatto/nfe310/integracao/ValidacaoXML.java +++ b/src/test/java/com/fincatto/nfe310/integracao/ValidacaoXML.java @@ -1,29 +1,13 @@ package com.fincatto.nfe310.integracao; -import java.io.File; - -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - import com.fincatto.nfe310.FabricaDeObjetosFake; -import com.fincatto.nfe310.parsers.NotaParser; import com.fincatto.nfe310.validadores.xsd.XMLValidador; -import com.fincatto.util.TesteUtil; +import org.junit.Test; public class ValidacaoXML { - private static final String DIRETORIO_XML_NOTAS = "/tmp/notas"; @Test public void deveValidarXMLContraXSD() throws Throwable { XMLValidador.validaNota(FabricaDeObjetosFake.getNFNota1().toString()); } - - @Test - @Ignore - public void validaArquivos() throws Throwable { - for (final File notaXML : TesteUtil.getArquivosParaTestes(new File(ValidacaoXML.DIRETORIO_XML_NOTAS))) { - Assert.assertEquals(TesteUtil.filepathToString(notaXML.getAbsolutePath()), new NotaParser().notaParaObjeto(notaXML).toString()); - } - } } \ No newline at end of file diff --git a/src/test/java/com/fincatto/nfe310/transformers/NFLocalDateTransformerTest.java b/src/test/java/com/fincatto/nfe310/transformers/NFLocalDateTransformerTest.java index c1688b4a5..6f5025d31 100644 --- a/src/test/java/com/fincatto/nfe310/transformers/NFLocalDateTransformerTest.java +++ b/src/test/java/com/fincatto/nfe310/transformers/NFLocalDateTransformerTest.java @@ -14,6 +14,6 @@ public void deveTransformarDataStringEmLocalDate() throws Exception { @Test public void deveTransformarLocalDateEmString() throws Exception { - Assert.assertEquals("2015-10-04", new NFLocalDateTransformer().write(new LocalDate(2015, 10, 04))); + Assert.assertEquals("2015-10-04", new NFLocalDateTransformer().write(new LocalDate(2015, 10, 4))); } } \ No newline at end of file diff --git a/src/test/java/com/fincatto/nfe310/validadores/ListValidadorTest.java b/src/test/java/com/fincatto/nfe310/validadores/ListValidadorTest.java index 286159fc1..5a1e47325 100755 --- a/src/test/java/com/fincatto/nfe310/validadores/ListValidadorTest.java +++ b/src/test/java/com/fincatto/nfe310/validadores/ListValidadorTest.java @@ -1,13 +1,11 @@ package com.fincatto.nfe310.validadores; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import org.junit.Assert; import org.junit.Test; -import com.fincatto.nfe310.validadores.ListValidador; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; public class ListValidadorTest { @@ -49,7 +47,7 @@ public void deveValidarListaCom120Itens() { @Test public void deveValidarListaCom31ItensObrigatorio() { - ListValidador.tamanho31Obrigatorio(Arrays.asList(new Object[] { new Object() })); + ListValidador.tamanho31Obrigatorio(Collections.singletonList(new Object())); final List lista = new ArrayList<>(); for (int i = 0; i < 31; i++) { lista.add(new Object()); @@ -60,7 +58,7 @@ public void deveValidarListaCom31ItensObrigatorio() { @Test(expected = IllegalStateException.class) public void deveLancarExcecaoCasoEstejaForaDoIntervalo() { try { - ListValidador.tamanho31Obrigatorio(Arrays.asList(new Object[] {})); + ListValidador.tamanho31Obrigatorio(Collections.emptyList()); Assert.fail("Validacao nao funcionou"); } catch (final IllegalStateException e) { final List lista = new ArrayList<>(); diff --git a/src/test/java/com/fincatto/util/TesteUtil.java b/src/test/java/com/fincatto/util/TesteUtil.java deleted file mode 100755 index 279c00510..000000000 --- a/src/test/java/com/fincatto/util/TesteUtil.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.fincatto.util; - -import java.io.File; -import java.io.FilenameFilter; -import java.io.IOException; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.Set; -import java.util.TreeSet; - -public class TesteUtil { - - public static File[] getArquivosParaTestes(final File caminhoArquivos) throws Exception { - if (!caminhoArquivos.exists() || !caminhoArquivos.isDirectory()) { - return new File[] {}; - } - final Set arquivos = new TreeSet<>(); - for (final File arquivo : caminhoArquivos.listFiles(TesteUtil.getFilter())) { - if (arquivo.isFile() && !arquivo.getName().startsWith("._")) { - arquivos.add(arquivo); - } - } - return arquivos.toArray(new File[arquivos.size()]); - } - - public static String filepathToString(final String caminho) throws IOException { - final byte[] bytes = Files.readAllBytes(Paths.get(caminho)); - return new String(bytes, Charset.defaultCharset()); - } - - private static FilenameFilter getFilter() { - return new FilenameFilter() { - @Override - public boolean accept(final File dir, final String nome) { - return nome.matches(".*\\.(xml|XML)"); - } - }; - } -} \ No newline at end of file