use of com.worksmobile.Assignment.Domain.BoardHistoryDTO in project Assignment by WMPeople.
the class VersionManagementTest method testCreateTempArticle.
@Test
public void testCreateTempArticle() throws IOException {
BoardDTO tempArticle = new BoardDTO();
tempArticle.setSubject("임시저장중...");
tempArticle.setContent("temp article content");
tempArticle.setBoard_id(defaultCreatedDTO.getBoard_id());
versionManagementService.createTempArticleOverwrite(tempArticle);
BoardDTO dbTempArticle = boardMapper.viewDetail(new NodePtrDTO(tempArticle.getBoard_id(), 0).toMap());
Utils.assertConvertToJsonObject(tempArticle.toMap(), dbTempArticle.toMap());
Utils.assertConvertToJsonObject(tempArticle, dbTempArticle);
BoardHistoryDTO dbTempHistoryDTO = boardHistoryMapper.getHistory(tempArticle);
Utils.assertConvertToJsonObject(tempArticle.toMap(), dbTempHistoryDTO.toMap());
assertEquals(tempArticle.getSubject(), dbTempHistoryDTO.getHistory_subject());
String decompressedContent = Compress.deCompress(dbTempHistoryDTO.getHistory_content());
assertEquals(tempArticle.getContent(), decompressedContent);
}
use of com.worksmobile.Assignment.Domain.BoardHistoryDTO in project Assignment by WMPeople.
the class VersionManagementTest method testDeleteLeapNode.
@Test
public void testDeleteLeapNode() throws JsonProcessingException {
NodePtrDTO rootPtrDTO = defaultCreatedDTO;
NodePtrDTO deletePtrDTO = makeChild(rootPtrDTO);
versionManagementService.deleteVersion(deletePtrDTO);
List<BoardHistoryDTO> children = boardHistoryMapper.getChildren(rootPtrDTO);
assertEquals(0, children.size());
}
Aggregations