Skip to content

Commit

Permalink
task-repo-done
Browse files Browse the repository at this point in the history
  • Loading branch information
yacekmm committed Dec 6, 2024
1 parent 804cc63 commit beda3f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public <S extends E> Iterable<S> saveAll(Iterable<S> entities) {

@Override
public Optional<E> findById(ID id) {
//TODO implement
throw new RuntimeException("Not Implemented");
return Optional.ofNullable(database.get(id));
}

@Override
Expand All @@ -38,8 +37,7 @@ public boolean existsById(ID id) {

@Override
public Iterable<E> findAll() {
//TODO implement
throw new RuntimeException("Not Implemented");
return database.values();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Either<ErrorResult, Concert> createConcert(String title, String dateTime,
}
return concertFactory.createConcert(title, dateTime, promoterAgreement.promoterId())
.peek(concert -> concert.initNewConcert(tagService, categoryService))
//TODO: save in repo
.map(concertRepo::save)
.peek(concert -> eventPublisher.publish(concertCreated(concert, promoterAgreement.profitMarginPercentage())));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public static ConcertFixtures init(SharedFixtures sharedFixtures) {
}

private static void initInfrastructure(ConcertFixtures concertFixtures) {
//TODO initialize repo
concertFixtures.concertRepo = null;
concertFixtures.concertRepo = new InMemoryConcertRepo();
concertFixtures.categoryRepo = new InMemoryCategoryRepo();
concertFixtures.tagRepo = new InMemoryTagRepo();
}
Expand Down

0 comments on commit beda3f3

Please sign in to comment.