77import mx .com .sw .services .stamp .responses .StampResponseV3 ;
88import mx .com .sw .services .stamp .responses .StampResponseV4 ;
99
10+ import java .util .Arrays ;
1011import java .util .Collections ;
12+ import java .util .List ;
1113import java .util .UUID ;
1214import java .util .stream .Collectors ;
1315
@@ -39,7 +41,7 @@ public void testStampV1() {
3941 try {
4042 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
4143 String xml = settings .getCFDI (true );
42- StampResponseV1 response = stamp .timbrarV1 (xml , settings .getEmail (), null ,false , false );
44+ StampResponseV1 response = stamp .timbrarV1 (xml , settings .getCorreo (), null ,false , false );
4345 Assertions .assertNotNull (response );
4446 Assertions .assertNotNull (response .getData ());
4547 Assertions .assertNotNull (response .getStatus ());
@@ -58,7 +60,8 @@ public void testV4StampV1_errorEmail() {
5860 try {
5961 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
6062 String xml = settings .getCFDI (true );
61- StampResponseV1 response = stamp .timbrarV1 (xml , "correotest.com.mx" , null ,false , false );
63+ List <String > email = Arrays .asList ("invalid email" );
64+ StampResponseV1 response = stamp .timbrarV1 (xml , email , null ,false , false );
6265 String messageExpect = "El listado de correos no contiene un formato válido o alguno de los correos es inválido." ;
6366 Assertions .assertNotNull (response );
6467 Assertions .assertTrue ("error" .equalsIgnoreCase (response .getStatus ()));
@@ -76,8 +79,7 @@ public void testV4StampV1_maxEmail() {
7679 try {
7780 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
7881 String xml = settings .getCFDI (true );
79- String emails = "correo@test.com.mx, correo@test2.com.mx, correo@test3.com.mx, correo@test4.com.mx, correo@test5.com.mx, correo@test6.com.mx" ;
80- StampResponseV1 response = stamp .timbrarV1 (xml , emails , null ,false , false );
82+ StampResponseV1 response = stamp .timbrarV1 (xml , settings .getCorreos (), null ,false , false );
8183 String messageExpect = "El listado de correos está vacío o contiene más de 5 correos." ;
8284 Assertions .assertNotNull (response );
8385 Assertions .assertTrue ("error" .equalsIgnoreCase (response .getStatus ()));
@@ -174,7 +176,7 @@ public void testStampV2() {
174176 try {
175177 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
176178 String xml = settings .getCFDI (true );
177- StampResponseV2 response = stamp .timbrarV2 (xml , settings .getEmail (), null , false , false );
179+ StampResponseV2 response = stamp .timbrarV2 (xml , settings .getCorreo (), null , false , false );
178180 Assertions .assertNotNull (response );
179181 Assertions .assertNotNull (response .getData ());
180182 Assertions .assertNotNull (response .getStatus ());
@@ -234,7 +236,7 @@ public void testStampV3() {
234236 try {
235237 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
236238 String xml = settings .getCFDI (true );
237- StampResponseV3 response = stamp .timbrarV3 (xml , settings .getEmail (),null , false , false );
239+ StampResponseV3 response = stamp .timbrarV3 (xml , settings .getCorreo (),null , false , false );
238240 Assertions .assertNotNull (response );
239241 Assertions .assertNotNull (response .getData ());
240242 Assertions .assertNotNull (response .getStatus ());
@@ -273,7 +275,7 @@ public void testStampV4() {
273275 try {
274276 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
275277 String xml = settings .getCFDI (true );
276- StampResponseV4 response = stamp .timbrarV4 (xml , settings .getEmail (),null , false , false );
278+ StampResponseV4 response = stamp .timbrarV4 (xml , settings .getCorreo (),null , false , false );
277279 Assertions .assertNotNull (response );
278280 Assertions .assertNotNull (response .getData ());
279281 Assertions .assertNotNull (response .getStatus ());
@@ -293,7 +295,7 @@ public void testStampV4_customId() {
293295 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
294296 String xml = settings .getCFDI (true );
295297 String customId = UUID .randomUUID ().toString ();
296- StampResponseV4 response = stamp .timbrarV4 (xml , settings .getEmail (),customId , false , false );
298+ StampResponseV4 response = stamp .timbrarV4 (xml , settings .getCorreo (),customId , false , false );
297299 Assertions .assertNotNull (response );
298300 Assertions .assertNotNull (response .getData ());
299301 Assertions .assertNotNull (response .getStatus ());
@@ -312,7 +314,7 @@ public void testStampV1B64() {
312314 try {
313315 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
314316 String xml = settings .getCFDIB64 (true );
315- StampResponseV1 response = stamp .timbrarV1 (xml , settings .getEmail (), null ,false , true );
317+ StampResponseV1 response = stamp .timbrarV1 (xml , settings .getCorreo (), null ,false , true );
316318 Assertions .assertNotNull (response );
317319 Assertions .assertNotNull (response .getData ());
318320 Assertions .assertNotNull (response .getStatus ());
@@ -331,7 +333,7 @@ public void testStampV2B64() {
331333 try {
332334 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
333335 String xml = settings .getCFDIB64 (true );
334- StampResponseV2 response = stamp .timbrarV2 (xml , settings .getEmail (),null , false , true );
336+ StampResponseV2 response = stamp .timbrarV2 (xml , settings .getCorreo (),null , false , true );
335337 Assertions .assertNotNull (response );
336338 Assertions .assertNotNull (response .getData ());
337339 Assertions .assertNotNull (response .getStatus ());
@@ -350,7 +352,7 @@ public void testStampV3B64() {
350352 try {
351353 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
352354 String xml = settings .getCFDIB64 (true );
353- StampResponseV3 response = stamp .timbrarV3 (xml , settings .getEmail (),null , false , true );
355+ StampResponseV3 response = stamp .timbrarV3 (xml , settings .getCorreo (),null , false , true );
354356 Assertions .assertNotNull (response );
355357 Assertions .assertNotNull (response .getData ());
356358 Assertions .assertNotNull (response .getStatus ());
@@ -369,7 +371,7 @@ public void testStampV4B64() {
369371 try {
370372 StampV4 stamp = new StampV4 (settings .getUrlSW (), settings .getUserSW (), settings .getPasswordSW (), null , 0 );
371373 String xml = settings .getCFDIB64 (true );
372- StampResponseV4 response = stamp .timbrarV4 (xml , settings .getEmail (),null , false , true );
374+ StampResponseV4 response = stamp .timbrarV4 (xml , settings .getCorreo (),null , false , true );
373375 Assertions .assertNotNull (response );
374376 Assertions .assertNotNull (response .getData ());
375377 Assertions .assertNotNull (response .getStatus ());
0 commit comments