use of org.jfrog.filespecs.properties.Property in project build-info by JFrogDev.
the class LocalDistributionManagerTest method addedPropsTest.
@Test
public void addedPropsTest() throws IOException {
// Create a release bundle with added props
String fileName = uploadFile();
FileSpec fileSpec = new FileSpec();
FilesGroup filesGroup = new FilesGroup().setTargetProps("key1=value1,value2").setPattern(localRepo1 + "/data/" + fileName);
fileSpec.addFilesGroup(filesGroup);
CreateReleaseBundleRequest request = new CreateReleaseBundleRequest.Builder(RELEASE_BUNDLE_NAME, RELEASE_BUNDLE_VERSION).spec(fileSpec).build();
distributionManager.createReleaseBundle(request);
// Assert added props
GetReleaseBundleStatusResponse bundleInfo = distributionManager.getReleaseBundleStatus(RELEASE_BUNDLE_NAME, RELEASE_BUNDLE_VERSION);
assertNotNull(bundleInfo);
List<Property> addedProps = bundleInfo.getSpec().getQueries().get(0).getAddedProps();
assertFalse(addedProps.isEmpty());
Property property = addedProps.get(0);
assertEquals(property.getKey(), "key1");
assertEquals(property.getValues(), Sets.newHashSet("value1", "value2"));
}
Aggregations