Skip to content

Commit

Permalink
SMA-45: added test still work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
markpernia committed Feb 15, 2024
1 parent 938c60d commit 27f51aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public void addRating(RatingDTO ratingDTO, Authentication authentication) {
eventPlayer.setMyScore(ratingDTO.getMyScore());
eventPlayer.setOpponentScore(ratingDTO.getOpponentScore());

UserEventRating userEventRating = UserEventRating.builder()
UserEventRating userEventRating =
UserEventRating.builder()
.userRating(userRating)
.eventRating(eventRating)
.player(player)
Expand All @@ -47,7 +48,7 @@ public void addRating(RatingDTO ratingDTO, Authentication authentication) {
private EventPlayer getEventPlayer(User player) {
Optional<EventPlayer> eventPlayerOptional =
eventPlayerRepository.findEventPlayerByPlayer(player);
return eventPlayerOptional.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));
return eventPlayerOptional.orElseThrow(() -> new ResponseStatusException(HttpStatus.NOT_FOUND));
}

private User findOpponent(EventPlayer eventPlayer, User player) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.sportsmatch.service;
package com.sportsmatch.services;

import com.sportsmatch.dtos.SportDTO;
import com.sportsmatch.models.Sport;
import com.sportsmatch.repositories.SportRepository;
import com.sportsmatch.services.SportServiceImp;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
Expand Down

0 comments on commit 27f51aa

Please sign in to comment.