diff --git a/hibernate-core/src/test/java/org/hibernate/test/dialect/unit/lockhint/MySQLStorageEngineTest.java b/hibernate-core/src/test/java/org/hibernate/test/dialect/unit/lockhint/MySQLStorageEngineTest.java index d8aef9bf8e..d1249b86c1 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/dialect/unit/lockhint/MySQLStorageEngineTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/dialect/unit/lockhint/MySQLStorageEngineTest.java @@ -12,7 +12,10 @@ import org.hibernate.dialect.MySQL57Dialect; import org.hibernate.testing.junit4.BaseUnitTestCase; import org.junit.Test; +import static org.hamcrest.CoreMatchers.nullValue; +import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; /** * @author Vlad Mihalcea @@ -21,19 +24,23 @@ public class MySQLStorageEngineTest extends BaseUnitTestCase { @Test public void testDefaultStorage() { - assertEquals(" engine=InnoDB", new MySQL57Dialect().getTableTypeString()); + assertEquals( " engine=InnoDB", new MySQL57Dialect().getTableTypeString() ); } @Test public void testOverrideStorage() { String previousValue = System.setProperty( AvailableSettings.STORAGE_ENGINE, "myisam" ); - try{ - assertEquals(" engine=MyISAM", new MySQL57Dialect().getTableTypeString()); + try { + assertEquals( " engine=MyISAM", new MySQL57Dialect().getTableTypeString() ); } finally { if ( previousValue != null ) { System.setProperty( AvailableSettings.STORAGE_ENGINE, previousValue ); } + else { + System.clearProperty( AvailableSettings.STORAGE_ENGINE ); + assertThat( System.getProperty( AvailableSettings.STORAGE_ENGINE ), is( nullValue() ) ); + } } } }