CCM NG/ccm-cms: Fixed several test failures

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4870 8810af33-2d31-482b-a856-94f89814c4df
jensp 2017-07-14 14:59:16 +00:00
parent 5cb177ee7f
commit 3521d30ec1
7 changed files with 592 additions and 405 deletions

View File

@ -1278,6 +1278,7 @@ public class ContentItemManager {
.createNamedQuery( .createNamedQuery(
"ContentItem.findLiveVersion", ContentItem.class); "ContentItem.findLiveVersion", ContentItem.class);
query.setParameter("uuid", item.getItemUuid()); query.setParameter("uuid", item.getItemUuid());
contentItemRepo.setAuthorizationParameters(query);
final ContentItem result = query.getSingleResult(); final ContentItem result = query.getSingleResult();
if (type.isAssignableFrom(result.getClass())) { if (type.isAssignableFrom(result.getClass())) {

View File

@ -202,7 +202,7 @@ public class AssetManagerTest {
"datasets/org/librecms/contentsection/AssetManagerTest/data.xml") "datasets/org/librecms/contentsection/AssetManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value value
= "datasets/org/librecms/contentsection/AssetManagerTest/after-share.xml", = "datasets/org/librecms/contentsection/AssetManagerTest/after-share.xml",
excludeColumns = {"asset_id", excludeColumns = {"asset_id",
"categorization_id", "categorization_id",
"id", "id",
@ -465,11 +465,14 @@ public class AssetManagerTest {
"categorization_id", "categorization_id",
"object_order"}) "object_order"})
public void copyAssetToSameFolder() { public void copyAssetToSameFolder() {
final Asset asset = assetRepo.findById(-1100L).get();
final Folder targetFolder = folderRepo.findById(-420L).get(); shiro.getSystemUser().execute(() -> {
final Asset asset = assetRepo.findById(-1100L).get();
assetManager.copy(asset, targetFolder); final Folder targetFolder = folderRepo.findById(-420L).get();
assetManager.copy(asset, targetFolder);
});
} }
/** /**

View File

@ -100,67 +100,67 @@ public class ContentItemL10NManagerTest {
@Deployment @Deployment
public static WebArchive createDeployment() { public static WebArchive createDeployment() {
return ShrinkWrap return ShrinkWrap
.create(WebArchive.class, .create(WebArchive.class,
"LibreCCM-org.librecms.contentsection.ContentItemManagerTest.war"). "LibreCCM-org.librecms.contentsection.ContentItemManagerTest.war")
addPackage(org.libreccm.auditing.CcmRevision.class.getPackage()) .addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
.addPackage(org.libreccm.categorization.Categorization.class .addPackage(org.libreccm.categorization.Categorization.class
.getPackage()) .getPackage())
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage()) .addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
.addPackage(org.libreccm.configuration.Configuration.class .addPackage(org.libreccm.configuration.Configuration.class
.getPackage()) .getPackage())
.addPackage(org.libreccm.core.CcmCore.class.getPackage()) .addPackage(org.libreccm.core.CcmCore.class.getPackage())
.addPackage(org.libreccm.jpa.EntityManagerProducer.class .addPackage(org.libreccm.jpa.EntityManagerProducer.class
.getPackage()) .getPackage())
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class .addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
.getPackage()) .getPackage())
.addPackage(org.libreccm.l10n.LocalizedString.class .addPackage(org.libreccm.l10n.LocalizedString.class
.getPackage()) .getPackage())
.addClass(org.libreccm.portation.Portable.class) .addClass(org.libreccm.portation.Portable.class)
.addPackage(org.libreccm.security.Permission.class.getPackage()) .addPackage(org.libreccm.security.Permission.class.getPackage())
.addPackage(org.libreccm.web.CcmApplication.class.getPackage()) .addPackage(org.libreccm.web.CcmApplication.class.getPackage())
.addPackage(org.libreccm.workflow.Workflow.class.getPackage()) .addPackage(org.libreccm.workflow.Workflow.class.getPackage())
.addPackage(com.arsdigita.bebop.Component.class.getPackage()) .addPackage(com.arsdigita.bebop.Component.class.getPackage())
.addPackage(com.arsdigita.bebop.util.BebopConstants.class .addPackage(com.arsdigita.bebop.util.BebopConstants.class
.getPackage()) .getPackage())
.addClass(com.arsdigita.kernel.KernelConfig.class) .addClass(com.arsdigita.kernel.KernelConfig.class)
.addClass(com.arsdigita.runtime.CCMResourceManager.class) .addClass(com.arsdigita.runtime.CCMResourceManager.class)
.addClass(com.arsdigita.dispatcher.RequestContext.class) .addClass(com.arsdigita.dispatcher.RequestContext.class)
.addClass(com.arsdigita.dispatcher.AccessDeniedException.class) .addClass(com.arsdigita.dispatcher.AccessDeniedException.class)
.addClass( .addClass(
com.arsdigita.cms.dispatcher.ContentItemDispatcher.class). com.arsdigita.cms.dispatcher.ContentItemDispatcher.class).
addClass(com.arsdigita.dispatcher.Dispatcher.class) addClass(com.arsdigita.dispatcher.Dispatcher.class)
.addClass( .addClass(
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class). com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
addClass( .addClass(
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class). com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
addClass( .addClass(
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class). com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
addClass( .addClass(
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class). com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
addClass(org.librecms.dispatcher.ItemResolver.class) .addClass(org.librecms.dispatcher.ItemResolver.class)
.addPackage(com.arsdigita.util.Lockable.class.getPackage()) .addPackage(com.arsdigita.util.Lockable.class.getPackage())
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage()) .addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
.addPackage(org.librecms.Cms.class.getPackage()) .addPackage(org.librecms.Cms.class.getPackage())
.addPackage(org.librecms.contentsection.Asset.class.getPackage()). .addPackage(org.librecms.contentsection.Asset.class.getPackage()).
addPackage(org.librecms.contentsection.AttachmentList.class addPackage(org.librecms.contentsection.AttachmentList.class
.getPackage()) .getPackage())
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage()) .addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
.addPackage(org.librecms.contentsection.ContentSection.class .addPackage(org.librecms.contentsection.ContentSection.class
.getPackage()) .getPackage())
.addPackage(org.librecms.contenttypes.Article.class.getPackage()). .addPackage(org.librecms.contenttypes.Article.class.getPackage()).
addClass(com.arsdigita.kernel.security.SecurityConfig.class) addClass(com.arsdigita.kernel.security.SecurityConfig.class)
.addPackage(org.libreccm.tests.categories.IntegrationTest.class .addPackage(org.libreccm.tests.categories.IntegrationTest.class
.getPackage()) .getPackage())
// .addAsLibraries(getModuleDependencies()) // .addAsLibraries(getModuleDependencies())
.addAsLibraries(getCcmCoreDependencies()) .addAsLibraries(getCcmCoreDependencies())
.addAsResource("configs/shiro.ini", "shiro.ini") .addAsResource("configs/shiro.ini", "shiro.ini")
.addAsResource( .addAsResource(
"configs/org/librecms/contentsection/ContentItemManagerTest/log4j2.xml", "configs/org/librecms/contentsection/ContentItemManagerTest/log4j2.xml",
"log4j2.xml") "log4j2.xml")
.addAsResource("test-persistence.xml", .addAsResource("test-persistence.xml",
"META-INF/persistence.xml") "META-INF/persistence.xml")
.addAsWebInfResource("test-web.xml", "web.xml") .addAsWebInfResource("test-web.xml", "web.xml")
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml"); .addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
} }
@Test @Test
@ -179,7 +179,7 @@ public class ContentItemL10NManagerTest {
@Test @Test
@InSequence(10) @InSequence(10)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
public void verifyHasLanguage() { public void verifyHasLanguage() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L); final Optional<ContentItem> item = itemRepo.findById(-10100L);
@ -204,7 +204,7 @@ public class ContentItemL10NManagerTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@InSequence(20) @InSequence(20)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void hasLanguageItemIsNull() { public void hasLanguageItemIsNull() {
final ContentItem item = null; final ContentItem item = null;
@ -221,14 +221,17 @@ public class ContentItemL10NManagerTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@InSequence(30) @InSequence(30)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void hasLanguageLanguageIsNull() { public void hasLanguageLanguageIsNull() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
assertThat(l10nManager.hasLanguage(item.get(), null), shiro.getSystemUser().execute(() -> {
is(true)); final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
assertThat(l10nManager.hasLanguage(item.get(), null),
is(true));
});
} }
@ -239,16 +242,19 @@ public class ContentItemL10NManagerTest {
@Test @Test
@InSequence(40) @InSequence(40)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/after-add-language.xml", + "ContentItemL10NManagerTest/after-add-language.xml",
excludeColumns = {"timestamp"}) excludeColumns = {"timestamp"})
public void addLanguage() { public void addLanguage() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.addLanguage(item.get(), Locale.GERMAN); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.addLanguage(item.get(), Locale.GERMAN);
});
} }
/** /**
@ -259,15 +265,18 @@ public class ContentItemL10NManagerTest {
@Test @Test
@InSequence(50) @InSequence(50)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
public void addLanguageAlreadyPresent() { public void addLanguageAlreadyPresent() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.addLanguage(item.get(), Locale.FRENCH); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.addLanguage(item.get(), Locale.FRENCH);
});
} }
@ -279,15 +288,18 @@ public class ContentItemL10NManagerTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@InSequence(60) @InSequence(60)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void addLanguageItemIsNull() { public void addLanguageItemIsNull() {
final ContentItem item = null;
l10nManager.addLanguage(item, Locale.GERMAN); shiro.getSystemUser().execute(() -> {
final ContentItem item = null;
l10nManager.addLanguage(item, Locale.GERMAN);
});
} }
/** /**
@ -298,16 +310,19 @@ public class ContentItemL10NManagerTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@InSequence(20) @InSequence(20)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void addLanguageLanguageIsNull() { public void addLanguageLanguageIsNull() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.addLanguage(item.get(), null); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.addLanguage(item.get(), null);
});
} }
/** /**
@ -317,16 +332,19 @@ public class ContentItemL10NManagerTest {
@Test @Test
@InSequence(70) @InSequence(70)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/after-remove-language.xml", + "ContentItemL10NManagerTest/after-remove-language.xml",
excludeColumns = {"timestamp"}) excludeColumns = {"timestamp"})
public void removeLanguage() { public void removeLanguage() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.removeLanguage(item.get(), Locale.FRENCH); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.removeLanguage(item.get(), Locale.FRENCH);
});
} }
/** /**
@ -337,15 +355,18 @@ public class ContentItemL10NManagerTest {
@Test @Test
@InSequence(80) @InSequence(80)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
public void removeNotPresentLanguage() { public void removeNotPresentLanguage() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.removeLanguage(item.get(), Locale.GERMAN); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.removeLanguage(item.get(), Locale.GERMAN);
});
} }
/** /**
@ -357,15 +378,18 @@ public class ContentItemL10NManagerTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@InSequence(90) @InSequence(90)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void removeLanguageItemIsNull() { public void removeLanguageItemIsNull() {
final ContentItem item = null;
l10nManager.removeLanguage(item, Locale.GERMAN); shiro.getSystemUser().execute(() -> {
final ContentItem item = null;
l10nManager.removeLanguage(item, Locale.GERMAN);
});
} }
/** /**
@ -377,16 +401,19 @@ public class ContentItemL10NManagerTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@InSequence(100) @InSequence(100)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void removeLanguageLanguageIsNull() { public void removeLanguageLanguageIsNull() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.removeLanguage(item.get(), null); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.removeLanguage(item.get(), null);
});
} }
@ -397,16 +424,19 @@ public class ContentItemL10NManagerTest {
@Test @Test
@InSequence(120) @InSequence(120)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/after-normalize.xml", + "ContentItemL10NManagerTest/after-normalize.xml",
excludeColumns = {"timestamp"}) excludeColumns = {"timestamp"})
public void normalizeItem() { public void normalizeItem() {
final Optional<ContentItem> item = itemRepo.findById(-10200L);
assertThat(item.isPresent(), is(true));
l10nManager.normalizeLanguages(item.get()); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10200L);
assertThat(item.isPresent(), is(true));
l10nManager.normalizeLanguages(item.get());
});
} }
/** /**
@ -417,15 +447,18 @@ public class ContentItemL10NManagerTest {
@Test @Test
@InSequence(130) @InSequence(130)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
public void normalizeItemAlreadyNormalized() { public void normalizeItemAlreadyNormalized() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.normalizeLanguages(item.get()); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
l10nManager.normalizeLanguages(item.get());
});
} }
@ -438,15 +471,18 @@ public class ContentItemL10NManagerTest {
@Test(expected = IllegalArgumentException.class) @Test(expected = IllegalArgumentException.class)
@InSequence(140) @InSequence(140)
@UsingDataSet("datasets/org/librecms/contentsection/" @UsingDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldMatchDataSet( @ShouldMatchDataSet(
value = "datasets/org/librecms/contentsection/" value = "datasets/org/librecms/contentsection/"
+ "ContentItemL10NManagerTest/data.xml") + "ContentItemL10NManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void normalizeItemNull() { public void normalizeItemNull() {
final ContentItem item = null;
l10nManager.normalizeLanguages(item); shiro.getSystemUser().execute(() -> {
final ContentItem item = null;
l10nManager.normalizeLanguages(item);
});
} }
} }

View File

@ -228,6 +228,7 @@ public class ContentItemManagerTest {
"object_order", "object_order",
"phase_id", "phase_id",
"rev", "rev",
"task_assignment_id",
"task_id", "task_id",
"uuid", "uuid",
"timestamp", "timestamp",
@ -259,7 +260,7 @@ public class ContentItemManagerTest {
final TypedQuery<Long> query = entityManager.createQuery( final TypedQuery<Long> query = entityManager.createQuery(
"SELECT COUNT(w) FROM Workflow w", Long.class); "SELECT COUNT(w) FROM Workflow w", Long.class);
final long workflowCount = query.getSingleResult(); final long workflowCount = query.getSingleResult();
assertThat("Expected three workflows in database.", assertThat("Expected four workflows in database.",
workflowCount, is(4L)); workflowCount, is(4L));
}); });
} }
@ -278,16 +279,19 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void createItemTypeNotInSection() { public void createItemTypeNotInSection() {
final ContentSection section = sectionRepo
.findByLabel("info")
.get();
final Folder folder = section.getRootDocumentsFolder();
itemManager.createContentItem("Test", shiro.getSystemUser().execute(() -> {
section, final ContentSection section = sectionRepo
folder, .findByLabel("info")
Event.class, .get();
Locale.ENGLISH); final Folder folder = section.getRootDocumentsFolder();
itemManager.createContentItem("Test",
section,
folder,
Event.class,
Locale.ENGLISH);
});
} }
/** /**
@ -303,15 +307,16 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void createItemNameIsNull() { public void createItemNameIsNull() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final ContentSection section = sectionRepo final ContentSection section = sectionRepo
.findByLabel("info") .findByLabel("info")
.get(); .get();
final Folder folder = section.getRootDocumentsFolder(); final Folder folder = section.getRootDocumentsFolder();
itemManager.createContentItem(null, itemManager.createContentItem(null,
section, section,
folder, folder,
Article.class, Article.class,
Locale.ENGLISH); Locale.ENGLISH);
}); });
@ -330,6 +335,7 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void createItemNameIsEmpty() { public void createItemNameIsEmpty() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final ContentSection section = sectionRepo final ContentSection section = sectionRepo
.findByLabel("info") .findByLabel("info")
@ -337,8 +343,8 @@ public class ContentItemManagerTest {
final Folder folder = section.getRootDocumentsFolder(); final Folder folder = section.getRootDocumentsFolder();
itemManager.createContentItem(" ", itemManager.createContentItem(" ",
section, section,
folder, folder,
Article.class, Article.class,
Locale.ENGLISH); Locale.ENGLISH);
}); });
@ -358,14 +364,15 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(NullPointerException.class) @ShouldThrowException(NullPointerException.class)
public void createItemFolderIsNull() { public void createItemFolderIsNull() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final ContentSection section = sectionRepo final ContentSection section = sectionRepo
.findByLabel("info") .findByLabel("info")
.get(); .get();
itemManager.createContentItem("Test", itemManager.createContentItem("Test",
section, section,
null, null,
Article.class, Article.class,
Locale.ENGLISH); Locale.ENGLISH);
}); });
@ -392,11 +399,13 @@ public class ContentItemManagerTest {
"phase_id", "phase_id",
"rev", "rev",
"task_id", "task_id",
"task_assignment_id",
"timestamp", "timestamp",
"uuid", "uuid",
"workflow_id" "workflow_id"
}) })
public void createContentItemWithWorkflow() { public void createContentItemWithWorkflow() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final ContentSection section = sectionRepo final ContentSection section = sectionRepo
.findByLabel("info") .findByLabel("info")
@ -477,6 +486,7 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void createItemNameIsNullWithWorkflow() { public void createItemNameIsNullWithWorkflow() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final ContentSection section = sectionRepo final ContentSection section = sectionRepo
.findByLabel("info") .findByLabel("info")
@ -509,6 +519,7 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void createItemNameIsNullWorkflowIsNull() { public void createItemNameIsNullWorkflowIsNull() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final ContentSection section = sectionRepo final ContentSection section = sectionRepo
.findByLabel("info") .findByLabel("info")
@ -538,6 +549,7 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(NullPointerException.class) @ShouldThrowException(NullPointerException.class)
public void createItemFolderIsNullWithWorkflow() { public void createItemFolderIsNullWithWorkflow() {
shiro.getSystemUser().execute(() -> { shiro.getSystemUser().execute(() -> {
final ContentSection section = sectionRepo final ContentSection section = sectionRepo
.findByLabel("info") .findByLabel("info")
@ -577,13 +589,15 @@ public class ContentItemManagerTest {
}) })
public void moveItem() { public void moveItem() {
final Optional<ContentItem> item = itemRepo.findById(-10100L); shiro.getSystemUser().execute(() -> {
assertThat(item.isPresent(), is(true)); final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
final Folder targetFolder = folderRepo.findById(-2120L).get(); final Folder targetFolder = folderRepo.findById(-2120L).get();
assertThat(targetFolder, is(not(nullValue()))); assertThat(targetFolder, is(not(nullValue())));
itemManager.move(item.get(), targetFolder); itemManager.move(item.get(), targetFolder);
});
} }
/** /**
@ -607,18 +621,21 @@ public class ContentItemManagerTest {
"workflow_id" "workflow_id"
}) })
public void moveItemToOtherContentSection() { public void moveItemToOtherContentSection() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
assertThat(item.isPresent(), is(true)); shiro.getSystemUser().execute(() -> {
assertThat(targetFolder, is(not(nullValue()))); final Optional<ContentItem> item = itemRepo.findById(-10100L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
itemManager.move(item.get(), targetFolder); assertThat(item.isPresent(), is(true));
assertThat(targetFolder, is(not(nullValue())));
itemManager.move(item.get(), targetFolder);
});
} }
/** /**
* Verifies that null null null null null null null null null null null null * Verifies that
* null null null null null null null null null null {@link ContentItemManager#move(org.librecms.contentsection.ContentItem, org.librecms.contentsection.Folder) * {@link ContentItemManager#move(org.librecms.contentsection.ContentItem, org.librecms.contentsection.Folder)}
* throws an {@link IllegalArgumentException} if the type of the item to * throws an {@link IllegalArgumentException} if the type of the item to
* copy has not been registered in content section to which the target * copy has not been registered in content section to which the target
* folder belongs. * folder belongs.
@ -631,13 +648,16 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void moveToOtherContentSectionTypeNotPresent() { public void moveToOtherContentSectionTypeNotPresent() {
final Optional<ContentItem> item = itemRepo.findById(-10400L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
assertThat(item.isPresent(), is(true)); shiro.getSystemUser().execute(() -> {
assertThat(targetFolder, is(not(nullValue()))); final Optional<ContentItem> item = itemRepo.findById(-10400L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
itemManager.move(item.get(), targetFolder); assertThat(item.isPresent(), is(true));
assertThat(targetFolder, is(not(nullValue())));
itemManager.move(item.get(), targetFolder);
});
} }
/** /**
@ -654,10 +674,13 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void moveItemNull() { public void moveItemNull() {
final Folder targetFolder = folderRepo.findById(-2120L).get();
assertThat(targetFolder, is(not(nullValue())));
itemManager.move(null, targetFolder); shiro.getSystemUser().execute(() -> {
final Folder targetFolder = folderRepo.findById(-2120L).get();
assertThat(targetFolder, is(not(nullValue())));
itemManager.move(null, targetFolder);
});
} }
/** /**
@ -674,10 +697,13 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void moveItemTargetFolderIsNull() { public void moveItemTargetFolderIsNull() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
itemManager.move(item.get(), null); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
itemManager.move(item.get(), null);
});
} }
/** /**
@ -709,13 +735,16 @@ public class ContentItemManagerTest {
"workflow_id" "workflow_id"
}) })
public void copyToOtherFolder() { public void copyToOtherFolder() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
final Folder targetFolder = folderRepo.findById(-2120L).get(); shiro.getSystemUser().execute(() -> {
assertThat(targetFolder, is(not(nullValue()))); final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
itemManager.copy(item.get(), targetFolder); final Folder targetFolder = folderRepo.findById(-2120L).get();
assertThat(targetFolder, is(not(nullValue())));
itemManager.copy(item.get(), targetFolder);
});
} }
/** /**
@ -747,16 +776,21 @@ public class ContentItemManagerTest {
"workflow_id" "workflow_id"
}) })
public void copyToFolderInOtherSection() { public void copyToFolderInOtherSection() {
final Optional<ContentItem> source = itemRepo.findById(-10100L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
assertThat(source.isPresent(), is(true)); shiro.getSystemUser().execute(() -> {
assertThat(targetFolder, is(not(nullValue()))); final Optional<ContentItem> source = itemRepo.findById(-10100L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
final ContentItem target = itemManager.copy(source.get(), targetFolder); assertThat(source.isPresent(), is(true));
assertThat(targetFolder, is(not(nullValue())));
assertThat(target.getUuid(), is(not(equalTo(source.get().getUuid())))); final ContentItem target = itemManager.copy(source.get(),
assertThat(target.getItemUuid(), is(equalTo(target.getUuid()))); targetFolder);
assertThat(target.getUuid(),
is(not(equalTo(source.get().getUuid()))));
assertThat(target.getItemUuid(), is(equalTo(target.getUuid())));
});
} }
/** /**
@ -774,13 +808,16 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void copyToFolderInOtherSectionTypeNotPresent() { public void copyToFolderInOtherSectionTypeNotPresent() {
final Optional<ContentItem> source = itemRepo.findById(-10400L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
assertThat(source.isPresent(), is(true)); shiro.getSystemUser().execute(() -> {
assertThat(targetFolder, is(not(nullValue()))); final Optional<ContentItem> source = itemRepo.findById(-10400L);
final Folder targetFolder = folderRepo.findById(-2300L).get();
itemManager.copy(source.get(), targetFolder); assertThat(source.isPresent(), is(true));
assertThat(targetFolder, is(not(nullValue())));
itemManager.copy(source.get(), targetFolder);
});
} }
/** /**
@ -814,13 +851,16 @@ public class ContentItemManagerTest {
"workflow_id" "workflow_id"
}) })
public void copyToSameFolder() { public void copyToSameFolder() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
final Folder targetFolder = folderRepo.findById(-2110L).get(); shiro.getSystemUser().execute(() -> {
assertThat(targetFolder, is(not(nullValue()))); final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
itemManager.copy(item.get(), targetFolder); final Folder targetFolder = folderRepo.findById(-2110L).get();
assertThat(targetFolder, is(not(nullValue())));
itemManager.copy(item.get(), targetFolder);
});
} }
/** /**
@ -838,10 +878,13 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void copyItemNull() { public void copyItemNull() {
final Folder targetFolder = folderRepo.findById(-2120L).get();
assertThat(targetFolder, is(not(nullValue())));
itemManager.copy(null, targetFolder); shiro.getSystemUser().execute(() -> {
final Folder targetFolder = folderRepo.findById(-2120L).get();
assertThat(targetFolder, is(not(nullValue())));
itemManager.copy(null, targetFolder);
});
} }
/** /**
@ -859,10 +902,13 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void copyItemToFolderNull() { public void copyItemToFolderNull() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
itemManager.copy(item.get(), null); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
itemManager.copy(item.get(), null);
});
} }
/** /**
@ -897,12 +943,15 @@ public class ContentItemManagerTest {
"workflow_id" "workflow_id"
}) })
public void publishItem() { public void publishItem() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(item.isPresent(), is(true));
final ContentItem live = itemManager.publish(item.get()); shiro.getSystemUser().execute(() -> {
assertThat(live, is(not(nullValue()))); final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(live.getVersion(), is(ContentItemVersion.LIVE)); assertThat(item.isPresent(), is(true));
final ContentItem live = itemManager.publish(item.get());
assertThat(live, is(not(nullValue())));
assertThat(live.getVersion(), is(ContentItemVersion.LIVE));
});
} }
/** /**
@ -937,15 +986,19 @@ public class ContentItemManagerTest {
"workflow_id" "workflow_id"
}) })
public void publishItemWithLifecycle() { public void publishItemWithLifecycle() {
final Optional<ContentItem> item = itemRepo.findById(-10100L);
final LifecycleDefinition lifecycleDef = lifecycleDefinitionRepo
.findById(-200L).get();
assertThat(item.isPresent(), is(true));
assertThat(lifecycleDef, is(not(nullValue())));
final ContentItem live = itemManager.publish(item.get(), lifecycleDef); shiro.getSystemUser().execute(() -> {
assertThat(live, is(not(nullValue()))); final Optional<ContentItem> item = itemRepo.findById(-10100L);
assertThat(live.getVersion(), is(ContentItemVersion.LIVE)); final LifecycleDefinition lifecycleDef = lifecycleDefinitionRepo
.findById(-200L).get();
assertThat(item.isPresent(), is(true));
assertThat(lifecycleDef, is(not(nullValue())));
final ContentItem live = itemManager.publish(item.get(),
lifecycleDef);
assertThat(live, is(not(nullValue())));
assertThat(live.getVersion(), is(ContentItemVersion.LIVE));
});
} }
/** /**
@ -971,18 +1024,21 @@ public class ContentItemManagerTest {
"uuid", "uuid",
"workflow_id"}) "workflow_id"})
public void republishItem() { public void republishItem() {
final Optional<ContentItem> item = itemRepo.findById(-10200L);
assertThat(item.isPresent(), is(true));
item.get().getName().addValue(Locale.ENGLISH, "article2-edited"); shiro.getSystemUser().execute(() -> {
item.get().getTitle() final Optional<ContentItem> item = itemRepo.findById(-10200L);
.addValue(Locale.ENGLISH, "Article has been edited"); assertThat(item.isPresent(), is(true));
itemRepo.save(item.get());
final Optional<ContentItem> draft = itemRepo.findById(-10200L); item.get().getName().addValue(Locale.ENGLISH, "article2-edited");
assertThat(draft.get().getName().getValue(Locale.ENGLISH), item.get().getTitle()
is(equalTo("article2-edited"))); .addValue(Locale.ENGLISH, "Article has been edited");
itemManager.publish(draft.get()); itemRepo.save(item.get());
final Optional<ContentItem> draft = itemRepo.findById(-10200L);
assertThat(draft.get().getName().getValue(Locale.ENGLISH),
is(equalTo("article2-edited")));
itemManager.publish(draft.get());
});
} }
/** /**
@ -999,9 +1055,12 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void publishItemNull() { public void publishItemNull() {
final ContentItem item = null;
itemManager.publish(item); shiro.getSystemUser().execute(() -> {
final ContentItem item = null;
itemManager.publish(item);
});
} }
/** /**
@ -1018,9 +1077,12 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void publishItemLifecycleIsNull() { public void publishItemLifecycleIsNull() {
final Optional<ContentItem> draft = itemRepo.findById(-10200L);
itemManager.publish(draft.get(), null); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> draft = itemRepo.findById(-10200L);
itemManager.publish(draft.get(), null);
});
} }
/** /**
@ -1047,10 +1109,13 @@ public class ContentItemManagerTest {
"uuid", "uuid",
"workflow_id"}) "workflow_id"})
public void unpublishItem() { public void unpublishItem() {
final Optional<ContentItem> item = itemRepo.findById(-10200L);
assertThat(item.isPresent(), is(true));
itemManager.unpublish(item.get()); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10200L);
assertThat(item.isPresent(), is(true));
itemManager.unpublish(item.get());
});
} }
/** /**
@ -1065,10 +1130,13 @@ public class ContentItemManagerTest {
@ShouldMatchDataSet("datasets/org/librecms/contentsection/" @ShouldMatchDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
public void unpublishNonLiveItem() { public void unpublishNonLiveItem() {
final Optional<ContentItem> item = itemRepo.findById(-10300L);
assertThat(item.isPresent(), is(true));
itemManager.unpublish(item.get()); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-10300L);
assertThat(item.isPresent(), is(true));
itemManager.unpublish(item.get());
});
} }
/** /**
@ -1085,8 +1153,11 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void unpublishItemNull() { public void unpublishItemNull() {
final ContentItem item = null;
itemManager.unpublish(item); shiro.getSystemUser().execute(() -> {
final ContentItem item = null;
itemManager.unpublish(item);
});
} }
/** /**
@ -1101,20 +1172,23 @@ public class ContentItemManagerTest {
@ShouldMatchDataSet("datasets/org/librecms/contentsection/" @ShouldMatchDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
public void isLive() { public void isLive() {
final Optional<ContentItem> item1 = itemRepo.findById(-10100L);
final Optional<ContentItem> item2 = itemRepo.findById(-10200L);
final Optional<ContentItem> item3 = itemRepo.findById(-10300L);
final Optional<ContentItem> item4 = itemRepo.findById(-10400L);
assertThat(item1.isPresent(), is(true)); shiro.getSystemUser().execute(() -> {
assertThat(item2.isPresent(), is(true)); final Optional<ContentItem> item1 = itemRepo.findById(-10100L);
assertThat(item3.isPresent(), is(true)); final Optional<ContentItem> item2 = itemRepo.findById(-10200L);
assertThat(item4.isPresent(), is(true)); final Optional<ContentItem> item3 = itemRepo.findById(-10300L);
final Optional<ContentItem> item4 = itemRepo.findById(-10400L);
assertThat(itemManager.isLive(item1.get()), is(false)); assertThat(item1.isPresent(), is(true));
assertThat(itemManager.isLive(item2.get()), is(true)); assertThat(item2.isPresent(), is(true));
assertThat(itemManager.isLive(item3.get()), is(false)); assertThat(item3.isPresent(), is(true));
assertThat(itemManager.isLive(item4.get()), is(false)); assertThat(item4.isPresent(), is(true));
assertThat(itemManager.isLive(item1.get()), is(false));
assertThat(itemManager.isLive(item2.get()), is(true));
assertThat(itemManager.isLive(item3.get()), is(false));
assertThat(itemManager.isLive(item4.get()), is(false));
});
} }
/** /**
@ -1131,43 +1205,46 @@ public class ContentItemManagerTest {
@ShouldMatchDataSet("datasets/org/librecms/contentsection/" @ShouldMatchDataSet("datasets/org/librecms/contentsection/"
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
public void getLiveVersion() { public void getLiveVersion() {
final Optional<ContentItem> draft1 = itemRepo.findById(-10100L);
final Optional<ContentItem> draft2 = itemRepo.findById(-10200L);
final Optional<ContentItem> draft3 = itemRepo.findById(-10300L);
final Optional<ContentItem> draft4 = itemRepo.findById(-10400L);
final Optional<ContentItem> live2 = itemRepo.findById(-99200L); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> draft1 = itemRepo.findById(-10100L);
final Optional<ContentItem> draft2 = itemRepo.findById(-10200L);
final Optional<ContentItem> draft3 = itemRepo.findById(-10300L);
final Optional<ContentItem> draft4 = itemRepo.findById(-10400L);
assertThat(itemManager.getLiveVersion(draft1.get(), final Optional<ContentItem> live2 = itemRepo.findById(-99200L);
ContentItem.class).isPresent(),
is(false));
final Optional<Article> liveVersion = itemManager.getLiveVersion(
draft2.get(), Article.class);
assertThat(liveVersion.isPresent(),
is(true));
assertThat(liveVersion.get().getObjectId(),
is(-99200L));
assertThat(liveVersion.get().getItemUuid(),
is(equalTo("acae860f-2ffa-450d-b486-054292f0dae6")));
assertThat(liveVersion.get().getVersion(),
is(ContentItemVersion.LIVE));
assertThat(itemManager.getLiveVersion(draft3.get(),
ContentItem.class).isPresent(),
is(false));
assertThat(itemManager.getLiveVersion(draft4.get(),
ContentItem.class).isPresent(),
is(false));
final Optional<ContentItem> fromLive = itemManager.getLiveVersion( assertThat(itemManager.getLiveVersion(draft1.get(),
live2.get(), ContentItem.class); ContentItem.class).isPresent(),
assertThat(fromLive.isPresent(), is(false));
is(true)); final Optional<Article> liveVersion = itemManager.getLiveVersion(
assertThat(fromLive.get().getObjectId(), draft2.get(), Article.class);
is(-99200L)); assertThat(liveVersion.isPresent(),
assertThat(fromLive.get().getItemUuid(), is(true));
is(equalTo("acae860f-2ffa-450d-b486-054292f0dae6"))); assertThat(liveVersion.get().getObjectId(),
assertThat(fromLive.get().getVersion(), is(-99200L));
is(ContentItemVersion.LIVE)); assertThat(liveVersion.get().getItemUuid(),
is(equalTo("acae860f-2ffa-450d-b486-054292f0dae6")));
assertThat(liveVersion.get().getVersion(),
is(ContentItemVersion.LIVE));
assertThat(itemManager.getLiveVersion(draft3.get(),
ContentItem.class).isPresent(),
is(false));
assertThat(itemManager.getLiveVersion(draft4.get(),
ContentItem.class).isPresent(),
is(false));
final Optional<ContentItem> fromLive = itemManager.getLiveVersion(
live2.get(), ContentItem.class);
assertThat(fromLive.isPresent(),
is(true));
assertThat(fromLive.get().getObjectId(),
is(-99200L));
assertThat(fromLive.get().getItemUuid(),
is(equalTo("acae860f-2ffa-450d-b486-054292f0dae6")));
assertThat(fromLive.get().getVersion(),
is(ContentItemVersion.LIVE));
});
} }
/** /**
@ -1183,36 +1260,42 @@ public class ContentItemManagerTest {
+ "ContentItemManagerTest/data.xml") + "ContentItemManagerTest/data.xml")
// getDraftVersion // getDraftVersion
public void getDraftVersion() { public void getDraftVersion() {
final Optional<ContentItem> draft1 = itemRepo.findById(-10100L);
final Optional<ContentItem> draft2 = itemRepo.findById(-10200L);
final Optional<ContentItem> draft3 = itemRepo.findById(-10300L);
final Optional<ContentItem> draft4 = itemRepo.findById(-10400L);
assertThat(itemManager.getDraftVersion(draft1.get(), shiro.getSystemUser().execute(() -> {
ContentItem.class).getObjectId(), final Optional<ContentItem> draft1 = itemRepo.findById(-10100L);
is(-10100L)); final Optional<ContentItem> draft2 = itemRepo.findById(-10200L);
assertThat(itemManager.getDraftVersion(draft2.get(), final Optional<ContentItem> draft3 = itemRepo.findById(-10300L);
ContentItem.class).getObjectId(), final Optional<ContentItem> draft4 = itemRepo.findById(-10400L);
is(-10200L));
assertThat(itemManager.getDraftVersion(draft3.get(),
ContentItem.class).getObjectId(),
is(-10300L));
assertThat(itemManager.getDraftVersion(draft4.get(),
ContentItem.class).getObjectId(),
is(-10400L));
final Optional<ContentItem> live2 = itemRepo.findById(-99200L); assertThat(itemManager.getDraftVersion(draft1.get(),
ContentItem.class)
.getObjectId(),
is(-10100L));
assertThat(itemManager.getDraftVersion(draft2.get(),
ContentItem.class)
.getObjectId(),
is(-10200L));
assertThat(itemManager.getDraftVersion(draft3.get(),
ContentItem.class)
.getObjectId(),
is(-10300L));
assertThat(itemManager.getDraftVersion(draft4.get(),
ContentItem.class)
.getObjectId(),
is(-10400L));
final ContentItem draftVersion = itemManager.getDraftVersion( final Optional<ContentItem> live2 = itemRepo.findById(-99200L);
live2.get(), ContentItem.class);
assertThat(draftVersion, is(not(nullValue()))); final ContentItem draftVersion = itemManager.getDraftVersion(
assertThat(draftVersion.getObjectId(), is(-10200L)); live2.get(), ContentItem.class);
assertThat(draftVersion.getItemUuid(),
is(equalTo("acae860f-2ffa-450d-b486-054292f0dae6")));
assertThat(draftVersion.getVersion(),
is(ContentItemVersion.DRAFT));
assertThat(draftVersion, is(not(nullValue())));
assertThat(draftVersion.getObjectId(), is(-10200L));
assertThat(draftVersion.getItemUuid(),
is(equalTo("acae860f-2ffa-450d-b486-054292f0dae6")));
assertThat(draftVersion.getVersion(),
is(ContentItemVersion.DRAFT));
});
} }
} }

View File

@ -206,12 +206,16 @@ public class ItemAttachmentManagerTest {
"uuid", "uuid",
"attachment_id"}) "attachment_id"})
public void attachNonSharedAsset() throws MimeTypeParseException { public void attachNonSharedAsset() throws MimeTypeParseException {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final Asset file = assetRepo.findById(-720L).get(); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.attachAsset(file, item.get().getAttachments().get(1)); final Asset file = assetRepo.findById(-720L).get();
attachmentManager.attachAsset(file, item.get().getAttachments().get(
1));
});
} }
/** /**
@ -231,13 +235,16 @@ public class ItemAttachmentManagerTest {
"uuid", "uuid",
"attachment_id"}) "attachment_id"})
public void attachSharedAsset() throws MimeTypeParseException { public void attachSharedAsset() throws MimeTypeParseException {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final Asset shared = assetRepo.findById(-610L).get(); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.attachAsset(shared, final Asset shared = assetRepo.findById(-610L).get();
item.get().getAttachments().get(1));
attachmentManager.attachAsset(shared,
item.get().getAttachments().get(1));
});
} }
/** /**
@ -253,13 +260,16 @@ public class ItemAttachmentManagerTest {
@ShouldMatchDataSet("datasets/org/librecms/contentsection/" @ShouldMatchDataSet("datasets/org/librecms/contentsection/"
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
public void attachAssetAlreadyAttached() { public void attachAssetAlreadyAttached() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final Asset shared = assetRepo.findById(-620L).get(); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.attachAsset(shared, final Asset shared = assetRepo.findById(-620L).get();
item.get().getAttachments().get(1));
attachmentManager.attachAsset(shared,
item.get().getAttachments().get(1));
});
} }
/** /**
@ -276,13 +286,16 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void attachAssetNull() { public void attachAssetNull() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final Asset asset = null; shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.attachAsset(asset, final Asset asset = null;
item.get().getAttachments().get(1));
attachmentManager.attachAsset(asset,
item.get().getAttachments().get(1));
});
} }
/** /**
@ -299,10 +312,13 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void attachAssetToListNull() { public void attachAssetToListNull() {
final AttachmentList list = null;
final Asset shared = assetRepo.findById(-610L).get();
attachmentManager.attachAsset(shared, list); shiro.getSystemUser().execute(() -> {
final AttachmentList list = null;
final Asset shared = assetRepo.findById(-610L).get();
attachmentManager.attachAsset(shared, list);
});
} }
/** /**
@ -319,15 +335,18 @@ public class ItemAttachmentManagerTest {
+ "after-unattach-shared.xml", + "after-unattach-shared.xml",
excludeColumns = {"timestamp"}) excludeColumns = {"timestamp"})
public void unattachSharedAsset() { public void unattachSharedAsset() {
final Asset asset = assetRepo.findById(-610L).get();
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(asset, is(not(nullValue()))); shiro.getSystemUser().execute(() -> {
assertThat(item.isPresent(), is(true)); final Asset asset = assetRepo.findById(-610L).get();
final Optional<ContentItem> item = itemRepo.findById(-510L);
final AttachmentList list = item.get().getAttachments().get(0); assertThat(asset, is(not(nullValue())));
assertThat(item.isPresent(), is(true));
attachmentManager.unattachAsset(asset, list); final AttachmentList list = item.get().getAttachments().get(0);
attachmentManager.unattachAsset(asset, list);
});
} }
/** /**
@ -346,15 +365,18 @@ public class ItemAttachmentManagerTest {
+ "after-unattach-nonshared.xml", + "after-unattach-nonshared.xml",
excludeColumns = {"timestamp"}) excludeColumns = {"timestamp"})
public void unattachNonSharedAsset() { public void unattachNonSharedAsset() {
final Asset asset = assetRepo.findById(-720L).get();
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(asset, is(not(nullValue()))); shiro.getSystemUser().execute(() -> {
assertThat(item.isPresent(), is(true)); final Asset asset = assetRepo.findById(-720L).get();
final Optional<ContentItem> item = itemRepo.findById(-510L);
final AttachmentList list = item.get().getAttachments().get(0); assertThat(asset, is(not(nullValue())));
assertThat(item.isPresent(), is(true));
attachmentManager.unattachAsset(asset, list); final AttachmentList list = item.get().getAttachments().get(0);
attachmentManager.unattachAsset(asset, list);
});
} }
/** /**
@ -370,15 +392,18 @@ public class ItemAttachmentManagerTest {
@ShouldMatchDataSet("datasets/org/librecms/contentsection/" @ShouldMatchDataSet("datasets/org/librecms/contentsection/"
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
public void unattachAssetNotAttached() { public void unattachAssetNotAttached() {
final Asset asset = assetRepo.findById(-720L).get();
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(asset, is(not(nullValue()))); shiro.getSystemUser().execute(() -> {
assertThat(item.isPresent(), is(true)); final Asset asset = assetRepo.findById(-720L).get();
final Optional<ContentItem> item = itemRepo.findById(-510L);
final AttachmentList list = item.get().getAttachments().get(1); assertThat(asset, is(not(nullValue())));
assertThat(item.isPresent(), is(true));
attachmentManager.unattachAsset(asset, list); final AttachmentList list = item.get().getAttachments().get(1);
attachmentManager.unattachAsset(asset, list);
});
} }
/** /**
@ -395,14 +420,17 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void unattachAssetNull() { public void unattachAssetNull() {
final Asset asset = null;
final Optional<ContentItem> item = itemRepo.findById(-510L); shiro.getSystemUser().execute(() -> {
assertThat(item.isPresent(), is(true)); final Asset asset = null;
final AttachmentList list = item.get().getAttachments().get(0); final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.unattachAsset(asset, list); final AttachmentList list = item.get().getAttachments().get(0);
attachmentManager.unattachAsset(asset, list);
});
} }
/** /**
@ -419,12 +447,15 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void unattachAssetFromListNull() { public void unattachAssetFromListNull() {
final Asset asset = assetRepo.findById(-720L).get();
assertThat(asset, is(not(nullValue())));
final AttachmentList list = null; shiro.getSystemUser().execute(() -> {
final Asset asset = assetRepo.findById(-720L).get();
assertThat(asset, is(not(nullValue())));
attachmentManager.unattachAsset(asset, list); final AttachmentList list = null;
attachmentManager.unattachAsset(asset, list);
});
} }
/** /**
@ -441,13 +472,16 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/after-move-up.xml", + "ItemAttachmentManagerTest/after-move-up.xml",
excludeColumns = {"timestamp"}) excludeColumns = {"timestamp"})
public void moveUp() { public void moveUp() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final AttachmentList list = item.get().getAttachments().get(0); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.moveUp(list.getAttachments().get(0).getAsset(), final AttachmentList list = item.get().getAttachments().get(0);
list);
attachmentManager.moveUp(list.getAttachments().get(0).getAsset(),
list);
});
} }
/** /**
@ -462,13 +496,16 @@ public class ItemAttachmentManagerTest {
@ShouldMatchDataSet("datasets/org/librecms/contentsection/" @ShouldMatchDataSet("datasets/org/librecms/contentsection/"
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
public void moveUpLast() { public void moveUpLast() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final AttachmentList list = item.get().getAttachments().get(0); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.moveUp(list.getAttachments().get(2).getAsset(), final AttachmentList list = item.get().getAttachments().get(0);
list);
attachmentManager.moveUp(list.getAttachments().get(2).getAsset(),
list);
});
} }
/** /**
@ -485,12 +522,15 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void moveUpNull() { public void moveUpNull() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final AttachmentList list = item.get().getAttachments().get(0); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.moveUp(null, list); final AttachmentList list = item.get().getAttachments().get(0);
attachmentManager.moveUp(null, list);
});
} }
/** /**
@ -507,12 +547,15 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void moveUpInListNull() { public void moveUpInListNull() {
final Asset asset = assetRepo.findById(-720L).get();
assertThat(asset, is(not(nullValue())));
final AttachmentList list = null; shiro.getSystemUser().execute(() -> {
final Asset asset = assetRepo.findById(-720L).get();
assertThat(asset, is(not(nullValue())));
attachmentManager.moveUp(asset, list); final AttachmentList list = null;
attachmentManager.moveUp(asset, list);
});
} }
/** /**
@ -529,13 +572,16 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/after-move-down.xml", + "ItemAttachmentManagerTest/after-move-down.xml",
excludeColumns = {"timestamp"}) excludeColumns = {"timestamp"})
public void moveDown() { public void moveDown() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final AttachmentList list = item.get().getAttachments().get(0); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.moveDown(list.getAttachments().get(2).getAsset(), final AttachmentList list = item.get().getAttachments().get(0);
list);
attachmentManager.moveDown(list.getAttachments().get(2).getAsset(),
list);
});
} }
/** /**
@ -550,13 +596,16 @@ public class ItemAttachmentManagerTest {
@ShouldMatchDataSet("datasets/org/librecms/contentsection/" @ShouldMatchDataSet("datasets/org/librecms/contentsection/"
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
public void moveDownFirst() { public void moveDownFirst() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final AttachmentList list = item.get().getAttachments().get(0); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.moveDown(list.getAttachments().get(0).getAsset(), final AttachmentList list = item.get().getAttachments().get(0);
list);
attachmentManager.moveDown(list.getAttachments().get(0).getAsset(),
list);
});
} }
/** /**
@ -573,12 +622,15 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void moveDownNull() { public void moveDownNull() {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
final AttachmentList list = item.get().getAttachments().get(0); shiro.getSystemUser().execute(() -> {
final Optional<ContentItem> item = itemRepo.findById(-510L);
assertThat(item.isPresent(), is(true));
attachmentManager.moveDown(null, list); final AttachmentList list = item.get().getAttachments().get(0);
attachmentManager.moveDown(null, list);
});
} }
/** /**
@ -595,12 +647,15 @@ public class ItemAttachmentManagerTest {
+ "ItemAttachmentManagerTest/data.xml") + "ItemAttachmentManagerTest/data.xml")
@ShouldThrowException(IllegalArgumentException.class) @ShouldThrowException(IllegalArgumentException.class)
public void moveDownInListNull() { public void moveDownInListNull() {
final Asset asset = assetRepo.findById(-720L).get();
assertThat(asset, is(not(nullValue())));
final AttachmentList list = null; shiro.getSystemUser().execute(() -> {
final Asset asset = assetRepo.findById(-720L).get();
assertThat(asset, is(not(nullValue())));
attachmentManager.moveDown(asset, list); final AttachmentList list = null;
attachmentManager.moveDown(asset, list);
});
} }
} }

View File

@ -12,7 +12,7 @@
active="false" /> active="false" />
<ccm_core.workflows workflow_id="-140" <ccm_core.workflows workflow_id="-140"
uuid="c6e317a1-88d5-48ab-8896-304d4c8d1f3e" uuid="c6e317a1-88d5-48ab-8896-304d4c8d1f3e"
active="false" /> active="true" />
<ccm_core.workflow_names workflow_id="-100" <ccm_core.workflow_names workflow_id="-100"
locale="en" locale="en"
@ -48,7 +48,7 @@
workflow_id="-110" /> workflow_id="-110" />
<ccm_core.workflow_tasks task_id="-140100" <ccm_core.workflow_tasks task_id="-140100"
uuid="438a742b-dc1f-42f4-8fb8-061fbed5b26b" uuid="438a742b-dc1f-42f4-8fb8-061fbed5b26b"
active="false" active="true"
workflow_id="-140" /> workflow_id="-140" />
<ccm_core.workflow_task_labels task_id="-100100" <ccm_core.workflow_task_labels task_id="-100100"
@ -728,6 +728,9 @@
<ccm_core.workflow_task_assignments task_assignment_id="-930" <ccm_core.workflow_task_assignments task_assignment_id="-930"
task_id="-110100" task_id="-110100"
role_id="-3200" /> role_id="-3200" />
<ccm_core.workflow_task_assignments task_assignment_id="-930930"
task_id="-140100"
role_id="-3200" />
<ccm_cms.content_section_roles role_id="-3100" <ccm_cms.content_section_roles role_id="-3100"
section_id="-1100" /> section_id="-1100" />

View File

@ -12,7 +12,7 @@
active="false" /> active="false" />
<ccm_core.workflows workflow_id="-140" <ccm_core.workflows workflow_id="-140"
uuid="c6e317a1-88d5-48ab-8896-304d4c8d1f3e" uuid="c6e317a1-88d5-48ab-8896-304d4c8d1f3e"
active="false" /> active="true" />
<ccm_core.workflow_names workflow_id="-100" <ccm_core.workflow_names workflow_id="-100"
locale="en" locale="en"
@ -31,10 +31,9 @@
<ccm_core.workflow_templates workflow_id="-110" /> <ccm_core.workflow_templates workflow_id="-110" />
<ccm_core.workflow_templates workflow_id="-120" /> <ccm_core.workflow_templates workflow_id="-120" />
<ccm_core.workflow_tasks task_id="-100100" <ccm_core.workflow_tasks task_id="-100100"
uuid="43db829c-7749-4ca9-8aba-241a9c2d00b3" uuid="43db829c-7749-4ca9-8aba-241a9c2d00b3"
active="false" active="false"
task_state="ENABLED"
workflow_id="-100" /> workflow_id="-100" />
<ccm_core.workflow_tasks task_id="-100200" <ccm_core.workflow_tasks task_id="-100200"
uuid="9d6112af-abde-42d6-9c9b-06bb0b245158" uuid="9d6112af-abde-42d6-9c9b-06bb0b245158"
@ -48,11 +47,12 @@
workflow_id="-110" /> workflow_id="-110" />
<ccm_core.workflow_tasks task_id="-140100" <ccm_core.workflow_tasks task_id="-140100"
uuid="75b64386-1df2-494a-bab8-2bab81f0ed45" uuid="75b64386-1df2-494a-bab8-2bab81f0ed45"
active="false" active="false"
task_state="ENABLED"
workflow_id="-140" /> workflow_id="-140" />
<ccm_core.workflow_tasks task_id="-140200" <ccm_core.workflow_tasks task_id="-140200"
uuid="0a68c843-71e3-4e97-9a77-9427f6220cb1" uuid="0a68c843-71e3-4e97-9a77-9427f6220cb1"
active="false" active="true"
workflow_id="-140" /> workflow_id="-140" />
<ccm_core.workflow_task_labels task_id="-100100" <ccm_core.workflow_task_labels task_id="-100100"
@ -741,6 +741,12 @@
<ccm_core.workflow_task_assignments task_assignment_id="-930" <ccm_core.workflow_task_assignments task_assignment_id="-930"
task_id="-110100" task_id="-110100"
role_id="-3200" /> role_id="-3200" />
<ccm_core.workflow_task_assignments task_assignment_id="-910910"
task_id="-140100"
role_id="-3200" />
<ccm_core.workflow_task_assignments task_assignment_id="-920920"
task_id="-140200"
role_id="-3300" />
<ccm_cms.content_section_roles role_id="-3100" <ccm_cms.content_section_roles role_id="-3100"
section_id="-1100" /> section_id="-1100" />