當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。