use of com.enonic.xp.content.ContentVersionId in project xp by enonic.
the class GetContentHandlerTest method getByPathAndVersionId_NotFound.
@Test
public void getByPathAndVersionId_NotFound() {
final ContentPath path = ContentPath.from("/a/b/mycontent");
final ContentVersionId versionId = ContentVersionId.from("versionId");
Mockito.when(this.contentService.getByPathAndVersionId(path, versionId)).thenThrow(new ContentNotFoundException(path, versionId, ContextAccessor.current().getBranch()));
runFunction("/test/GetContentHandlerTest.js", "getByPathAndVersionId_notFound");
}
use of com.enonic.xp.content.ContentVersionId in project xp by enonic.
the class GetContentHandlerTest method getByPathAndVersionId.
@Test
public void getByPathAndVersionId() {
final Content content = TestDataFixtures.newExampleContent();
final ContentPath path = ContentPath.from("/a/b/mycontent");
final ContentVersionId versionId = ContentVersionId.from("versionId");
Mockito.when(this.contentService.getByPathAndVersionId(path, versionId)).thenReturn(content);
runFunction("/test/GetContentHandlerTest.js", "getByPathAndVersionId");
}
use of com.enonic.xp.content.ContentVersionId in project xp by enonic.
the class GetContentHandlerTest method getByIdAndVersionId_NotFound.
@Test
public void getByIdAndVersionId_NotFound() {
final ContentId contentId = ContentId.from("mycontentId");
final ContentVersionId versionId = ContentVersionId.from("versionId");
Mockito.when(this.contentService.getByIdAndVersionId(contentId, versionId)).thenThrow(new ContentNotFoundException(contentId, versionId, ContextAccessor.current().getBranch()));
runFunction("/test/GetContentHandlerTest.js", "getByIdAndVersionId_notFound");
}
use of com.enonic.xp.content.ContentVersionId in project xp by enonic.
the class GetContentHandlerTest method getByIdAndVersionId.
@Test
public void getByIdAndVersionId() {
final Content content = TestDataFixtures.newExampleContent();
final ContentId contentId = ContentId.from("mycontentId");
final ContentVersionId versionId = ContentVersionId.from("versionId");
Mockito.when(this.contentService.getByIdAndVersionId(contentId, versionId)).thenReturn(content);
runFunction("/test/GetContentHandlerTest.js", "getByIdAndVersionId");
}
Aggregations