persistence cleanup
This commit is contained in:
+10
-1
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user