Checkpoint: Added test to ExchangeRepo

Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2021-01-11 16:21:25 +01:00
parent 5e459ac429
commit 76faedc40d
Signed by: y0rune
GPG Key ID: F204C385F57EB348
2 changed files with 49 additions and 43 deletions

View File

@ -21,4 +21,6 @@ public interface ExchangeRepository extends JpaRepository<Exchange, Long>{
@Query("FROM Exchange WHERE ownerId = ?1")
List<Exchange> getByUserId(@Param("id") Long id);
@Query("Select e1,e2 FROM Exchange e1, Exchange e2 WHERE e1.ownedAssignment.group.id = e2.desiredAssignment.id")
List<Object[]> getMatches();
}

View File

@ -56,4 +56,8 @@ public class ExchangeService {
public Optional<Exchange> checkForExchange(Assignment assignment, Groups group) {
return this.repo.checkForExchange(assignment, group);
}
public void performExchange() {
}
}