use of com.epam.ta.reportportal.entity.ItemAttribute in project service-api by reportportal.
the class PredicateItemAttributeTypeMatcherTest method systemShouldReturnFalse.
@Test
void systemShouldReturnFalse() {
final ItemAttribute publicAttribute = new ItemAttribute("k1", "v1", false);
Assertions.assertFalse(systemAttributeMatcher.matches(publicAttribute));
}
use of com.epam.ta.reportportal.entity.ItemAttribute in project service-api by reportportal.
the class PredicateItemAttributeTypeMatcherTest method publicShouldReturnTrue.
@Test
void publicShouldReturnTrue() {
final ItemAttribute publicAttribute = new ItemAttribute("k1", "v1", false);
Assertions.assertTrue(publicAttributeMatcher.matches(publicAttribute));
}
use of com.epam.ta.reportportal.entity.ItemAttribute in project service-api by reportportal.
the class LaunchBuilder method addAttribute.
public LaunchBuilder addAttribute(ItemAttributeResource attributeResource) {
ItemAttribute itemAttribute = FROM_RESOURCE.apply(attributeResource);
itemAttribute.setLaunch(launch);
launch.getAttributes().add(itemAttribute);
return this;
}
use of com.epam.ta.reportportal.entity.ItemAttribute in project service-api by reportportal.
the class ItemInfoUtils method updateAttribute.
public static void updateAttribute(Set<ItemAttribute> attributes, UpdateItemAttributeRQ updateItemAttributeRQ) {
ItemAttribute itemAttribute = attributes.stream().filter(attr -> ITEM_ATTRIBUTE_EQUIVALENCE.test(attr, updateItemAttributeRQ.getFrom())).findAny().orElseThrow(() -> new ReportPortalException(INCORRECT_REQUEST, "Cannot update not common attribute"));
attributes.remove(itemAttribute);
itemAttribute.setKey(updateItemAttributeRQ.getTo().getKey());
itemAttribute.setValue(updateItemAttributeRQ.getTo().getValue());
attributes.add(itemAttribute);
}
Aggregations