@@ -0,0 +1,1604 @@
+package com.pm.server.repository;%0A%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0A%0Aimport com.pm.server.TestTemplate;%0Aimport com.pm.server.datatype.Coordinate;%0Aimport com.pm.server.datatype.CoordinateImpl;%0Aimport com.pm.server.player.Pacman;%0Aimport com.pm.server.player.PacmanImpl;%0A%0Apublic class PacmanRepositoryTest extends TestTemplate %7B%0A%0A%09private List%3CPacman%3E pacmanList = new ArrayList%3CPacman%3E();%0A%0A%09private final static Integer numOfPacmans = 2;%0A%0A%09@Autowired%0A%09private PacmanRepository pacmanRepository;%0A%0A%09private static final Logger log =%0A%09%09%09LogManager.getLogger(PacmanRepositoryTest.class.getName());%0A%0A%09@Before%0A%09public void setUp() %7B%0A%0A%09%09for(Integer i = 0; i %3C numOfPacmans; i++) %7B%0A%0A%09%09%09// Arbitrary decimal values%0A%09%09%09Coordinate coordinate = new CoordinateImpl(%0A%09%09%09%09%09(i+12345.6789) / 100,%0A%09%09%09%09%09(i-9876.54321) / 100%0A%09%09%09);%0A%0A%09%09%09Pacman pacman = new PacmanImpl();%0A%09%09%09pacman.setId(i);%0A%09%09%09pacman.setLocation(coordinate);%0A%0A%09%09%09pacmanList.add(pacman);%0A%0A%09%09%7D%0A%09%09assert(pacmanList.size() == numOfPacmans);%0A%0A%09%7D%0A%0A%09@After%0A%09public void cleanUp() %7B%0A%09%09%0A%09%09pacmanRepository.clearPlayers();%0A%09%09assert(pacmanRepository.getPlayer() == null);%0A%0A%09%09pacmanList.clear();%0A%09%09assert(pacmanList.size() == 0);%0A%0A%09%7D%0A%0A%09private void addPlayer_failUponException(Pacman pacman) %7B%0A%09%09try %7B%0A%09%09%09pacmanRepository.addPlayer(pacman);%0A%09%09%7D%0A%09%09catch (Exception e) %7B%0A%09%09%09log.error(e.getMessage());%0A%09%09%09fail();%0A%09%09%7D%0A%09%7D%0A%0A%7D

Add test setup and cleanup for PacmanRepo