use of com.enonic.xp.issue.IssueName in project xp by enonic.
the class UpdateIssueCommandTest method update.
@Test
public void update() {
final UpdateIssueParams params = makeUpdateIssueParams();
final UpdateIssueCommand command = updateIssueCommand(params);
final IssueName issueName = IssueName.from(NamePrettyfier.create("title"));
final Issue issue = command.execute();
assertNotNull(issue);
assertEquals("title", issue.getTitle());
assertEquals(IssueStatus.OPEN, issue.getStatus());
assertEquals(issueName, issue.getName());
}
use of com.enonic.xp.issue.IssueName in project xp by enonic.
the class GetIssueCommandTest method getById.
@Test
public void getById() {
final GetIssueByIdCommand command = getIssueCommand(IssueId.create());
final IssueName issueName = IssueName.from(NamePrettyfier.create("title"));
final Issue issue = command.execute();
assertNotNull(issue);
assertEquals("title", issue.getTitle());
assertEquals(IssueStatus.OPEN, issue.getStatus());
assertEquals(issueName, issue.getName());
}
use of com.enonic.xp.issue.IssueName in project xp by enonic.
the class IssueNodeTranslatorTest method testFromNodeNotResolvingChildren.
@Test
public void testFromNodeNotResolvingChildren() throws Exception {
final Node node = createNode();
final Issue issue = IssueNodeTranslator.fromNode(node);
final IssueName issueName = IssueName.from(NamePrettyfier.create("title"));
assertNotNull(issue);
assertEquals("title", issue.getTitle());
assertEquals("description", issue.getDescription());
assertEquals(IssueStatus.OPEN, issue.getStatus());
assertEquals(PrincipalKey.from("user:myStore:me"), issue.getCreator());
assertEquals(PrincipalKey.from("user:myStore:approver-1"), issue.getApproverIds().first());
assertTrue(issue.getPublishRequest().getItems().contains(PublishRequestItem.create().id(ContentId.from("content-id1")).includeChildren(false).build()));
assertTrue(issue.getPublishRequest().getItems().contains(PublishRequestItem.create().id(ContentId.from("content-id2")).includeChildren(true).build()));
assertEquals(issueName, issue.getName());
}
use of com.enonic.xp.issue.IssueName in project xp by enonic.
the class CreateIssueCommand method doExecute.
private Issue doExecute() {
validateBlockingChecks();
final long index = countTotalIssues() + 1;
final IssueName issueName = IssueNameFactory.create(index);
final CreateNodeParams createNodeParams = CreateNodeParamsFactory.create(this.params, this.getCurrentUser(), index, issueName);
final Node createdNode;
try {
createdNode = nodeService.create(createNodeParams);
} catch (NodeAlreadyExistAtPathException e) {
throw new IssueAlreadyExistsException(IssueName.from(createNodeParams.getName()));
}
nodeService.refresh(RefreshMode.SEARCH);
return IssueNodeTranslator.fromNode(createdNode);
}
Aggregations