persistence cleanup

This commit is contained in:
eugenp
2014-01-25 15:28:38 +02:00
parent 0d5f88e206
commit 29f02a2a8b
4 changed files with 21 additions and 7 deletions
@@ -2,8 +2,9 @@ package org.baeldung.persistence.service;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import org.baeldung.config.PersistenceJPAConfig;
import org.baeldung.persistence.model.Foo;
import org.baeldung.spring.PersistenceJPAConfig;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
@@ -55,4 +56,12 @@ public class FooServicePersistenceIntegrationTest {
service.create(new Foo());
}
@Test
public final void whenEntityIsCreated_thenFound() {
final Foo fooEntity = new Foo("abc");
service.create(fooEntity);
final Foo found = service.findOne(fooEntity.getId());
Assert.assertNotNull(found);
}
}