Skip to content

Commit c3a25c0

Browse files
committed
HHH-19846 - Remove JUnit4: org.hibernate.engine.jdbc.env.internal
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 36213be commit c3a25c0

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

hibernate-core/src/test/java/org/hibernate/engine/jdbc/env/internal/SkipLoadingSequenceInformationTest.java

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,32 @@
1111

1212
import org.hibernate.annotations.GenericGenerator;
1313
import org.hibernate.cfg.AvailableSettings;
14-
import org.hibernate.cfg.Configuration;
1514
import org.hibernate.cfg.Environment;
1615
import org.hibernate.dialect.H2Dialect;
17-
import org.hibernate.id.SequenceMismatchStrategy;
16+
import org.hibernate.testing.orm.junit.DomainModel;
17+
import org.hibernate.testing.orm.junit.ServiceRegistry;
18+
import org.hibernate.testing.orm.junit.SessionFactory;
19+
import org.hibernate.testing.orm.junit.Setting;
20+
import org.hibernate.testing.orm.junit.SettingProvider;
1821
import org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor;
1922

20-
import org.hibernate.testing.RequiresDialect;
23+
import org.hibernate.testing.orm.junit.RequiresDialect;
2124
import org.hibernate.testing.orm.junit.JiraKey;
22-
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
23-
import org.junit.Test;
25+
import org.junit.jupiter.api.Test;
2426

2527
/**
2628
* Verifies that setting {@code AvailableSettings.SEQUENCE_INCREMENT_SIZE_MISMATCH_STRATEGY} to {@code none}
2729
* is going to skip loading the sequence information from the database.
2830
*/
2931
@RequiresDialect( H2Dialect.class )
3032
@JiraKey( value = "HHH-14667")
31-
public class SkipLoadingSequenceInformationTest extends BaseCoreFunctionalTestCase {
32-
33-
@Override
34-
protected void configure(Configuration configuration) {
35-
configuration.setProperty( AvailableSettings.SEQUENCE_INCREMENT_SIZE_MISMATCH_STRATEGY, SequenceMismatchStrategy.NONE );
36-
configuration.setProperty( Environment.DIALECT, VetoingDialect.class );
37-
}
33+
@DomainModel(annotatedClasses = {SkipLoadingSequenceInformationTest.SequencingEntity.class})
34+
@SessionFactory
35+
@ServiceRegistry(
36+
settings = { @Setting( name = AvailableSettings.SEQUENCE_INCREMENT_SIZE_MISMATCH_STRATEGY, value = "NONE") },
37+
settingProviders = { @SettingProvider( settingName = Environment.DIALECT, provider = SkipLoadingSequenceInformationTest.VetoingDialectClassProvider.class) }
38+
)
39+
public class SkipLoadingSequenceInformationTest {
3840

3941
@Entity(name="seqentity")
4042
static class SequencingEntity {
@@ -51,11 +53,6 @@ static class SequencingEntity {
5153
String name;
5254
}
5355

54-
@Override
55-
protected Class<?>[] getAnnotatedClasses() {
56-
return new Class[]{SequencingEntity.class};
57-
}
58-
5956
@Test
6057
public void test() {
6158
// If it's able to boot, we're good.
@@ -68,4 +65,11 @@ public SequenceInformationExtractor getSequenceInformationExtractor() {
6865
}
6966
}
7067

68+
public static class VetoingDialectClassProvider implements SettingProvider.Provider<Class<?>> {
69+
@Override
70+
public Class<?> getSetting() {
71+
return VetoingDialect.class;
72+
}
73+
}
74+
7175
}

0 commit comments

Comments
 (0)