#286 add hystrix demo back, 最后一轮代码清理。

This commit is contained in:
Calvin
2013-10-18 00:19:33 +08:00
parent c415034fc6
commit cdaebd63a2
10 changed files with 92 additions and 72 deletions
@@ -11,7 +11,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.springframework.http.HttpStatus;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.client.RestTemplate;
import org.springside.examples.quickstart.data.TaskData;
import org.springside.examples.quickstart.entity.Task;
@@ -92,7 +92,7 @@ public class TaskRestFT extends BaseFunctionalTestCase {
try {
restTemplate.getForObject(taskUri, Task.class);
fail("Get should fail while feth a deleted task");
} catch (HttpClientErrorException e) {
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
}
}
@@ -105,7 +105,7 @@ public class TaskRestFT extends BaseFunctionalTestCase {
try {
restTemplate.postForLocation(resoureUrl, titleBlankTask);
fail("Create should fail while title is blank");
} catch (HttpClientErrorException e) {
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.BAD_REQUEST, e.getStatusCode());
Map messages = jsonMapper.fromJson(e.getResponseBodyAsString(), Map.class);
assertEquals(1, messages.size());
@@ -117,7 +117,7 @@ public class TaskRestFT extends BaseFunctionalTestCase {
try {
restTemplate.put(resoureUrl + "/1", titleBlankTask);
fail("Update should fail while title is blank");
} catch (HttpClientErrorException e) {
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.BAD_REQUEST, e.getStatusCode());
Map messages = jsonMapper.fromJson(e.getResponseBodyAsString(), Map.class);
assertEquals(1, messages.size());