getDocumentDetailByIdのスタブを実装

This commit is contained in:
ろむねこ 2024-01-12 11:04:18 +09:00
parent f326771aaf
commit 527d3c309f
No known key found for this signature in database
GPG Key ID: FA1F39A1BA37D168

View File

@ -115,7 +115,12 @@ public class LacertaLibraryStubImpl implements LacertaLibrary {
return libraryItemPage;
}
private DocumentDetail generateStubDocumentDetail(String id) {
private DocumentDetail generateStubDocumentDetail(String id) throws IllegalArgumentException {
if (Objects.isNull(id)) {
throw new IllegalArgumentException("id is null");
}
DocumentMeta documentMeta = new DocumentMeta();
documentMeta.setId(id);
documentMeta.setTitle("FakeDocument" + faker.book().title());
@ -161,7 +166,7 @@ public class LacertaLibraryStubImpl implements LacertaLibrary {
}
@Override
public DocumentDetail getDocumentDetailById(String id) {
return null;
public DocumentDetail getDocumentDetailById(String id) throws IllegalArgumentException {
return generateStubDocumentDetail(id);
}
}