SubCategoryResourceIntTest.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:spring-io 作者:
@Test
@Transactional
public void searchSubCategory() throws Exception {
    // Initialize the database
    subCategoryService.save(subCategory);

    // Search the subCategory
    restSubCategoryMockMvc.perform(get("/api/_search/sub-categories?query=id:" + subCategory.getId()))
        .andExpect(status().isOk())
        .andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8_VALUE))
        .andExpect(jsonPath("$.[*].id").value(hasItem(subCategory.getId().intValue())))
        .andExpect(jsonPath("$.[*].name").value(hasItem(DEFAULT_NAME.toString())));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号