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

wmixvideo / nfe / #9462

23 Jul 2026 08:39PM UTC coverage: 50.977% (-0.8%) from 51.794%
#9462

push

web-flow
Refatoração de chaves para suportar CNPJ alfanumérico (NT 2026.004) (#1181)

* Javadoc Warnings invalid input: '<' e '&' literais

* Javadoc Warnings invalid input: '<' e '&' literais

* Refatoração de chaves para suportar CNPJ alfanumérico (NT 2026.004)

* Normaliza char para maiusculo na chave

O cálculo do DV usa valores[i - 1] - '0'. Se a chave vier com letras minúsculas (o que é aceito por alguns validadores de CNPJ na base), o DV calculado muda (ex.: 'a' - '0' != 'A' - '0'), gerando falsos negativos/positivos. Normalize o caractere para maiúsculo antes de converter para o valor numérico.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Diego Fincatto <58352+fincatto@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

12 of 14 new or added lines in 9 files covered. (85.71%)

757 existing lines in 44 files now uncovered.

15132 of 29684 relevant lines covered (50.98%)

0.51 hits per line

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

59.38
/src/main/java/com/fincatto/documentofiscal/cte400/classes/CTAutorizador400.java
1
package com.fincatto.documentofiscal.cte400.classes;
2

3
import com.fincatto.documentofiscal.DFAmbiente;
4
import com.fincatto.documentofiscal.DFUnidadeFederativa;
5
import com.fincatto.documentofiscal.cte.CTTipoEmissao;
6
import com.fincatto.documentofiscal.cte400.parsers.CTChaveParser;
7

8
import java.util.Arrays;
9

10
public enum CTAutorizador400 {
1✔
11
    
12
    MT {
1✔
13
        @Override
14
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
15
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/ctews2/services/CTeRecepcaoSincV4" : "https://cte.sefaz.mt.gov.br/ctews2/services/CTeRecepcaoSincV4";
1✔
16
        }
17

18
        @Override
19
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
20
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/ctews/services/CTeRecepcaoOSV4" : "https://cte.sefaz.mt.gov.br/ctews/services/CTeRecepcaoOSV4";
1✔
21
        }
22

23
        @Override
24
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
UNCOV
25
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/cte-ws/services/CTeRecepcaoSimpV4" : "https://cte.sefaz.mt.gov.br/cte-ws/services/CTeRecepcaoSimpV4";
×
26
        }
27

28
        @Override
29
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
30
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/ctews2/services/CTeRecepcaoGTVeV4" : "https://cte.sefaz.mt.gov.br/ctews2/services/CTeRecepcaoGTVeV4";
1✔
31
        }
32
        
33
        @Override
34
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
35
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/ctews2/services/CTeConsultaV4" : "https://cte.sefaz.mt.gov.br/ctews2/services/CTeConsultaV4";
1✔
36
        }
37
        
38
        @Override
39
        public String getCteStatusServico(final DFAmbiente ambiente) {
40
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/ctews2/services/CTeStatusServicoV4" : "https://cte.sefaz.mt.gov.br/ctews2/services/CTeStatusServicoV4";
1✔
41
        }
42
        
43
        @Override
44
        public String getCteQrCode(DFAmbiente ambiente) {
UNCOV
45
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/cte/qrcode" : "https://www.sefaz.mt.gov.br/cte/qrcode";
×
46
        }
47
        
48
        @Override
49
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
50
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.sefaz.mt.gov.br/ctews2/services/CTeRecepcaoEventoV4" : "https://cte.sefaz.mt.gov.br/ctews2/services/CTeRecepcaoEventoV4";
1✔
51
        }
52
        
53
        @Override
54
        public DFUnidadeFederativa[] getUFs() {
UNCOV
55
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.MT};
×
56
        }
57
    },
58
    
59
    MS {
1✔
60
        @Override
61
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
62
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.ms.gov.br/ws/CTeRecepcaoSincV4" : "https://producao.cte.ms.gov.br/ws/CTeRecepcaoSincV4";
1✔
63
        }
64

65
        @Override
