packagecom.xd.cubemall.feign;importcom.xd.cubemall.common.utils.R;importcom.xd.cubemall.product.CubemallProductApplication;importcom.xd.cubemall.product.entity.Blog;importcom.xd.cubemall.product.feign.SearchFeign;importorg.junit.Test;importorg.junit.runner.RunWith;importorg.springframework.beans.factory.annotation.Autowired;importorg.springframework.boot.test.context.SpringBootTest;importorg.springframework.test.context.junit4.SpringRunner;@RunWith(SpringRunner.class)@SpringBootTest(classes =CubemallProductApplication.class)publicclassSearchFeignTest{@AutowiredprivateSearchFeign searchFeign;@TestpublicvoidtestSayHello(){R r = searchFeign.sayHello("tom");System.out.println(r);}@TestpublicvoidtestSayHello2(){R r = searchFeign.sayHello2("张三");System.out.println(r);}@TestpublicvoidtestGetBlog(){Blog blog =newBlog();blog.setId(1l);blog.setTitle("hello");blog.setContent("world");R r = searchFeign.getBlog(blog);System.out.println(r);}@TestpublicvoidtestGetBlog2(){Blog blog =newBlog();blog.setId(1l);blog.setTitle("hello");blog.setContent("world");R r = searchFeign.getBlog2(blog,"aaa");System.out.println(r);}}