DocumentDetailを生成する内部メソッド作成

This commit is contained in:
ろむねこ 2024-01-12 11:02:50 +09:00
parent 3cd1f50f34
commit d2ebed3934
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -6,6 +6,8 @@ import one.nem.lacerta.model.ListItem;
import one.nem.lacerta.model.ListItemType; import one.nem.lacerta.model.ListItemType;
import one.nem.lacerta.model.document.DocumentDetail; import one.nem.lacerta.model.document.DocumentDetail;
import one.nem.lacerta.model.document.DocumentMeta;
import one.nem.lacerta.model.document.path.DocumentPath;
import one.nem.lacerta.utils.LacertaLogger; import one.nem.lacerta.utils.LacertaLogger;
import com.github.javafaker.Faker; import com.github.javafaker.Faker;
@ -113,6 +115,21 @@ public class LacertaLibraryStubImpl implements LacertaLibrary {
return libraryItemPage; return libraryItemPage;
} }
private DocumentDetail generateStubDocumentDetail() {
DocumentMeta documentMeta = new DocumentMeta();
documentMeta.setId(UUID.randomUUID().toString());
documentMeta.setTitle("FakeDocument" + faker.book().title());
documentMeta.setCreatedAt(faker.date().birthday());
documentMeta.setUpdatedAt(faker.date().birthday()); // TODO-rca: 更新日のほうが古くなることがあるのでなんとかする
ArrayList<String> tagIds = new ArrayList<>();
DocumentDetail documentDetail = new DocumentDetail();
documentDetail.setMeta(documentMeta);
documentDetail.setPath(null); // TODO-rca: なんとかする
documentDetail.setAuthor(faker.name().fullName());
documentDetail.setRepository(null); // TODO-rca: なんとかする
return documentDetail;
}
@Override @Override
public LibraryItemPage getRecentDocument(int limit) { public LibraryItemPage getRecentDocument(int limit) {
return getRecentDocumentPage(limit); return getRecentDocumentPage(limit);