66
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
67
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.ms.gov.br/ws/CTeRecepcaoOSV4" : "https://producao.cte.ms.gov.br/ws/CTeRecepcaoOSV4";
1✔
68
        }
69

70
        @Override
71
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
UNCOV
72
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.ms.gov.br/ws/CTeRecepcaoSimpV4" : "https://producao.cte.ms.gov.br/ws/CTeRecepcaoSimpV4";
×
73
        }
74

75
        @Override
76
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
77
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.ms.gov.br/ws/CTeRecepcaoGTVeV4" : "https://producao.cte.ms.gov.br/ws/CTeRecepcaoGTVeV4";
1✔
78
        }
79
    
80
        @Override
81
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
82
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.ms.gov.br/ws/CTeConsultaV4" : "https://producao.cte.ms.gov.br/ws/CTeConsultaV4";
1✔
83
        }
84
    
85
        @Override
86
        public String getCteStatusServico(final DFAmbiente ambiente) {
87
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.ms.gov.br/ws/CTeStatusServicoV4" : "https://producao.cte.ms.gov.br/ws/CTeStatusServicoV4";
1✔
88
        }
89
    
90
        @Override
91
        public String getCteQrCode(DFAmbiente ambiente) {
92
            return "http://www.dfe.ms.gov.br/cte/qrcode";
×
93
        }
94
    
95
        @Override
96
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
97
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.ms.gov.br/ws/CTeRecepcaoEventoV4" : "https://producao.cte.ms.gov.br/ws/CTeRecepcaoEventoV4";
1✔
98
        }
99
    
100
        @Override
101
        public DFUnidadeFederativa[] getUFs() {
UNCOV
102
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.MS};
×
103
        }
104
    },
105
    
106
    MG {
1✔
107
        @Override
108
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
109
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://hcte.fazenda.mg.gov.br/cte/services/CTeRecepcaoSincV4" : "https://cte.fazenda.mg.gov.br/cte/services/CTeRecepcaoSincV4";
1✔
110
        }
111

112
        @Override
113
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
114
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://hcte.fazenda.mg.gov.br/cte/services/CTeRecepcaoOSV4" : "https://cte.fazenda.mg.gov.br/cte/services/CTeRecepcaoOSV4";
1✔
115
        }
116

117
        @Override
118
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
UNCOV
119
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://hcte.fazenda.mg.gov.br/cte/services/CTeRecepcaoSimpV4" : "https://cte.fazenda.mg.gov.br/cte/services/CTeRecepcaoSimpV4";
×
120
        }
121

122
        @Override
123
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
124
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://hcte.fazenda.mg.gov.br/cte/services/CTeRecepcaoGTVeV4" : "https://cte.fazenda.mg.gov.br/cte/services/CTeRecepcaoGTVeV4";
1✔
125
        }
126
    
127
        @Override
128
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
129
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://hcte.fazenda.mg.gov.br/cte/services/CTeConsultaV4" : "https://cte.fazenda.mg.gov.br/cte/services/CTeConsultaV4";
1✔
130
        }
131
    
132
        @Override
133
        public String getCteStatusServico(final DFAmbiente ambiente) {
134
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://hcte.fazenda.mg.gov.br/cte/services/CTeStatusServicoV4" : "https://cte.fazenda.mg.gov.br/cte/services/CTeStatusServicoV4";
1✔
135
        }
136
    
137
        @Override
138
        public String getCteQrCode(DFAmbiente ambiente) {
UNCOV
139
            return "https://cte.fazenda.mg.gov.br/portalcte/sistema/qrcode.xhtml";
×
140
        }
141
    
142
        @Override
143
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
144
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://hcte.fazenda.mg.gov.br/cte/services/CTeRecepcaoEventoV4" : "https://cte.fazenda.mg.gov.br/cte/services/CTeRecepcaoEventoV4";
1✔
145
        }
146
    
147
        @Override
148
        public DFUnidadeFederativa[] getUFs() {
UNCOV
149
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.MG};
×
150
        }
151
    },
152
    
153
    PR {
1✔
154
        @Override
155
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
156
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.fazenda.pr.gov.br/cte4/CTeRecepcaoSincV4" : "https://cte.fazenda.pr.gov.br/cte4/CTeRecepcaoSincV4";
1✔
157
        }
