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


TypeScript ArtifactStoreTestData.dockerArtifactStore方法代码示例

本文整理汇总了TypeScript中models/artifact_stores/spec/test_data.ArtifactStoreTestData.dockerArtifactStore方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ArtifactStoreTestData.dockerArtifactStore方法的具体用法?TypeScript ArtifactStoreTestData.dockerArtifactStore怎么用?TypeScript ArtifactStoreTestData.dockerArtifactStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models/artifact_stores/spec/test_data.ArtifactStoreTestData的用法示例。


在下文中一共展示了ArtifactStoreTestData.dockerArtifactStore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: it

  it("should create a new artifact store", () => {
    jasmine.Ajax.stubRequest("/go/api/admin/artifact_stores").andReturn(artifactStoreResponse());

    ArtifactStoresCRUD.create(ArtifactStore.fromJSON(ArtifactStoreTestData.dockerArtifactStore()));

    const request = jasmine.Ajax.requests.mostRecent();
    expect(request.url).toEqual("/go/api/admin/artifact_stores");
    expect(request.method).toEqual("POST");
    expect(request.data()).toEqual(toJSON(ArtifactStoreTestData.dockerArtifactStore()));
    expect(request.requestHeaders.Accept).toEqual("application/vnd.go.cd.v1+json");
    expect(request.requestHeaders["Content-Type"]).toEqual("application/json; charset=utf-8");
  });
开发者ID:GaneshSPatil,项目名称:gocd,代码行数:12,代码来源:artifact_stores_crud_spec.ts

示例2: it

  it("should deserialize json to ArtifactStores", () => {
    const artifactStoresJSON = ArtifactStoreTestData.artifactStoreList(
      ArtifactStoreTestData.dockerArtifactStore(),
      ArtifactStoreTestData.mavenArtifactStore()
    );

    const artifactStores = ArtifactStores.fromJSON(artifactStoresJSON);

    expect(artifactStores.length).toEqual(2);

    expect(artifactStores[0].id()).toEqual("hub.docker");
    expect(artifactStores[0].pluginId()).toEqual("cd.go.artifact.docker.registry");
    expect(artifactStores[0].properties().count()).toEqual(3);
    expect(artifactStores[0].properties().valueFor("RegistryURL")).toEqual("https://your_docker_registry_url");
    expect(artifactStores[0].properties().valueFor("Username")).toEqual("admin");
    expect(artifactStores[0].properties().valueFor("Password"))
      .toEqual("AES:tdfTtYtIUSAF2JXJP/3YwA==:43Kjidjuh42NHKisCAs/BQ==");

    expect(artifactStores[1].id()).toEqual("maven.central");
    expect(artifactStores[1].pluginId()).toEqual("cd.go.artifact.maven.registry");
    expect(artifactStores[1].properties().count()).toEqual(3);
    expect(artifactStores[1].properties().valueFor("RegistryURL")).toEqual("https://your.maven.registry");
    expect(artifactStores[1].properties().valueFor("Username")).toEqual("bob");
    expect(artifactStores[1].properties().valueFor("Password"))
      .toEqual("AES:tdfTtYtIUSAF2JXJP/3YwA==:43Kjidjuh42NHKisCAs/BQ==");
  });
开发者ID:GaneshSPatil,项目名称:gocd,代码行数:26,代码来源:artifact_stores_spec.ts

示例3: artifactStoreResponse

function artifactStoreResponse() {
  return {
    status: 200,
    responseHeaders: {
      "Content-Type": "application/vnd.go.cd.v1+json; charset=utf-8",
      "ETag": "some-etag"
    },
    responseText: JSON.stringify(ArtifactStoreTestData.dockerArtifactStore())
  };
}
开发者ID:Skarlso,项目名称:gocd,代码行数:10,代码来源:artifact_stores_crud_spec.ts


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