提交 a9838c6f 编写于 作者: 武汉红喜's avatar 武汉红喜

mock

上级 2dd015b0
package org.hongxi.whatsmars.dubbo.demo.provider;
import org.hongxi.whatsmars.dubbo.demo.api.BarService;
import org.hongxi.whatsmars.dubbo.demo.api.vo.Bar;
public class BarServiceMock implements BarService {
@Override
public Bar findBar(String barId) {
// 你可以伪造容错数据,此方法只在出现RpcException时被执行
return new Bar("", "容错数据", "");
}
}
\ No newline at end of file
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<!-- 类似group的还有version="2.0.0" --> <!-- 类似group的还有version="2.0.0" -->
<dubbo:service group="new" interface="org.hongxi.whatsmars.dubbo.demo.api.DemoService" ref="demoService2" /> <dubbo:service group="new" interface="org.hongxi.whatsmars.dubbo.demo.api.DemoService" ref="demoService2" />
<dubbo:service interface="org.hongxi.whatsmars.dubbo.demo.api.BarService" ref="barService" /> <dubbo:service interface="org.hongxi.whatsmars.dubbo.demo.api.BarService" ref="barService"
mock="org.hongxi.whatsmars.dubbo.demo.provider.BarServiceMock" />
</beans> </beans>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册