File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
dubbo-common/src/test/java/org/apache/dubbo/config/context Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -410,11 +410,20 @@ void testGetConfigByIdOrName() {
410410 Assertions .fail ();
411411 } catch (Exception e ) {
412412 Assertions .assertTrue (e instanceof IllegalStateException );
413- Assertions .assertEquals (
414- e .getMessage (),
415- "Found more than one config by name: dubbo, instances: "
416- + "[<dubbo:protocol port=\" 9103\" name=\" dubbo\" />, <dubbo:protocol name=\" dubbo\" />]. "
417- + "Please remove redundant configs or get config by id." );
413+ String msg = e .getMessage ();
414+
415+ Assertions .assertTrue (
416+ msg .startsWith ("Found more than one config by name: dubbo, instances: " ),
417+ "Unexpected message prefix: " + msg );
418+ Assertions .assertTrue (
419+ msg .contains ("<dubbo:protocol port=\" 9103\" name=\" dubbo\" />" ),
420+ "Message should mention protocol with port 9103: " + msg );
421+ Assertions .assertTrue (
422+ msg .contains ("<dubbo:protocol name=\" dubbo\" />" ),
423+ "Message should mention protocol with default port: " + msg );
424+ Assertions .assertTrue (
425+ msg .endsWith ("Please remove redundant configs or get config by id." ),
426+ "Unexpected message suffix: " + msg );
418427 }
419428
420429 ModuleConfig moduleConfig = new ModuleConfig ();
You can’t perform that action at this time.
0 commit comments