当前位置: 首页>>代码示例>>Java>>正文


Java EverrestJetty类代码示例

本文整理汇总了Java中org.everrest.assured.EverrestJetty的典型用法代码示例。如果您正苦于以下问题:Java EverrestJetty类的具体用法?Java EverrestJetty怎么用?Java EverrestJetty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EverrestJetty类属于org.everrest.assured包,在下文中一共展示了EverrestJetty类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setUp

import org.everrest.assured.EverrestJetty; //导入依赖的package包/类
@BeforeMethod
public void setUp(ITestContext context) throws Exception {
  installer = TestInstallerFactory.createInstaller("id_0", "1.0.0");
  installerKey = InstallerFqn.of(installer).toKey();

  LocalInstallerRegistry localInstallerRegistry =
      new LocalInstallerRegistry(
          Collections.singleton(installer), new MapBasedInstallerDao(), new InstallerValidator());

  registryService = new InstallerRegistryService(localInstallerRegistry);

  Integer port = (Integer) context.getAttribute(EverrestJetty.JETTY_PORT);
  registry =
      new RemoteInstallerRegistry(
          "http://localhost:" + port + "/rest", new DefaultHttpJsonRequestFactory());
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:RemoteInstallerRegistryTest.java

示例2: linksHeaderShouldBeCorrectlyGenerated

import org.everrest.assured.EverrestJetty; //导入依赖的package包/类
@Test
public void linksHeaderShouldBeCorrectlyGenerated(ITestContext ctx) throws Exception {
  final Response response =
      given()
          .auth()
          .basic(ADMIN_USER_NAME, ADMIN_USER_PASSWORD)
          .contentType("application/json")
          .when()
          .get(SECURE_PATH + "/test/paging/test-path-param?query-param=test-query-param");

  assertEquals(response.getStatusCode(), 200);

  final String headerValue = response.getHeader("Link");
  assertNotNull(headerValue, "Link header is missing in the response");

  final Map<String, String> relToLinkMap = PagingUtil.parseLinkHeader(headerValue);
  final Set<String> expectedRels = new HashSet<>(asList("first", "last", "prev", "next"));
  assertEquals(
      relToLinkMap.keySet(),
      expectedRels,
      "Rels are different " + symmetricDifference(expectedRels, relToLinkMap.keySet()));

  final String expectedUri =
      "http://localhost:"
          + ctx.getAttribute(EverrestJetty.JETTY_PORT)
          + "/rest/private/test/paging/test-path-param";
  for (String link : relToLinkMap.values()) {
    final URI uri = URI.create(link);
    final Map<String, List<String>> params = getQueryParameters(uri.toURL());
    assertEquals(params.size(), 3);
    assertNotNull(params.get("skipCount"));
    assertNotNull(params.get("maxItems"));
    assertEquals(params.get("query-param").get(0), "test-query-param");
    assertEquals(link, expectedUri + '?' + uri.getQuery());
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:37,代码来源:LinkHeaderGenerationTest.java

示例3: getUrl

import org.everrest.assured.EverrestJetty; //导入依赖的package包/类
private String getUrl(ITestContext ctx) {
  return "http://localhost:" + ctx.getAttribute(EverrestJetty.JETTY_PORT) + "/rest/test";
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:DefaultHttpJsonRequestTest.java

示例4: getServerUrl

import org.everrest.assured.EverrestJetty; //导入依赖的package包/类
private String getServerUrl(ITestContext ctx) {
  return "http://localhost:" + ctx.getAttribute(EverrestJetty.JETTY_PORT) + "/rest";
}
 
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:RemoteServiceDescriptorTest.java


注:本文中的org.everrest.assured.EverrestJetty类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。