CCM NG: Fixed failures in ContentTypeRepositoryTest
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@6004 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
5c25236994
commit
fed5ff35c7
|
|
@ -334,6 +334,7 @@ public class ContentTypeRepositoryTest {
|
|||
.addClass(org.libreccm.core.Resource.class)
|
||||
.addClass(org.libreccm.core.ResourceType.class)
|
||||
.addClass(org.libreccm.core.UnexpectedErrorException.class)
|
||||
.addClass(org.libreccm.imexport.Exportable.class)
|
||||
.addClass(org.libreccm.jpa.EntityManagerProducer.class)
|
||||
.addClass(org.libreccm.l10n.GlobalizationHelper.class)
|
||||
.addClass(org.libreccm.l10n.GlobalizedMessagesUtil.class)
|
||||
|
|
@ -372,6 +373,7 @@ public class ContentTypeRepositoryTest {
|
|||
.addClass(org.libreccm.security.Permission.class)
|
||||
.addClass(org.libreccm.security.PermissionChecker.class)
|
||||
.addClass(org.libreccm.security.PermissionManager.class)
|
||||
.addClass(org.libreccm.security.PermissionRepository.class)
|
||||
.addClass(org.libreccm.security.RecursivePermissions.class)
|
||||
.addClass(org.libreccm.security.RegistrationManager.class)
|
||||
.addClass(org.libreccm.security.Relation.class)
|
||||
|
|
@ -454,7 +456,7 @@ public class ContentTypeRepositoryTest {
|
|||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void findByContentSection() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final List<ContentType> types = contentTypeRepo.findByContentSection(
|
||||
section);
|
||||
|
||||
|
|
@ -497,7 +499,7 @@ public class ContentTypeRepositoryTest {
|
|||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void findByContentSectionAndClass() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class);
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
|
|
@ -548,7 +550,7 @@ public class ContentTypeRepositoryTest {
|
|||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void findByContentSectionAndClassNull() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final Class<? extends ContentItem> type = null;
|
||||
contentTypeRepo.findByContentSectionAndClass(section, type);
|
||||
}
|
||||
|
|
@ -563,7 +565,7 @@ public class ContentTypeRepositoryTest {
|
|||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void findByContentSectionAndClassName() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class.getName());
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
|
|
@ -616,7 +618,7 @@ public class ContentTypeRepositoryTest {
|
|||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void findByContentSectionAndClassNameNull() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final String type = null;
|
||||
contentTypeRepo.findByContentSectionAndClass(section, type);
|
||||
}
|
||||
|
|
@ -630,7 +632,7 @@ public class ContentTypeRepositoryTest {
|
|||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void verifyIsContentTypeInUse() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class);
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
|
|
@ -655,7 +657,7 @@ public class ContentTypeRepositoryTest {
|
|||
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/after-delete.xml")
|
||||
public void deleteUnusedContentType() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, News.class);
|
||||
assertThat(newsType.isPresent(), is(true));
|
||||
|
|
@ -676,7 +678,7 @@ public class ContentTypeRepositoryTest {
|
|||
@ShouldThrowException(UnauthorizedException.class)
|
||||
public void deleteUnusedContentTypeUnauthorized() {
|
||||
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, News.class);
|
||||
assertThat(newsType.isPresent(), is(true));
|
||||
|
|
@ -696,7 +698,7 @@ public class ContentTypeRepositoryTest {
|
|||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void deleteContentTypeInUse() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L).get();
|
||||
final ContentSection section = contentSectionRepo.findById(1001L).get();
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class);
|
||||
assertThat(articleType.isPresent(), is(true));
|
||||
|
|
|
|||
Loading…
Reference in New Issue