From 4bb52196f14662b76dad7a29715ab1474b3e101a Mon Sep 17 00:00:00 2001 From: Brett Meyer Date: Mon, 10 Feb 2014 16:24:37 -0500 Subject: [PATCH] HHH-7205 test assertion --- .../test/annotations/loader/LoaderTest.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hibernate-core/src/test/java/org/hibernate/test/annotations/loader/LoaderTest.java b/hibernate-core/src/test/java/org/hibernate/test/annotations/loader/LoaderTest.java index e605a991a4..3f5cd75e6c 100755 --- a/hibernate-core/src/test/java/org/hibernate/test/annotations/loader/LoaderTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/annotations/loader/LoaderTest.java @@ -23,16 +23,17 @@ */ package org.hibernate.test.annotations.loader; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + import java.util.Iterator; import java.util.Set; -import org.junit.Test; - +import org.hibernate.ObjectNotFoundException; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; - -import static org.junit.Assert.assertEquals; +import org.junit.Test; /** * @author Emmanuel Bernard @@ -93,10 +94,13 @@ public class LoaderTest extends BaseCoreFunctionalTestCase { Session s = openSession(); try { - long notExistingId = 3l; + long notExistingId = 1l; s.load( Team.class, notExistingId ); s.get( Team.class, notExistingId ); } + catch (ObjectNotFoundException e) { + fail("#get threw an ObjectNotFoundExcepton"); + } finally { s.close(); }