@@ -0,0 +1,2636 @@
+package test.integration.haushaltsbuch;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertNotEquals;%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertTrue;%0Aimport java.math.BigDecimal;%0Aimport java.util.List;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport haushaltsbuch.Entry;%0Aimport haushaltsbuch.InsertException;%0Aimport haushaltsbuch.persistence.JdbcRepository;%0Aimport test.helpers.TestDatabase;%0Aimport test.helpers.TestEntry;%0A%0Apublic class RepositoryFindTest%0A%7B%0A  private JdbcRepository _subject;%0A  private TestDatabase _database;%0A  private TestEntry _testEntry;%0A%0A  @Before%0A  public void setUp() throws Exception%0A  %7B%0A    _database = new TestDatabase(%22jdbc:postgresql:///%22);%0A    _subject = new JdbcRepository(_database.getURL(), null, null);%0A    _testEntry = new TestEntry();%0A  %7D%0A%0A  @After%0A  public void tearDown() throws Exception%0A  %7B%0A    _subject.close();%0A    _database.tearDown();%0A  %7D%0A%0A  @Test%0A  public void testEmpty()%0A  %7B%0A    List%3CEntry%3E all = _subject.getAll();%0A%0A    assertNotNull(all);%0A    assertFalse(all.isEmpty());%0A    assertEquals(%22must only contain the opening statement%22, 1, all.size());%0A    assertEquals(BigDecimal.ZERO, all.get(0).getValue());%0A  %7D%0A%0A  @Test%0A  public void testFind() throws InsertException%0A  %7B%0A    String id = _subject.insert(_testEntry);%0A%0A    Entry found = _subject.find(id);%0A%0A    assertNotEquals(%22inserted and read-back entry are different entities%22, found, _testEntry);%0A    assertNotEquals(%22id of inserted entry is not updated%22, id, _testEntry.getId());%0A%0A    String found_id = found.getId();%0A%0A    assertNotNull(found_id);%0A    assertFalse(found_id.isEmpty());%0A    assertTrue(%22id must look like a GUID%22, found_id.matches(%22%5E%5Ba-z0-9%5D%7B8%7D-(%5Ba-z0-9%5D%7B4%7D-)%7B3%7D%5Ba-z0-9%5D%7B12%7D$%22));%0A%0A    assertNotEquals(_testEntry.getEntryDate(), found.getEntryDate());%0A%0A    assertEquals(%22the id we searched for must be the same as the entry's id%22, id, found_id);%0A    assertEquals(_testEntry.getCategory(), found.getCategory());%0A    assertEquals(_testEntry.getDescription(), found.getDescription());%0A    assertEquals(_testEntry.getPaymentType(), found.getPaymentType());%0A    assertEquals(_testEntry.getSrcDst(), found.getSrcDst());%0A    assertEquals(_testEntry.getValue(), found.getValue());%0A  %7D%0A%0A  @Test%0A  public void testNonEmpty() throws InsertException%0A  %7B%0A    _subject.insert(_testEntry);%0A    List%3CEntry%3E all = _subject.getAll();%0A%0A    assertEquals(%22must contain one more after the opening statement%22, 2, all.size());%0A    assertEquals(_testEntry.getValue(), all.get(1).getValue());%0A  %7D%0A%7D%0A

Add find tests