158

159
        @Override
160
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
161
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.fazenda.pr.gov.br/cte4/CTeRecepcaoOSV4" : "https://cte.fazenda.pr.gov.br/cte4/CTeRecepcaoOSV4";
1✔
162
        }
163

164
        @Override
165
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
166
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.fazenda.pr.gov.br/cte4/CTeRecepcaoSimpV4" : "https://cte.fazenda.pr.gov.br/cte4/CTeRecepcaoSimpV4";
×
167
        }
168

169
        @Override
170
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
171
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.fazenda.pr.gov.br/cte4/CTeRecepcaoGTVeV4" : "https://cte.fazenda.pr.gov.br/cte4/CTeRecepcaoGTVeV4";
1✔
172
        }
173
    
174
        @Override
175
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
176
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.fazenda.pr.gov.br/cte4/CTeConsultaV4" : "https://cte.fazenda.pr.gov.br/cte4/CTeConsultaV4";
1✔
177
        }
178
    
179
        @Override
180
        public String getCteStatusServico(final DFAmbiente ambiente) {
181
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.fazenda.pr.gov.br/cte4/CTeStatusServicoV4" : "https://cte.fazenda.pr.gov.br/cte4/CTeStatusServicoV4";
1✔
182
        }
183
    
184
        @Override
185
        public String getCteQrCode(DFAmbiente ambiente) {
UNCOV
186
            return "http://www.fazenda.pr.gov.br/cte/qrcode";
×
187
        }
188
    
189
        @Override
190
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
191
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.cte.fazenda.pr.gov.br/cte4/CTeRecepcaoEventoV4" : "https://cte.fazenda.pr.gov.br/cte4/CTeRecepcaoEventoV4";
1✔
192
        }
193
    
194
        @Override
195
        public DFUnidadeFederativa[] getUFs() {
UNCOV
196
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.PR};
×
197
        }
198
    },
199
    
200
    RS {
1✔
201
        @Override
202
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
203
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoSincV4/CTeRecepcaoSincV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoSincV4/CTeRecepcaoSincV4.asmx";
1✔
204
        }
205

206
        @Override
207
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
208
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoOSV4/CTeRecepcaoOSV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoOSV4/CTeRecepcaoOSV4.asmx";
1✔
209
        }
210

211
        @Override
212
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
UNCOV
213
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoSimpV4/CTeRecepcaoSimpV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoSimpV4/CTeRecepcaoSimpV4.asmx";
×
214
        }
215

216
        @Override
217
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
218
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoGTVeV4/CTeRecepcaoGTVeV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoGTVeV4/CTeRecepcaoGTVeV4.asmx";
1✔
219
        }
220

221
        @Override
222
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
223
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeConsultaV4/CTeConsultaV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeConsultaV4/CTeConsultaV4.asmx";
1✔
224
        }
225

226
        @Override
227
        public String getCteStatusServico(final DFAmbiente ambiente) {
228
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeStatusServicoV4/CTeStatusServicoV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeStatusServicoV4/CTeStatusServicoV4.asmx";
1✔
229
        }
230

231
        @Override
232
        public String getCteQrCode(DFAmbiente ambiente) {
UNCOV
233
            return "https://dfe-portal.svrs.rs.gov.br/cte/qrCode";
×
234
        }
235

236
        @Override
237
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
238
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoEventoV4/CTeRecepcaoEventoV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoEventoV4/CTeRecepcaoEventoV4.asmx";
1✔
239
        }
240
    
241
        @Override
242
        public DFUnidadeFederativa[] getUFs() {
UNCOV
243
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.RS};
×
244
        }
245
    },
246
    
247
    SP {
1✔
248
        @Override
249
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
250
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSincV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSincV4.asmx";
1✔
251
        }
252

253
        @Override
254
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
255
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoOSV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoOSV4.asmx";
1✔
256
        }
257

258
        @Override
259
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
260
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSimpV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSimpV4.asmx";
×
261
        }
262

263
        @Override
264
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
265
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoGTVeV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoGTVeV4.asmx";
1✔
266
        }
267
        
