Search in sources :

Example 21 with ItemAttribute

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));
}
Also used : ItemAttribute(com.epam.ta.reportportal.entity.ItemAttribute) Test(org.junit.jupiter.api.Test)

Example 22 with ItemAttribute

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));
}
Also used : ItemAttribute(com.epam.ta.reportportal.entity.ItemAttribute) Test(org.junit.jupiter.api.Test)

Example 23 with ItemAttribute

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;
}
Also used : ItemAttribute(com.epam.ta.reportportal.entity.ItemAttribute)

Example 24 with ItemAttribute

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);
}
Also used : ReportPortalException(com.epam.ta.reportportal.exception.ReportPortalException) ItemAttribute(com.epam.ta.reportportal.entity.ItemAttribute)

Aggregations

ItemAttribute (com.epam.ta.reportportal.entity.ItemAttribute)24 Test (org.junit.jupiter.api.Test)16 Launch (com.epam.ta.reportportal.entity.launch.Launch)9 TestItem (com.epam.ta.reportportal.entity.item.TestItem)7 ItemAttributeResource (com.epam.ta.reportportal.ws.model.attribute.ItemAttributeResource)5 TestItemResults (com.epam.ta.reportportal.entity.item.TestItemResults)4 ReportPortalUser (com.epam.ta.reportportal.commons.ReportPortalUser)3 Parameter (com.epam.ta.reportportal.entity.item.Parameter)3 ReportPortalException (com.epam.ta.reportportal.exception.ReportPortalException)3 MessageBus (com.epam.ta.reportportal.core.events.MessageBus)2 TestItemService (com.epam.ta.reportportal.core.item.TestItemService)2 StatusChangingStrategy (com.epam.ta.reportportal.core.item.impl.status.StatusChangingStrategy)2 ProjectRepository (com.epam.ta.reportportal.dao.ProjectRepository)2 TestItemRepository (com.epam.ta.reportportal.dao.TestItemRepository)2 StatusEnum (com.epam.ta.reportportal.entity.enums.StatusEnum)2 TestItemIssueGroup (com.epam.ta.reportportal.entity.enums.TestItemIssueGroup)2 TestItemTypeEnum (com.epam.ta.reportportal.entity.enums.TestItemTypeEnum)2 IssueEntity (com.epam.ta.reportportal.entity.item.issue.IssueEntity)2 IssueType (com.epam.ta.reportportal.entity.item.issue.IssueType)2 ProjectRole (com.epam.ta.reportportal.entity.project.ProjectRole)2