Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 文档Spring集成http入站网关端点_Spring Boot_Spring Mvc_Spring Integration_Spring Restdocs - Fatal编程技术网

Spring boot 文档Spring集成http入站网关端点

Spring boot 文档Spring集成http入站网关端点,spring-boot,spring-mvc,spring-integration,spring-restdocs,Spring Boot,Spring Mvc,Spring Integration,Spring Restdocs,作为使用Spring集成创建REST API的开发活动的一部分,我试图探索记录API的可能性。 在网上阅读时,我有以下几个问题: 1) SpringRESTDocs模块能否用于记录Spring集成组件,如HTTP入站网关? 2) 如果是,是否可以在没有弹簧靴的情况下实现?我的团队的总体方向是使用纯弹簧(无靴),因此是问题的第二部分 提前谢谢 真诚地, Bharath由于Spring集成HTTP模块完全基于Spring MVC,文档生成机制保持不变:您基于MockMVC编写测试,并使用JUnitR

作为使用Spring集成创建REST API的开发活动的一部分,我试图探索记录API的可能性。 在网上阅读时,我有以下几个问题: 1) SpringRESTDocs模块能否用于记录Spring集成组件,如HTTP入站网关? 2) 如果是,是否可以在没有弹簧靴的情况下实现?我的团队的总体方向是使用纯弹簧(无靴),因此是问题的第二部分

提前谢谢

真诚地,
Bharath

由于Spring集成HTTP模块完全基于Spring MVC,文档生成机制保持不变:您基于MockMVC编写测试,并使用JUnitRestDocumentation对其进行增强:

@Rule
public JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation();

@Autowired
private WebApplicationContext context;

@Before
public void setUp() {
    this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
            .apply(documentationConfiguration(this.restDocumentation)) 
            .build();
}

是的,可以用弹簧靴。编写MockMVC测试不需要Spring引导:

非常感谢Artem!!这是一个很好的信息-我将遵循这条路线,如果卡住了,我将ping回来。