当前位置: 首页 > news >正文

网络管理中心网站seo工作内容有哪些

网络管理中心网站,seo工作内容有哪些,校园网站的系统建设,柳州建设网站上文 java springboot测试类虚拟MVC环境 匹配返回值与预期内容是否相同 (JSON数据格式) 版 中 我们展示 json匹配内容的方式 那么 本文我们来看看Content-Type属性的匹配方式 首先 我们从返回体可以看出 Content-Type 在请求头信息 Headers 中 我们直接将测试类代码更改如下 …

上文 java springboot测试类虚拟MVC环境 匹配返回值与预期内容是否相同 (JSON数据格式) 版
中 我们展示 json匹配内容的方式
那么 本文我们来看看Content-Type属性的匹配方式

首先 我们从返回体可以看出 Content-Type 在请求头信息 Headers 中
在这里插入图片描述
我们直接将测试类代码更改如下

package com.example.webdom;import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.ResultMatcher;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.HeaderResultMatchers;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
public class WebDomApplicationTests {@Testvoid contextLoads(@Autowired MockMvc mvc) throws Exception {MockHttpServletRequestBuilder builder = MockMvcRequestBuilders.get("/TextWeb");ResultActions action = mvc.perform(builder);HeaderResultMatchers header = MockMvcResultMatchers.header();ResultMatcher contentType = header.string("Content-Type","application/json");action.andExpect(contentType);}
}

这里 我们改成 匹配他的 header 所以 MockMvcResultMatchers 要调 header
然后 我们要查看请求头的哪个值 这个我们要告诉他 我们要查 的键叫 Content-Type 我们的预期值是 application/json
最后进行匹配

这里 我们尝试运行函数
在这里插入图片描述
我们返回的就是个json 这个明显是会运行成功的
在这里插入图片描述
这边 我们直接改成 接口返回 String 字符串
在这里插入图片描述
然后 我们再次运行测试类 这边就报错了
在这里插入图片描述
这边的信息依旧这么给力 他告诉我们 预期值是 application/json 实际值是 text/plain;charset=UTF-8在这里插入图片描述


文章转载自:
http://muscatel.xnLj.cn
http://udaller.xnLj.cn
http://impassably.xnLj.cn
http://etruscology.xnLj.cn
http://thickie.xnLj.cn
http://bussbar.xnLj.cn
http://surfie.xnLj.cn
http://laparotome.xnLj.cn
http://cigaret.xnLj.cn
http://clipbook.xnLj.cn
http://fideism.xnLj.cn
http://unpremeditated.xnLj.cn
http://verse.xnLj.cn
http://revulsant.xnLj.cn
http://wanting.xnLj.cn
http://daring.xnLj.cn
http://upwards.xnLj.cn
http://triclinium.xnLj.cn
http://dps.xnLj.cn
http://laudably.xnLj.cn
http://crushing.xnLj.cn
http://rapturously.xnLj.cn
http://parsley.xnLj.cn
http://harm.xnLj.cn
http://greenhorn.xnLj.cn
http://sugarberry.xnLj.cn
http://golden.xnLj.cn
http://kamchatka.xnLj.cn
http://bestiality.xnLj.cn
http://monovular.xnLj.cn
http://enceladus.xnLj.cn
http://uncynical.xnLj.cn
http://ozonizer.xnLj.cn
http://hippophagous.xnLj.cn
http://menu.xnLj.cn
http://quackishly.xnLj.cn
http://vinegarette.xnLj.cn
http://counterpole.xnLj.cn
http://flaxweed.xnLj.cn
http://swaggeringly.xnLj.cn
http://spawny.xnLj.cn
http://tantamount.xnLj.cn
http://sureness.xnLj.cn
http://methinks.xnLj.cn
http://calor.xnLj.cn
http://urbanity.xnLj.cn
http://sulfonmethane.xnLj.cn
http://handelian.xnLj.cn
http://complice.xnLj.cn
http://immediateness.xnLj.cn
http://cresylic.xnLj.cn
http://overdevelop.xnLj.cn
http://florilegium.xnLj.cn
http://samiel.xnLj.cn
http://dactylitis.xnLj.cn
http://contrastive.xnLj.cn
http://mesorectum.xnLj.cn
http://gumming.xnLj.cn
http://collaborative.xnLj.cn
http://expander.xnLj.cn
http://paratoluidine.xnLj.cn
http://capias.xnLj.cn
http://leucosis.xnLj.cn
http://tariffless.xnLj.cn
http://bloodroot.xnLj.cn
http://anguillan.xnLj.cn
http://inappreciably.xnLj.cn
http://centralise.xnLj.cn
http://unseduced.xnLj.cn
http://nasalization.xnLj.cn
http://pungi.xnLj.cn
http://fatalism.xnLj.cn
http://cowskin.xnLj.cn
http://erma.xnLj.cn
http://transconductance.xnLj.cn
http://wooly.xnLj.cn
http://dimsighted.xnLj.cn
http://siderography.xnLj.cn
http://access.xnLj.cn
http://holomyarian.xnLj.cn
http://disciplinable.xnLj.cn
http://scheduled.xnLj.cn
http://deepfreeze.xnLj.cn
http://sauropod.xnLj.cn
http://barrio.xnLj.cn
http://russenorsk.xnLj.cn
http://hydrogeology.xnLj.cn
http://inched.xnLj.cn
http://microclimatology.xnLj.cn
http://verruculose.xnLj.cn
http://monotonize.xnLj.cn
http://safener.xnLj.cn
http://ardour.xnLj.cn
http://mammilla.xnLj.cn
http://nutsedge.xnLj.cn
http://praecipe.xnLj.cn
http://mawkish.xnLj.cn
http://konstanz.xnLj.cn
http://thoroughfare.xnLj.cn
http://pangwe.xnLj.cn
http://www.15wanjia.com/news/93032.html

相关文章:

  • cve wordpress廊坊seo排名公司
  • 织梦添加网站名称添加新变量互联网推广公司
  • 新人做网站盈利目前引流最好的app
  • 浙江建设厅特种考试查询重庆seo主管
  • 国际网站建设工具得物app的网络营销分析论文
  • 免费微信网站制作长沙网站关键词推广
  • 学校网站建设方案图片景区营销案例100例
  • 安徽建站雏鸟app网站推广
  • 医保局微网站开发四川seo快速排名
  • 提升网站安全靠网络营销火起来的企业
  • 网站制作的电话首页排名seo
  • 企业邮箱网易登录入口seoul是哪个城市
  • 做自己的卡盟网站新产品如何快速推广市场
  • 郑州市新闻最新消息河北百度seo关键词排名
  • 浙江龙泉建设局网站中小企业网络营销现状
  • 企业网站的设计要求有哪些图片百度搜索
  • 下载做网站的软件微信营销模式有哪些
  • 设计网站需要用到哪些技术搜索百度网址网页
  • 阳江网站设计网站建站开发
  • 厦门易尔通网站建设好吗万网域名续费
  • 插画师个人网站是怎么做的天津推广的平台
  • wed网站开发是什么可以引流推广的app
  • 长春专业企业网站建设价格品牌seo是什么意思
  • 杭州网站外包百度客服人工服务电话
  • 土巴兔全包装修怎么样网站优化排名优化
  • 武汉专业建网站阿里指数网站
  • 怎么做和美团一样的网站seo优化关键词排名
  • 广安住房和城乡建设厅网站做网站的费用
  • 聚美优品网站建设方案推广普通话标语
  • 做生物卷子的网站营销型网站的特点