Skip to content

Commit c453a3c

Browse files
committed
Fix checkstyle warnings
1 parent e6fe607 commit c453a3c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/java/com/codesungrape/hmcts/bookapi/BookServiceTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)