Skip to content

Commit c777938

Browse files
committed
HHH-9675 - org.hibernate.envers.boot.internal.EnversIntegrator throws NPE in WF9
1 parent 00ed63f commit c777938

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
6+
*/
7+
package org.hibernate.envers.test.integrator;
8+
9+
import javax.persistence.Entity;
10+
import javax.persistence.Id;
11+
12+
import org.hibernate.cfg.Configuration;
13+
14+
import org.hibernate.testing.TestForIssue;
15+
import org.junit.Test;
16+
17+
/**
18+
* @author Steve Ebersole
19+
*/
20+
public class BasicIntegratorTest {
21+
/**
22+
* Tests that nothing crazy happens if the hibernate-envers jar happens
23+
* to be on the classpath but we have no audited entities
24+
*/
25+
@Test
26+
@TestForIssue( jiraKey = "HHH-9675" )
27+
public void testNoAudited() {
28+
new Configuration().buildSessionFactory().close();
29+
new Configuration().addAnnotatedClass( SimpleNonAuditedEntity.class ).buildSessionFactory().close();
30+
}
31+
32+
@Entity
33+
public static class SimpleNonAuditedEntity {
34+
private Integer id;
35+
36+
@Id
37+
public Integer getId() {
38+
return id;
39+
}
40+
41+
public void setId(Integer id) {
42+
this.id = id;
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)