use of com.enonic.xp.schema.content.GetContentTypeParams in project xp by enonic.
the class CreateContentHandlerTest method createContentAlreadyExists.
@Test
public void createContentAlreadyExists() throws Exception {
final Exception alreadyExistException = new ContentAlreadyExistsException(ContentPath.from("/a/b/mycontent"), RepositoryId.from("some.repo"), Branch.from("draft"));
when(this.contentService.create(any(CreateContentParams.class))).thenThrow(alreadyExistException);
final ContentType contentType = ContentType.create().name("test:myContentType").superType(ContentTypeName.structured()).build();
GetContentTypeParams getContentType = GetContentTypeParams.from(ContentTypeName.from("test:myContentType"));
when(this.contentTypeService.getByName(Mockito.eq(getContentType))).thenReturn(contentType);
runFunction("/test/CreateContentHandlerTest.js", "createContentNameAlreadyExists");
}
Aggregations