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

wmixvideo / nfe / #7141

09 Aug 2016 11:45AM UTC coverage: 78.549% (+1.9%) from 76.628%
#7141

push

travis-ci

jefperito
Corrigido erro de javadoc

Erro corrigido: Exit code: 1 -
/home/travis/build/wmixvideo/nfe/src/main/java/com/fincatto/nfe310/class
es/NFAutorizador31.java:93: error: bad use of '>'

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

538 existing lines in 82 files now uncovered.

4764 of 6065 relevant lines covered (78.55%)

50.43 hits per line

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

95.0
/src/main/java/com/fincatto/nfe310/parsers/NotaFiscalChaveParser.java
1
package com.fincatto.nfe310.parsers;
2

3
import com.fincatto.nfe310.classes.NFModelo;
4
import com.fincatto.nfe310.classes.NFTipoEmissao;
5
import com.fincatto.nfe310.classes.NFUnidadeFederativa;
6
import org.apache.commons.lang3.StringUtils;
7
import org.joda.time.LocalDate;
8

9
public class NotaFiscalChaveParser {
10

11
    private final String chave;
12

13
    public NotaFiscalChaveParser(final String chave) {
19✔
14
        this.chave = StringUtils.stripToEmpty(chave).replaceAll("\\D", "");
19✔
15
        if (this.chave.length() != 44) {
19✔
16
            throw new IllegalArgumentException(String.format("A chave deve ter exatos 44 caracteres numericos: %s", chave));
5✔
17
        }
18
    }
14✔
19

20
    public NFUnidadeFederativa getNFUnidadeFederativa() {
21
        return NFUnidadeFederativa.valueOfCodigo(this.chave.substring(0, 2));
2✔
22
    }
23

24
    public LocalDate getDataEmissao() {
25
        return new LocalDate(this.getDataEmissaoAno(), this.getDataEmissaoMes(), 1);
1✔
26
    }
27

28
    private int getDataEmissaoMes() {
29
        return Integer.parseInt(this.chave.substring(4, 6));
1✔
30
    }
31

32
    private int getDataEmissaoAno() {
33
        return 2000 + Integer.parseInt(this.chave.substring(2, 4));
1✔
34
    }
35

36
    public String getCnpjEmitente() {
37
        return this.chave.substring(6, 20);
1✔
38
    }
39

40
    public NFModelo getModelo() {
UNCOV
41
        return NFModelo.valueOfCodigo(this.chave.substring(20, 22));
×
42
    }
43

44
    public String getSerie() {
45
        return this.chave.substring(22, 25);
3✔
46
    }
47

48
    public String getNumero() {
49
        return this.chave.substring(25, 34);
1✔
50
    }
51

52
    public NFTipoEmissao getFormaEmissao() {
53
        return NFTipoEmissao.valueOfCodigo(this.chave.substring(34, 35));
1✔
54
    }
55

56
    public String getCodigoNumerico() {
57
        return this.chave.substring(35, 43);
1✔
58
    }
59

60
    public String getDV() {
61
        return this.chave.substring(43, 44);
1✔
62
    }
63

64
    public boolean isEmitidaContingenciaSCAN() {
65
        return this.getSerie().matches("9[0-9]{2}");
2✔
66
    }
67

68
    public boolean isEmitidaContingenciaSCVAN() {
69
        return this.chave.matches("\\d{34}6\\d{9}");
2✔
70
    }
71

72
    public boolean isEmitidaContingenciaSCVRS() {
73
        return this.chave.matches("\\d{34}7\\d{9}");
3✔
74
    }
75

76
    public String getFormatado() {
77
        return this.chave.replaceFirst("(\\d{4})(\\d{4})(\\d{4})(\\d{4})(\\d{4})(\\d{4})(\\d{4})(\\d{4})(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11");
1✔
78
    }
79
}
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