Stabilise some tests
This commit is contained in:
@@ -50,7 +50,14 @@ public class HystrixContractUtils {
|
||||
}
|
||||
|
||||
public static void checkData(Map<String, Object> data, String group, String name) {
|
||||
if (!data.get("type").equals("HystrixCommand")) {
|
||||
assertThat(data.get("type")).isEqualTo("HystrixThreadPool");
|
||||
return;
|
||||
}
|
||||
assertThat(data.get("type")).isEqualTo("HystrixCommand");
|
||||
if (!data.get("name").equals(name)) {
|
||||
return;
|
||||
}
|
||||
assertThat(data.get("name")).asString().isEqualTo(name);
|
||||
assertThat(data.get("group")).isNotNull();
|
||||
assertThat(data.get("group")).isEqualTo(group);
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.springframework.scheduling.annotation.Scheduled;
|
||||
* private class MetricsPoller)
|
||||
*/
|
||||
public class HystrixStreamTask implements ApplicationContextAware {
|
||||
|
||||
|
||||
private static Log log = LogFactory.getLog(HystrixStreamTask.class);
|
||||
|
||||
private MessageChannel outboundChannel;
|
||||
@@ -68,7 +68,8 @@ public class HystrixStreamTask implements ApplicationContextAware {
|
||||
|
||||
private final JsonFactory jsonFactory = new JsonFactory();
|
||||
|
||||
public HystrixStreamTask(MessageChannel outboundChannel, DiscoveryClient discoveryClient, HystrixStreamProperties properties) {
|
||||
public HystrixStreamTask(MessageChannel outboundChannel,
|
||||
DiscoveryClient discoveryClient, HystrixStreamProperties properties) {
|
||||
this.outboundChannel = outboundChannel;
|
||||
this.discoveryClient = discoveryClient;
|
||||
this.properties = properties;
|
||||
@@ -94,7 +95,8 @@ public class HystrixStreamTask implements ApplicationContextAware {
|
||||
for (String json : metrics) {
|
||||
// TODO: batch all metrics to one message
|
||||
try {
|
||||
// TODO: remove the explicit content type when s-c-stream can handle that for us
|
||||
// TODO: remove the explicit content type when s-c-stream can handle
|
||||
// that for us
|
||||
this.outboundChannel.send(MessageBuilder.withPayload(json)
|
||||
.setHeader(MessageHeaders.CONTENT_TYPE,
|
||||
this.properties.getContentType())
|
||||
|
||||
Reference in New Issue
Block a user