@Test public void testRead() throws Exception { Soccer_records team = new Soccer_records("A", "17", 8, 9, 2); Soccer_records returnObject = crudService.find(team.getAgeGroup()); when(crudService.find(team.getAgeGroup())).thenReturn(returnObject); Mockito.verify(crudService).find(team.getAgeGroup()); }
@Test public void testCreate() throws Exception { Soccer_records team = new Soccer_records("A", "17", 8, 9, 2); Soccer_records returnObject = crudService.persist(team); when(crudService.persist(team)).thenReturn(returnObject); Mockito.verify(crudService).persist(team); Assert.assertEquals("17", team.getAgeGroup(), "Name was changed"); Assert.assertEquals(team.getDivision(), "A", "The name update didnt run"); }