@Test public void getDeployments() throws IOException { File deploymentsJson = new File(getClass().getClassLoader().getResource( DEPLOYMENTS_JSON) .getFile()); List<String> contents = Files.readAllLines(deploymentsJson.toPath()); mockServer.when(request().withMethod(GET).withPath(format(DEPLOYMENTS_PATH, ORG_ID, ENV_ID))) .respond(response().withStatusCode(200).withBody(String.join(System.lineSeparator(), contents), MediaType.JSON_UTF_8)); RuntimeFabricClient client = buildClientSpy(); Deployments deployments = client.getDeployments(); Set<String> verifiedIds = newHashSet("73894e6e-d9c5-11e6-bf27-cec0c932ce01", "73894e6e-d9c5-11e6-bf27-cec0c932ce02"); for (DeploymentGenericResponse response : deployments.items) { verifiedIds.remove(response.id); } assertThat("Verified ids should be empty", verifiedIds.isEmpty()); }
public Deployments getDeployments() { Response response = get(baseUri, getPathSupplier()); checkResponseStatus(response, OK); return response.readEntity(Deployments.class); }
RuntimeFabricClient extends AbstractMuleClient { public Deployments getDeployments() { Response response = get(baseUri, getPathSupplier()); checkResponseStatus(response, OK); return response.readEntity(Deployments.class); } }
RuntimeFabricClient extends AbstractMuleClient { public Deployments getDeployments() { Response response = get(baseUri, getPathSupplier()); checkResponseStatus(response, OK); return response.readEntity(Deployments.class); } RuntimeFabricClient(RuntimeFabricDeployment runtimeFabricDeployment, DeployerLog log); }
RuntimeFabricClient extends AbstractMuleClient { public Deployments getDeployments() { Response response = get(baseUri, getPathSupplier()); checkResponseStatus(response, OK); return response.readEntity(Deployments.class); } RuntimeFabricClient(RuntimeFabricDeployment runtimeFabricDeployment, DeployerLog log); Deployments getDeployments(); DeploymentDetailedResponse deploy(DeploymentRequest request); DeploymentDetailedResponse redeploy(DeploymentModify modify, String deploymentId); DeploymentDetailedResponse getDeployment(String deploymentId); DeploymentDetailedResponse deleteDeployment(String deploymentId); Supplier<String> getPathSupplier(); Supplier<String> getAgentsPathSupplier(); JsonArray getTargets(); JsonObject getTargetInfo(String targetId); JsonArray getDomainInfo(String targetId); }
RuntimeFabricClient extends AbstractMuleClient { public Deployments getDeployments() { Response response = get(baseUri, getPathSupplier()); checkResponseStatus(response, OK); return response.readEntity(Deployments.class); } RuntimeFabricClient(RuntimeFabricDeployment runtimeFabricDeployment, DeployerLog log); Deployments getDeployments(); DeploymentDetailedResponse deploy(DeploymentRequest request); DeploymentDetailedResponse redeploy(DeploymentModify modify, String deploymentId); DeploymentDetailedResponse getDeployment(String deploymentId); DeploymentDetailedResponse deleteDeployment(String deploymentId); Supplier<String> getPathSupplier(); Supplier<String> getAgentsPathSupplier(); JsonArray getTargets(); JsonObject getTargetInfo(String targetId); JsonArray getDomainInfo(String targetId); static final String API_VERSION; static final String HYBRID_API; static final String RESOURCES_PATH; static final String DEPLOYMENTS_PATH; static final String WORKERCLOUD_API_V1_AGENTS; static final String RUNTIME_FABRIC_TARGET_INFO; static final String RUNTIME_FABRIC_DOMAIN_INFO; }