268
        @Override
269
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
270
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeConsultaV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeConsultaV4.asmx";
1✔
271
        }
272
        
273
        @Override
274
        public String getCteStatusServico(final DFAmbiente ambiente) {
275
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeStatusServicoV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeStatusServicoV4.asmx";
1✔
276
        }
277
        
278
        @Override
279
        public String getCteQrCode(DFAmbiente ambiente) {
UNCOV
280
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeConsulta/qrCode" : "https://nfe.fazenda.sp.gov.br/CTeConsulta/qrCode";
×
281
        }
282
        
283
        @Override
284
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
285
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoEventoV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoEventoV4.asmx";
1✔
286
        }
287
        
288
        @Override
289
        public DFUnidadeFederativa[] getUFs() {
UNCOV
290
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.SP};
×
291
        }
292
    },
293
    
294
    SVRS {
1✔
295
        @Override
296
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
297
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoSincV4/CTeRecepcaoSincV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoSincV4/CTeRecepcaoSincV4.asmx";
1✔
298
        }
299

300
        @Override
301
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
302
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoOSV4/CTeRecepcaoOSV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoOSV4/CTeRecepcaoOSV4.asmx";
1✔
303
        }
304

305
        @Override
306
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
UNCOV
307
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoSimpV4/CTeRecepcaoSimpV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoSimpV4/CTeRecepcaoSimpV4.asmx";
×
308
        }
309

310
        @Override
311
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
312
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoGTVeV4/CTeRecepcaoGTVeV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoGTVeV4/CTeRecepcaoGTVeV4.asmx";
1✔
313
        }
314

315
        @Override
316
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
317
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeConsultaV4/CTeConsultaV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeConsultaV4/CTeConsultaV4.asmx";
1✔
318
        }
319

320
        @Override
321
        public String getCteStatusServico(final DFAmbiente ambiente) {
322
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeStatusServicoV4/CTeStatusServicoV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeStatusServicoV4/CTeStatusServicoV4.asmx";
1✔
323
        }
324

325
        @Override
326
        public String getCteQrCode(DFAmbiente ambiente) {
UNCOV
327
            return "https://dfe-portal.svrs.rs.gov.br/cte/qrCode";
×
328
        }
329

330
        @Override
331
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
332
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://cte-homologacao.svrs.rs.gov.br/ws/CTeRecepcaoEventoV4/CTeRecepcaoEventoV4.asmx" : "https://cte.svrs.rs.gov.br/ws/CTeRecepcaoEventoV4/CTeRecepcaoEventoV4.asmx";
1✔
333
        }
334
        
335
        @Override
336
        public DFUnidadeFederativa[] getUFs() {
UNCOV
337
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.AC, DFUnidadeFederativa.AL, DFUnidadeFederativa.AM, DFUnidadeFederativa.BA, DFUnidadeFederativa.CE, DFUnidadeFederativa.DF, DFUnidadeFederativa.ES, DFUnidadeFederativa.GO, DFUnidadeFederativa.MA, DFUnidadeFederativa.PA, DFUnidadeFederativa.PB, DFUnidadeFederativa.PI, DFUnidadeFederativa.RJ, DFUnidadeFederativa.RN, DFUnidadeFederativa.RO, DFUnidadeFederativa.SC, DFUnidadeFederativa.SE, DFUnidadeFederativa.TO};
×
338
        }
339
    },
340
    
