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; 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 documentMeta = new DocumentMeta();
documentMeta.setId(id); documentMeta.setId(id);
documentMeta.setTitle("FakeDocument" + faker.book().title()); documentMeta.setTitle("FakeDocument" + faker.book().title());
@ -161,7 +166,7 @@ public class LacertaLibraryStubImpl implements LacertaLibrary {
} }
@Override @Override
public DocumentDetail getDocumentDetailById(String id) { public DocumentDetail getDocumentDetailById(String id) throws IllegalArgumentException {
return null; return generateStubDocumentDetail(id);
} }
} }