Skip to content

Commit

Permalink
HHH-11452 Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Naros committed Dec 16, 2021
1 parent e50037e commit 057b9bf
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
*/
public class AuditFunctionQueryTest extends BaseEnversJPAFunctionalTestCase {

@Entity
@Entity(name = "TestEntity")
@Audited
public static class TestEntity {

@Id
private Long id;
private String string1;
private String string2;
private Integer int1;
private Integer integer1;

public Long getId() {
return id;
Expand All @@ -54,12 +54,12 @@ public String getString2() {
return string2;
}

public Integer getInt1() {
return int1;
public Integer getInteger1() {
return integer1;
}

public void setInt1(Integer int1) {
this.int1 = int1;
public void setInteger1(Integer integer1) {
this.integer1 = integer1;
}

public void setString2(String string2) {
Expand All @@ -84,7 +84,7 @@ public void initData() {
testEntity1.setId( 1L );
testEntity1.setString1( "abcdef" );
testEntity1.setString2( "42 - the truth" );
testEntity1.setInt1( 42 );
testEntity1.setInteger1(42 );
em.persist( testEntity1 );
em.getTransaction().commit();
}
Expand Down Expand Up @@ -130,7 +130,7 @@ public void testComparisonFunctionWithValue() {
@Test
public void testComparionFunctionWithProperty() {
TestEntity entity = (TestEntity) getAuditReader().createQuery().forEntitiesAtRevision( TestEntity.class, 1 )
.add( AuditEntity.function( "length", AuditEntity.property( "string2" ) ).ltProperty( "int1" ) ).getSingleResult();
.add( AuditEntity.function( "length", AuditEntity.property( "string2" ) ).ltProperty( "integer1" ) ).getSingleResult();
assertNotNull( "Expected the entity to be returned", entity );
assertEquals( "Expected the entity to be returned", testEntity1.getId(), entity.getId() );
}
Expand All @@ -139,7 +139,7 @@ public void testComparionFunctionWithProperty() {
public void testComparisonFunctionWithFunction() {
TestEntity entity = (TestEntity) getAuditReader().createQuery().forEntitiesAtRevision( TestEntity.class, 1 )
.add( AuditEntity.function( "substring", AuditEntity.property( "string2" ), 1, 2 )
.eqFunction( AuditEntity.function( "str", AuditEntity.property( "int1" ) ) ) )
.eqFunction( AuditEntity.function( "str", AuditEntity.property( "integer1" ) ) ) )
.getSingleResult();
assertNotNull( "Expected the entity to be returned", entity );
assertEquals( "Expected the entity to be returned", testEntity1.getId(), entity.getId() );
Expand All @@ -148,7 +148,7 @@ public void testComparisonFunctionWithFunction() {
@Test
public void testComparisonPropertyWithFunction() {
TestEntity entity = (TestEntity) getAuditReader().createQuery().forEntitiesAtRevision( TestEntity.class, 1 )
.add( AuditEntity.property( "int1" ).gtFunction( AuditEntity.function( "length", AuditEntity.property( "string2" ) ) ) ).getSingleResult();
.add( AuditEntity.property( "integer1" ).gtFunction( AuditEntity.function( "length", AuditEntity.property( "string2" ) ) ) ).getSingleResult();
assertNotNull( "Expected the entity to be returned", entity );
assertEquals( "Expected the entity to be returned", testEntity1.getId(), entity.getId() );
}
Expand Down

0 comments on commit 057b9bf

Please sign in to comment.