File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/test/java/com/codesungrape/hmcts/bookapi Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,9 @@ void testCreateBook_Success() {
144144 // Act
145145 Book result = testBookService .createBook (specialRequest );
146146
147+ // Assert: Verify the Service fulfills its return contract
148+ assertEquals (expectedBook , result , "Service must return the object returned by the repository" );
149+
147150 // Assert: capture the Book passed to save()
148151 ArgumentCaptor <Book > bookCaptor = ArgumentCaptor .forClass (Book .class );
149152 verify (testBookRepository , times (1 )).save (bookCaptor .capture ());
@@ -156,12 +159,8 @@ void testCreateBook_Success() {
156159 assertEquals (specialRequest .synopsis (), savedBook .getSynopsis ());
157160 assertEquals (specialRequest .author (), savedBook .getAuthor ());
158161
159- // Assert: Verify the Service fulfills its return contract
160- assertEquals (expectedBook , result , "Service must return the object returned by the repository" );
161-
162162 }
163163
164-
165164 @ Test
166165 void testCreateBook_NullRequest_ThrowsException () {
167166 // Act & Assert
You can’t perform that action at this time.
0 commit comments