From e35bfc338e40ba3c8e6706bc1e2263360e734027 Mon Sep 17 00:00:00 2001 From: zhuyong Date: Mon, 6 Aug 2018 17:23:38 +0800 Subject: [PATCH] fix ut unstable --- .../java/com/alibaba/dubbo/config/AbstractConfigTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractConfigTest.java b/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractConfigTest.java index 5366b909109..765c429b8a3 100644 --- a/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractConfigTest.java +++ b/dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractConfigTest.java @@ -21,6 +21,7 @@ import com.alibaba.dubbo.config.api.Greeting; import com.alibaba.dubbo.config.support.Parameter; import junit.framework.TestCase; +import org.hamcrest.Matchers; import org.junit.Test; import java.lang.annotation.ElementType; @@ -32,6 +33,8 @@ import java.util.Map; import java.util.Properties; +import static org.junit.Assert.assertThat; + public class AbstractConfigTest { @Test @@ -267,8 +270,8 @@ public void appendAnnotation() throws Exception { TestCase.assertEquals(2, annotationConfig.getParameters().size()); TestCase.assertEquals("v1", annotationConfig.getParameters().get("k1")); TestCase.assertEquals("v2", annotationConfig.getParameters().get("k2")); - TestCase.assertEquals("", - annotationConfig.toString()); + assertThat(annotationConfig.toString(), Matchers.containsString("filter=\"f1, f2\" ")); + assertThat(annotationConfig.toString(), Matchers.containsString("listener=\"l1, l2\" ")); } private static class PropertiesConfig extends AbstractConfig {