Skip to content

Commit

Permalink
Book view read model
Browse files Browse the repository at this point in the history
  • Loading branch information
bslota committed Oct 20, 2019
1 parent 1ddfff4 commit 9999e8b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ public class PlacingOnHoldTest {

private BookRepository bookRepository = new InMemoryBookRepository();
private PlacingOnHold placingOnHold = new PlacingOnHold(bookRepository);
private PatronId patronId = somePatronId();

@Test
public void shouldPlaceOnHoldAvailableBook() {
//given
AvailableBook availableBook = someExistingAvailableBook();

//and
PatronId patronId = somePatronId();

//when
placingOnHold.placeOnHold(new PlaceOnHoldCommand(availableBook.id(), patronId));

Expand All @@ -39,9 +37,6 @@ public void bookPlacedOnHoldShouldHaveSameAttributesAsAvailableOne() {
//given
AvailableBook availableBook = someExistingAvailableBook();

//and
PatronId patronId = somePatronId();

//when
placingOnHold.placeOnHold(new PlaceOnHoldCommand(availableBook.id(), patronId));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class BookAPITest {
@Autowired
private BookRepositoryFixture bookRepositoryFixture;

private PatronId patronId = somePatronId();

@Test
public void shouldNotFindAnyBook() throws Exception {
//given
Expand Down Expand Up @@ -70,9 +72,6 @@ public void shouldReturnNoContentWhenPlacingAvailableBookOnHold() throws Excepti
//given
AvailableBook availableBook = bookRepositoryFixture.availableBookInTheSystem();

//and
PatronId patronId = somePatronId();

//when
ResultActions resultActions = sendPlaceOnHoldCommandFor(availableBook.id(), patronId);

Expand All @@ -85,9 +84,6 @@ public void shouldReturnBookOnHoldAfterItIsPlacedOnHold() throws Exception {
//given
AvailableBook availableBook = bookRepositoryFixture.availableBookInTheSystem();

//and
PatronId patronId = somePatronId();

//and
sendPlaceOnHoldCommandFor(availableBook.id(), patronId);

Expand Down

0 comments on commit 9999e8b

Please sign in to comment.