gpt4 book ai didi

org.springframework.test.web.servlet.result.XpathResultMatchers.getDefinedEncoding()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 01:25:05 27 4
gpt4 key购买 nike

本文整理了Java中org.springframework.test.web.servlet.result.XpathResultMatchers.getDefinedEncoding()方法的一些代码示例,展示了XpathResultMatchers.getDefinedEncoding()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XpathResultMatchers.getDefinedEncoding()方法的具体详情如下:
包路径:org.springframework.test.web.servlet.result.XpathResultMatchers
类名称:XpathResultMatchers
方法名:getDefinedEncoding

XpathResultMatchers.getDefinedEncoding介绍

[英]Get the response encoding if explicitly defined in the response, {code null} otherwise.
[中]如果在响应中显式定义了{code null},则获取响应编码。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Apply the XPath and assert the {@link String} value found.
 */
public ResultMatcher string(final String expectedValue) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert that content exists.
 */
public ResultMatcher exists() {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.exists(response.getContentAsByteArray(), getDefinedEncoding(response));
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert the number of nodes found with the given
 * Hamcrest {@link Matcher}.
 */
public ResultMatcher nodeCount(final Matcher<Integer> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert the {@link Double} value found.
 */
public ResultMatcher number(final Double expectedValue) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert that content doesn't exist.
 */
public ResultMatcher doesNotExist() {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.doesNotExist(response.getContentAsByteArray(), getDefinedEncoding(response));
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert the number of nodes found.
 */
public ResultMatcher nodeCount(final int expectedCount) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), expectedCount);
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert the {@link Double} value found with the
 * given Hamcrest {@link Matcher}.
 */
public ResultMatcher number(final Matcher<? super Double> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert the {@link Node} content found with the
 * given Hamcrest {@link Matcher}.
 */
public ResultMatcher node(final Matcher<? super Node> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNode(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Apply the XPath and assert the {@link String} value found with the given
 * Hamcrest {@link Matcher}.
 */
public ResultMatcher string(final Matcher<? super String> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Evaluate the XPath and assert the {@link Boolean} value found.
 */
public ResultMatcher booleanValue(final Boolean value) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertBoolean(response.getContentAsByteArray(), getDefinedEncoding(response), value);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert the {@link Boolean} value found.
 */
public ResultMatcher booleanValue(final Boolean value) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertBoolean(response.getContentAsByteArray(), getDefinedEncoding(response), value);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert that content doesn't exist.
 */
public ResultMatcher doesNotExist() {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.doesNotExist(response.getContentAsByteArray(), getDefinedEncoding(response));
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert the number of nodes found.
 */
public ResultMatcher nodeCount(final int expectedCount) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), expectedCount);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Apply the XPath and assert the {@link String} value found with the given
 * Hamcrest {@link Matcher}.
 */
public ResultMatcher string(final Matcher<? super String> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert the number of nodes found with the given
 * Hamcrest {@link Matcher}.
 */
public ResultMatcher nodeCount(final Matcher<Integer> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNodeCount(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert the {@link Double} value found with the
 * given Hamcrest {@link Matcher}.
 */
public ResultMatcher number(final Matcher<? super Double> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert the {@link Node} content found with the
 * given Hamcrest {@link Matcher}.
 */
public ResultMatcher node(final Matcher<? super Node> matcher) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNode(response.getContentAsByteArray(), getDefinedEncoding(response), matcher);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert that content exists.
 */
public ResultMatcher exists() {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.exists(response.getContentAsByteArray(), getDefinedEncoding(response));
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Apply the XPath and assert the {@link String} value found.
 */
public ResultMatcher string(final String expectedValue) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertString(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
  };
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-test

/**
 * Evaluate the XPath and assert the {@link Double} value found.
 */
public ResultMatcher number(final Double expectedValue) {
  return result -> {
    MockHttpServletResponse response = result.getResponse();
    this.xpathHelper.assertNumber(response.getContentAsByteArray(), getDefinedEncoding(response), expectedValue);
  };
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com