use of org.jfrog.build.extractor.clientConfiguration.client.distribution.request.DistributeReleaseBundleRequest in project build-info by JFrogDev.
the class RemoteDistributionManagerTest method createDistributionRequest.
private DistributeReleaseBundleRequest createDistributionRequest() {
DistributeReleaseBundleRequest distributionRequest = new DistributeReleaseBundleRequest();
List<DistributionRules> distributionRules = Lists.newArrayList(new DistributionRules.Builder().siteName("*").build());
distributionRequest.setDistributionRules(distributionRules);
return distributionRequest;
}
use of org.jfrog.build.extractor.clientConfiguration.client.distribution.request.DistributeReleaseBundleRequest in project build-info by JFrogDev.
the class LocalDistributionManagerTest method dryRunTest.
@Test
public void dryRunTest() throws IOException {
// Create release bundle
distributionManager.createReleaseBundle(createRequestBuilder().dryRun(true).build());
// Assert release bundle doesn't created
GetReleaseBundleStatusResponse bundleInfo = distributionManager.getReleaseBundleStatus(RELEASE_BUNDLE_NAME, RELEASE_BUNDLE_VERSION);
assertNull(bundleInfo);
// Create and sign release bundle
distributionManager.createReleaseBundle(createRequestBuilder().signImmediately(true).build());
// Distribute with dry run
DistributeReleaseBundleRequest request = new DistributeReleaseBundleRequest();
List<DistributionRules> distributionRules = Lists.newArrayList(new DistributionRules.Builder().siteName("*").build());
request.setDistributionRules(distributionRules);
request.setDryRun(true);
DistributeReleaseBundleResponse response = distributionManager.distributeReleaseBundle(RELEASE_BUNDLE_NAME, RELEASE_BUNDLE_VERSION, true, request);
// Assert no tracker ID returned and that the target site exist
assertTrue(StringUtils.isBlank(response.getTrackerId()));
List<DistributionStatusResponse.TargetArtifactory> sites = response.getSites();
assertTrue(CollectionUtils.hasElements(sites));
}
Aggregations