• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wmixvideo / nfe / #7947

10 Mar 2026 08:42PM UTC coverage: 50.346% (+23.4%) from 26.996%
#7947

push

web-flow
Mantendo compatibilidade com java 1.8 e tratamento erro Connection or outbound has closed (#1151)

* Removendo ; duplicado e warn serial version

* Mantendo compatibilidade com java 1.8

* Removendo ; duplicado e warn serial version

* Mantendo compatibilidade com java 1.8

* Remove unused import statement

Removed unused import for LocalDate.

* Remove deprecated CST_210 and CST_510 entries

* Remove obsolete CST code assertions from tests

Removed assertions for CST codes 210001, 210002, and 210003 from tests.

* Enhance fromOM method to handle operation response

Resolvendo expection org.apache.axis2.databinding.ADBException: Unexpected subelement {http://www.portalfiscal.inf.br/nfe/wsdl/NFeAutorizacao4}nfeResultMsg

* Enhance fromOM method for better XML parsing

Resolvendo exception org.apache.axis2.databinding.ADBException: Unexpected subelement

Refactor fromOM method to handle child elements for NfeDadosMsg and NfeResultMsg parsing.

* Refactor fromOM method to handle child elements

Resolvendo exception org.apache.axis2.databinding.ADBException: Unexpected subelement

* Mantendo compatibilidade versão java 1.8

* Removendo CST obsoletos

* Removendo tratamento erro ADBException

* Removendo tratamento erro ADBException

* Removendo tratamento erro ADBException

* Desabilitando o uso de transferências chunked nas requisições HTTP
(NFeAutorizacao4Stub ja tem) Resolvendo erro intermitente manifesto
destinatário HTTPSenderImpl:215 - Unable to sendViaPost to
url[https://www.nfe.fazenda.gov.br/NFeRecepcaoEvento4/NFeRecepcaoEvento4.asmx]
org.apache.axis2.AxisFault: Connection or outbound has closed

---------

Co-authored-by: tecnosofti <tecnosofti@amdryzen>
Co-authored-by: Diego Fincatto <58352+fincatto@users.noreply.github.com>

1 of 1 new or added line in 1 file covered. (100.0%)

2969 existing lines in 403 files now uncovered.

14775 of 29347 relevant lines covered (50.35%)

0.5 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/main/java/com/fincatto/documentofiscal/nfe310/classes/nota/NFNotaInfoCana.java
1
package com.fincatto.documentofiscal.nfe310.classes.nota;
2

3
import com.fincatto.documentofiscal.DFBase;
4
import com.fincatto.documentofiscal.validadores.DFBigDecimalValidador;
5
import com.fincatto.documentofiscal.validadores.DFListValidador;
6
import com.fincatto.documentofiscal.validadores.DFStringValidador;
7
import org.simpleframework.xml.Element;
8
import org.simpleframework.xml.ElementList;
9

10
import java.math.BigDecimal;
11
import java.util.List;
12
import java.util.regex.Matcher;
13
import java.util.regex.Pattern;
14

15
public class NFNotaInfoCana extends DFBase {
1✔
16
    private static final long serialVersionUID = 5219843108064204554L;
17
    
18
    @Element(name = "safra")
19
    private String safra;
20
    
21
    @Element(name = "ref")
22
    private String referencia;
23
    
24
    @ElementList(entry = "forDia", inline = true)
25
    private List<NFNotaInfoCanaFornecimentoDiario> fornecimentosDiario;
26

27
    @ElementList(entry = "deduc", inline = true, required = false)
28
    private List<NFNotaInfoCanaDeducao> deducoes;
29
    
30
    @Element(name = "qTotMes")
31
    private String quantidadeTotalMes;
32
    @Element(name = "qTotAnt")
33
    private String quantidadeTotalAnterior;
34
    @Element(name = "qTotGer")
35
    private String quantidadeTotalGeral;
36
    @Element(name = "vFor")
37
    private String valorFornecimento;
38
    @Element(name = "vTotDed")
39
    private String valorTotalDeducao;
40
    @Element(name = "vLiqFor")
41
    private String valorLiquidoFornecimento;
42

43
    public void setSafra(final String safra) {
44
        if (safra.length() != 4 && safra.length() != 9) {
1✔
45
            throw new IllegalStateException("Tamanho invalido");
1✔
46
        }
47

48
        final Pattern pattern = safra.length() == 4 ? Pattern.compile("[0-9]{4}") : Pattern.compile("[0-9]{4}/[0-9]{4}");
1✔
49
        final Matcher matcher = pattern.matcher(safra);
1✔
50
        if (!matcher.find()) {
1✔
51
            throw new IllegalStateException("Padrao invalido");
1✔
52
        }
53

54
        this.safra = safra;
1✔
55
    }
1✔
56

57
    public void setReferencia(final String referencia) {
58
        DFStringValidador.mmaaaa(referencia);
1✔
59
        this.referencia = referencia;
1✔
60
    }
1✔
61

62
    public void setFornecimentosDiario(final List<NFNotaInfoCanaFornecimentoDiario> fornecimentosDiario) {
63
        DFListValidador.tamanho31Obrigatorio(fornecimentosDiario, "Fornecimento Diario");
1✔
64
        this.fornecimentosDiario = fornecimentosDiario;
1✔
65
    }
1✔
66

67
    public void setDeducoes(final List<NFNotaInfoCanaDeducao> deducoes) {
68
        DFListValidador.tamanho10(deducoes, "Deducoes");
1✔
69
        this.deducoes = deducoes;
1✔
70
    }
1✔
71

72
    public void setQuantidadeTotalMes(final BigDecimal quantidadeTotalMes) {
73
        this.quantidadeTotalMes = DFBigDecimalValidador.tamanho21ComAte10CasasDecimais(quantidadeTotalMes, "Quantidade Total Mes");
1✔
74
    }
1✔
75

76
    public void setQuantidadeTotalAnterior(final BigDecimal quantidadeTotalAnterior) {
77
        this.quantidadeTotalAnterior = DFBigDecimalValidador.tamanho21ComAte10CasasDecimais(quantidadeTotalAnterior, "Quantidade Total Anterior");
1✔
78
    }
1✔
79

80
    public void setQuantidadeTotalGeral(final BigDecimal quantidadeTotalGeral) {
81
        this.quantidadeTotalGeral = DFBigDecimalValidador.tamanho21ComAte10CasasDecimais(quantidadeTotalGeral, "Quantidade Total Geral");
1✔
82
    }
1✔
83

84
    public void setValorFornecimento(final BigDecimal valorFornecimento) {
85
        this.valorFornecimento = DFBigDecimalValidador.tamanho15Com2CasasDecimais(valorFornecimento, "Valor Fornecimento");
1✔
86
    }
1✔
87

88
    public void setValorTotalDeducao(final BigDecimal valorTotalDeducao) {
89
        this.valorTotalDeducao = DFBigDecimalValidador.tamanho15Com2CasasDecimais(valorTotalDeducao, "Valor Total Deducao");
1✔
90
    }
1✔
91

92
    public void setValorLiquidoFornecimento(final BigDecimal valorLiquidoFornecimento) {
93
        this.valorLiquidoFornecimento = DFBigDecimalValidador.tamanho15Com2CasasDecimais(valorLiquidoFornecimento, "Valor Liquido Fornecimento");
1✔
94
    }
1✔
95

96
    public String getSafra() {
UNCOV
97
        return this.safra;
×
98
    }
99

100
    public String getReferencia() {
UNCOV
101
        return this.referencia;
×
102
    }
103

104
    public List<NFNotaInfoCanaFornecimentoDiario> getFornecimentosDiario() {
UNCOV
105
        return this.fornecimentosDiario;
×
106
    }
107

108
    public List<NFNotaInfoCanaDeducao> getDeducoes() {
UNCOV
109
        return this.deducoes;
×
110
    }
111

112
    public String getQuantidadeTotalMes() {
UNCOV
113
        return this.quantidadeTotalMes;
×
114
    }
115

116
    public String getQuantidadeTotalAnterior() {
UNCOV
117
        return this.quantidadeTotalAnterior;
×
118
    }
119

120
    public String getQuantidadeTotalGeral() {
UNCOV
121
        return this.quantidadeTotalGeral;
×
122
    }
123

124
    public String getValorFornecimento() {
UNCOV
125
        return this.valorFornecimento;
×
126
    }
127

128
    public String getValorTotalDeducao() {
UNCOV
129
        return this.valorTotalDeducao;
×
130
    }
131

132
    public String getValorLiquidoFornecimento() {
UNCOV
133
        return this.valorLiquidoFornecimento;
×
134
    }
135
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc