From 527d3c309fbbbdec260a1a55020e41203c61a8dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Fri, 12 Jan 2024 11:04:18 +0900 Subject: [PATCH] =?UTF-8?q?getDocumentDetailById=E3=81=AE=E3=82=B9?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/data/impl/LacertaLibraryStubImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java index 1223387d..b8f2ed5c 100644 --- a/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java +++ b/data/src/main/java/one/nem/lacerta/data/impl/LacertaLibraryStubImpl.java @@ -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); } }