第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

JsonPathResultMatchers 不能應(yīng)用于 ResultMatcher

JsonPathResultMatchers 不能應(yīng)用于 ResultMatcher

蕪湖不蕪 2021-08-04 10:12:16
我正在嘗試使用 spring boot 進(jìn)行簡(jiǎn)單的測(cè)試。mockMvc.perform(post("/user")        .contentType(MediaType.APPLICATION_JSON)        .content(objectMapper.writeValueAsString(userJohn)))        .andExpect(jsonPath("$[0].username", is("bob")));對(duì) jsonPath 使用此導(dǎo)入:import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;我得到:andExpect (org.springframework.test.web.servlet.ResultMatcher) in ResultActions cannot be applied to (org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath)如果我嘗試將其轉(zhuǎn)換為 (ResultMatcher),我會(huì)得到:java.lang.ClassCastException: org.springframework.test.web.servlet.result.JsonPathResultMatchers cannot be cast to org.springframework.test.web.servlet.ResultMatcher我使用的是 Spring Boot 2.0.4 版。有什么想法可能是什么問題?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 308 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)