You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/05/08 08:05:07 UTC
[incubator-servicecomb-java-chassis] 04/05: SCB-504 fix pr comment
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
commit bcaec8d9306b028c9bd1650fa92cca650e261fb0
Author: zhengyangyong <ya...@huawei.com>
AuthorDate: Thu May 3 11:21:29 2018 +0800
SCB-504 fix pr comment
Signed-off-by: zhengyangyong <ya...@huawei.com>
---
.../cloud/zuul/tracing/SpringCloudZuulTracingTest.java | 11 ++++-------
.../demo/springmvc/tests/SpringMvcIntegrationTestBase.java | 14 ++++++++------
java-chassis-dependencies/pom.xml | 6 ++++++
parent/pom.xml | 1 -
4 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/integration-tests/spring-zuul-tracing-tests/src/test/java/org/apache/servicecomb/spring/cloud/zuul/tracing/SpringCloudZuulTracingTest.java b/integration-tests/spring-zuul-tracing-tests/src/test/java/org/apache/servicecomb/spring/cloud/zuul/tracing/SpringCloudZuulTracingTest.java
index 60d8966..35a82b1 100644
--- a/integration-tests/spring-zuul-tracing-tests/src/test/java/org/apache/servicecomb/spring/cloud/zuul/tracing/SpringCloudZuulTracingTest.java
+++ b/integration-tests/spring-zuul-tracing-tests/src/test/java/org/apache/servicecomb/spring/cloud/zuul/tracing/SpringCloudZuulTracingTest.java
@@ -81,13 +81,10 @@ public class SpringCloudZuulTracingTest extends TracingTestBase {
@Test
public void tracesFailedCallsReceivedByZuul() throws InterruptedException {
- ResponseEntity<String> responseEntity = testRestTemplate.getForEntity("/dummy/rest/oops", String.class);
- try {
- int code = responseEntity.getStatusCode().value();
- assertThat(code, is(590));
- expectFailing(IllegalArgumentException.class);
- } catch (Exception ignore) {
- }
+ ResponseEntity<String> response = testRestTemplate.getForEntity("/dummy/rest/oops", String.class);
+ assertThat(response.getStatusCodeValue(), is(590));
+ assertThat(response.getBody(), is("CommonExceptionData [message=Cse Internal Server Error]"));
+
TimeUnit.MILLISECONDS.sleep(1000);
Collection<String> tracingMessages = appender.pollLogs(".*\\[\\w+/\\w+/\\w*\\]\\s+INFO.*(logged tracing|/oops).*");
diff --git a/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/SpringMvcIntegrationTestBase.java b/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/SpringMvcIntegrationTestBase.java
index 0e3df63..c37c84e 100644
--- a/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/SpringMvcIntegrationTestBase.java
+++ b/integration-tests/springmvc-tests/src/test/java/org/apache/servicecomb/demo/springmvc/tests/SpringMvcIntegrationTestBase.java
@@ -325,10 +325,10 @@ public class SpringMvcIntegrationTestBase {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
- String result = restTemplate
- .postForObject(codeFirstUrl + "uploadWithoutAnnotation", new HttpEntity<>(map, headers), String.class);
-
- assertThat(result, is("CommonExceptionData [message=Cse Internal Server Error]"));
+ ResponseEntity<String> response = restTemplate
+ .postForEntity(codeFirstUrl + "uploadWithoutAnnotation", new HttpEntity<>(map, headers), String.class);
+ assertThat(response.getStatusCodeValue(), is(response.getStatusCodeValue()));
+ assertThat(response.getBody(), is("CommonExceptionData [message=Cse Internal Server Error]"));
}
@Test
@@ -628,8 +628,10 @@ public class SpringMvcIntegrationTestBase {
@Test
public void ensureServerBlowsUp() {
- String response = restTemplate.getForObject(controllerUrl + "sayhi?name=throwexception", String.class);
- assertThat(response, is("{\"message\":\"Cse Internal Server Error\"}"));
+ ResponseEntity<String> response = restTemplate
+ .getForEntity(controllerUrl + "sayhi?name=throwexception", String.class);
+ assertThat(response.getStatusCodeValue(), is(590));
+ assertThat(response.getBody(), is("{\"message\":\"Cse Internal Server Error\"}"));
}
@Test
diff --git a/java-chassis-dependencies/pom.xml b/java-chassis-dependencies/pom.xml
index bc45003..10cc514 100644
--- a/java-chassis-dependencies/pom.xml
+++ b/java-chassis-dependencies/pom.xml
@@ -141,6 +141,12 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-all</artifactId>
+ <version>1.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>com.dyuproject.protostuff</groupId>
<artifactId>protostuff-api</artifactId>
<version>1.0.7.fixed.3500</version>
diff --git a/parent/pom.xml b/parent/pom.xml
index 1956c6c..c21b2e7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -69,7 +69,6 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
- <version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
--
To stop receiving notification emails like this one, please contact
liubao@apache.org.