Skip to content

Commit 7884aec

Browse files
authored
fix ut unstable (#2192)
1 parent 69311ab commit 7884aec

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dubbo-config/dubbo-config-api/src/test/java/com/alibaba/dubbo/config/AbstractConfigTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.alibaba.dubbo.config.api.Greeting;
2222
import com.alibaba.dubbo.config.support.Parameter;
2323
import junit.framework.TestCase;
24+
import org.hamcrest.Matchers;
2425
import org.junit.Test;
2526

2627
import java.lang.annotation.ElementType;
@@ -32,6 +33,8 @@
3233
import java.util.Map;
3334
import java.util.Properties;
3435

36+
import static org.junit.Assert.assertThat;
37+
3538
public class AbstractConfigTest {
3639

3740
@Test
@@ -267,8 +270,8 @@ public void appendAnnotation() throws Exception {
267270
TestCase.assertEquals(2, annotationConfig.getParameters().size());
268271
TestCase.assertEquals("v1", annotationConfig.getParameters().get("k1"));
269272
TestCase.assertEquals("v2", annotationConfig.getParameters().get("k2"));
270-
TestCase.assertEquals("<dubbo:annotation filter=\"f1, f2\" listener=\"l1, l2\" />",
271-
annotationConfig.toString());
273+
assertThat(annotationConfig.toString(), Matchers.containsString("filter=\"f1, f2\" "));
274+
assertThat(annotationConfig.toString(), Matchers.containsString("listener=\"l1, l2\" "));
272275
}
273276

274277
private static class PropertiesConfig extends AbstractConfig {

0 commit comments

Comments
 (0)