341
    SVSP {
1✔
342
        @Override
343
        public String getCteRecepcaoSinc(final DFAmbiente ambiente) {
344
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSincV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSincV4.asmx";
1✔
345
        }
346

347
        @Override
348
        public String getCteRecepcaoOS(DFAmbiente ambiente) {
349
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoOSV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoOSV4.asmx";
1✔
350
        }
351

352
        @Override
353
        public String getCteRecepcaoSimp(DFAmbiente ambiente) {
UNCOV
354
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSimpV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoSimpV4.asmx";
×
355
        }
356

357
        @Override
358
        public String getCteRecepcaoGTVe(DFAmbiente ambiente) {
359
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoGTVeV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoGTVeV4.asmx";
1✔
360
        }
361

362
        @Override
363
        public String getCteConsultaProtocolo(final DFAmbiente ambiente) {
364
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeConsultaV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeConsultaV4.asmx";
1✔
365
        }
366

367
        @Override
368
        public String getCteStatusServico(final DFAmbiente ambiente) {
369
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeStatusServicoV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeStatusServicoV4.asmx";
1✔
370
        }
371

372
        @Override
373
        public String getCteQrCode(DFAmbiente ambiente) {
374
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeConsulta/qrCode" : "https://nfe.fazenda.sp.gov.br/CTeConsulta/qrCode";
×
375
        }
376

377
        @Override
378
        public String getRecepcaoEvento(final DFAmbiente ambiente) {
379
            return DFAmbiente.HOMOLOGACAO.equals(ambiente) ? "https://homologacao.nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoEventoV4.asmx" : "https://nfe.fazenda.sp.gov.br/CTeWS/WS/CTeRecepcaoEventoV4.asmx";
1✔
380
        }
381
    
382
        @Override
383
        public DFUnidadeFederativa[] getUFs() {
UNCOV
384
            return new DFUnidadeFederativa[]{DFUnidadeFederativa.AP, DFUnidadeFederativa.PE, DFUnidadeFederativa.RR};
×
385
        }
386
    };
387

388
    public abstract String getCteRecepcaoSinc(final DFAmbiente ambiente);
389

390
    public abstract String getCteRecepcaoOS(final DFAmbiente ambiente);
391

392
    public abstract String getCteRecepcaoSimp(final DFAmbiente ambiente);
393

394
    public abstract String getCteRecepcaoGTVe(final DFAmbiente ambiente);
395
    
396
    public abstract String getCteConsultaProtocolo(final DFAmbiente ambiente);
397
    
398
    public abstract String getCteStatusServico(final DFAmbiente ambiente);
399
    
400
    public abstract String getCteQrCode(final DFAmbiente ambiente);
401
    
402
    public abstract String getRecepcaoEvento(final DFAmbiente ambiente);
403
    
404
    public abstract DFUnidadeFederativa[] getUFs();
405
    
406
    public static CTAutorizador400 valueOfCodigoUF(final DFUnidadeFederativa uf) {
UNCOV
407
        for (final CTAutorizador400 autorizador : CTAutorizador400.values()) {
×
UNCOV
408
            if (Arrays.asList(autorizador.getUFs()).contains(uf)) {
×
UNCOV
409
                return autorizador;
×
410
            }
411
        }
UNCOV
412
        throw new IllegalStateException(String.format("Não existe autorizador para a UF %s", uf.getCodigo()));
×
413
    }
414
    
415
    public static CTAutorizador400 valueOfChaveAcesso(final String chaveAcesso) {
UNCOV
416
        final CTChaveParser chaveParser = new CTChaveParser(chaveAcesso);
×
UNCOV
417
        if (chaveParser.isEmitidaContingenciaSCVRS()) {
×
UNCOV
418
            return CTAutorizador400.SVRS;
×
UNCOV
419
        } else if (chaveParser.isEmitidaContingenciaSCVSP()) {
×
UNCOV
420
            return CTAutorizador400.SVSP;
×
421
        } else {
UNCOV
422
            return CTAutorizador400.valueOfCodigoUF(chaveParser.getNFUnidadeFederativa());
×
423
        }
424
    }
425
    
426
    public static CTAutorizador400 valueOfTipoEmissao(final CTTipoEmissao tpEmissao, final DFUnidadeFederativa uf) {
UNCOV
427
        switch (tpEmissao) {
×
428
            case EMISSAO_NORMAL:
UNCOV
429
                return CTAutorizador400.valueOfCodigoUF(uf);
×
430
            case CONTINGENCIA_SVCSP:
UNCOV
431
                return CTAutorizador400.SVSP;
×
432
            case CONTINGENCIA_SVCRS:
UNCOV
433
                return CTAutorizador400.SVRS;
×
434
            default:
UNCOV
435
                throw new IllegalArgumentException("Não ha implementacão para o tipo de emissão: " + tpEmissao.getDescricao());
×
436
        }
437
    }
438
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc