@@ -0,0 +1,1300 @@
+package cane.brothers.circus;%0A%0Aimport static org.junit.Assert.assertThat;%0A%0Aimport java.util.List;%0A%0Aimport javax.annotation.Resource;%0A%0Aimport org.hamcrest.CoreMatchers;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0Aimport cane.brothers.circus.domain.CircusRow;%0Aimport cane.brothers.circus.repository.CircusRowRepository;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(classes = JpaConfig.class)%0Apublic class TestRowRepo %7B%0A%0A%09@Resource%0A%09private CircusRowRepository rowRepo;%0A%09%0A%09@Test%0A%09public void testGetRowById() %7B%0A%09%09CircusRow row = rowRepo.findOne(1L);%0A%09%09assertThat(row, CoreMatchers.notNullValue());%0A%09%09assertThat(row.getCapacity(), CoreMatchers.is(29));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testGetRowSize() %7B%0A%09%09List%3CCircusRow%3E rows = rowRepo.findAll();%0A%09%09assertThat(rows, CoreMatchers.notNullValue());%0A%09%09assertThat(rows.size(), CoreMatchers.is(42));%0A%09%7D%0A%09%0A%09@Test%0A%09public void testGetFullRowCapacity() %7B%0A%09%09List%3CCircusRow%3E rows = rowRepo.findAll();%0A%09%09int c = 0;%0A%09%09assertThat(rows, CoreMatchers.notNullValue());%0A%09%09for(CircusRow r: rows) %7B%0A%09%09%09c += r.getCapacity();%0A%09%09%7D%0A%09%09//assertThat(c, CoreMatchers.is(2400));%0A%09%09assertThat(c, CoreMatchers.is(2075));%0A%09%7D%0A%7D%0A

add row repo test