Skip to content

Commit

Permalink
Merge branch 'release/0.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mtakaki committed Jul 12, 2016
2 parents 4e08b95 + 526a8d2 commit 32f2eb5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Expand Up @@ -3,7 +3,7 @@

<groupId>com.github.mtakaki</groupId>
<artifactId>dropwizard-hibernate-test-util</artifactId>
<version>0.0.2-SNAPSHOT</version>
<version>0.0.2</version>
<packaging>jar</packaging>

<name>Dropwizard hibernate test util</name>
Expand Down Expand Up @@ -227,6 +227,12 @@
</execution>
</executions>
</plugin>
<!-- Gitflow plugin -->
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m5.1</version>
</plugin>
</plugins>
</build>
<reporting>
Expand Down
Expand Up @@ -50,7 +50,6 @@ public HibernateDAOTestUtil(final Class<?>... entities) {

this.entitiesClass = Arrays.asList(entities);
this.setupLogger();
this.setupSessionAndTransaction();
}

/**
Expand Down Expand Up @@ -129,6 +128,7 @@ public void closeSessionAndDropSchema() {

@Override
public Statement apply(final Statement base, final Description description) {
this.setupSessionAndTransaction();
return new Statement() {
@Override
public void evaluate() throws Throwable {
Expand Down
Expand Up @@ -32,4 +32,14 @@ public void testSaveAndQuery() {
final Optional<TestEntity> foundEntityOptional = this.dao.findById(entity.getId());
assertThat(foundEntityOptional).isPresent().contains(entity);
}

/**
* Testing that we can't find an entity with an invalid id. It also makes
* sure we have multiple tests.
*/
@Test
public void testQueryNotFound() {
final Optional<TestEntity> foundEntityOptional = this.dao.findById(1);
assertThat(foundEntityOptional).isAbsent();
}
}

0 comments on commit 32f2eb5

Please sign in to comment.