Commit 12a8db714bdf5db177741a8d3a0f0e44b3bbc2ad

Authored by Cleverson Sacramento
1 parent 54d0eefd
Exists in master

FWK-185: Falha nos testes insertFailed() updateFailed() do arquétipo

demoiselle-html-rest 

Task-Url: https://demoiselle.atlassian.net/browse/FWK-185
archetype/html-rest/src/main/resources/archetype-resources/src/test/java/rest/BookmarkRESTTest.java
@@ -4,7 +4,6 @@ import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST; @@ -4,7 +4,6 @@ import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
4 import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND; 4 import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
5 import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT; 5 import static javax.servlet.http.HttpServletResponse.SC_NO_CONTENT;
6 import static javax.servlet.http.HttpServletResponse.SC_OK; 6 import static javax.servlet.http.HttpServletResponse.SC_OK;
7 -import static javax.servlet.http.HttpServletResponse.SC_PRECONDITION_FAILED;  
8 import static javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED; 7 import static javax.servlet.http.HttpServletResponse.SC_UNAUTHORIZED;
9 import static org.junit.Assert.assertEquals; 8 import static org.junit.Assert.assertEquals;
10 import static org.junit.Assert.assertNotNull; 9 import static org.junit.Assert.assertNotNull;
@@ -190,7 +189,7 @@ public class BookmarkRESTTest { @@ -190,7 +189,7 @@ public class BookmarkRESTTest {
190 request.addHeader("Authorization", BASIC_CREDENTIALS); 189 request.addHeader("Authorization", BASIC_CREDENTIALS);
191 response = client.execute(request); 190 response = client.execute(request);
192 response.close(); 191 response.close();
193 - assertEquals(SC_PRECONDITION_FAILED, response.getStatusLine().getStatusCode()); 192 + assertEquals(422, response.getStatusLine().getStatusCode());
194 violations = mapper.readValue(response.getEntity().getContent(), 193 violations = mapper.readValue(response.getEntity().getContent(),
195 new TypeReference<Set<UnprocessableEntityException.Violation>>() { 194 new TypeReference<Set<UnprocessableEntityException.Violation>>() {
196 }); 195 });
@@ -208,7 +207,7 @@ public class BookmarkRESTTest { @@ -208,7 +207,7 @@ public class BookmarkRESTTest {
208 request.addHeader("Authorization", BASIC_CREDENTIALS); 207 request.addHeader("Authorization", BASIC_CREDENTIALS);
209 response = client.execute(request); 208 response = client.execute(request);
210 response.close(); 209 response.close();
211 - assertEquals(SC_PRECONDITION_FAILED, response.getStatusLine().getStatusCode()); 210 + assertEquals(422, response.getStatusLine().getStatusCode());
212 violations = mapper.readValue(response.getEntity().getContent(), 211 violations = mapper.readValue(response.getEntity().getContent(),
213 new TypeReference<Set<UnprocessableEntityException.Violation>>() { 212 new TypeReference<Set<UnprocessableEntityException.Violation>>() {
214 }); 213 });
@@ -287,7 +286,7 @@ public class BookmarkRESTTest { @@ -287,7 +286,7 @@ public class BookmarkRESTTest {
287 request.addHeader("Authorization", BASIC_CREDENTIALS); 286 request.addHeader("Authorization", BASIC_CREDENTIALS);
288 response = client.execute(request); 287 response = client.execute(request);
289 response.close(); 288 response.close();
290 - assertEquals(SC_PRECONDITION_FAILED, response.getStatusLine().getStatusCode()); 289 + assertEquals(422, response.getStatusLine().getStatusCode());
291 violations = mapper.readValue(response.getEntity().getContent(), 290 violations = mapper.readValue(response.getEntity().getContent(),
292 new TypeReference<Set<UnprocessableEntityException.Violation>>() { 291 new TypeReference<Set<UnprocessableEntityException.Violation>>() {
293 }); 292 });
@@ -305,7 +304,7 @@ public class BookmarkRESTTest { @@ -305,7 +304,7 @@ public class BookmarkRESTTest {
305 request.addHeader("Authorization", BASIC_CREDENTIALS); 304 request.addHeader("Authorization", BASIC_CREDENTIALS);
306 response = client.execute(request); 305 response = client.execute(request);
307 response.close(); 306 response.close();
308 - assertEquals(SC_PRECONDITION_FAILED, response.getStatusLine().getStatusCode()); 307 + assertEquals(422, response.getStatusLine().getStatusCode());
309 violations = mapper.readValue(response.getEntity().getContent(), 308 violations = mapper.readValue(response.getEntity().getContent(),
310 new TypeReference<Set<UnprocessableEntityException.Violation>>() { 309 new TypeReference<Set<UnprocessableEntityException.Violation>>() {
311 }); 310 });