@@ -28,51 +28,49 @@ open class SchemaValidationTest(
2828
2929 @Test
3030 fun `validateSchema with City should return no errors` () {
31- val errors = orm.validateSchema(listOf ( City ::class .java) )
31+ val errors = orm.validateSchema(City ::class )
3232 errors.shouldBeEmpty()
3333 }
3434
3535 @Test
3636 fun `validateSchema with Owner should return no errors` () {
37- val errors = orm.validateSchema(listOf ( Owner ::class .java) )
37+ val errors = orm.validateSchema(Owner ::class )
3838 errors.shouldBeEmpty()
3939 }
4040
4141 @Test
4242 fun `validateSchema with Pet should return no errors` () {
43- val errors = orm.validateSchema(listOf ( Pet ::class .java) )
43+ val errors = orm.validateSchema(Pet ::class )
4444 errors.shouldBeEmpty()
4545 }
4646
4747 @Test
4848 fun `validateSchema with Vet should return no errors` () {
49- val errors = orm.validateSchema(listOf ( Vet ::class .java) )
49+ val errors = orm.validateSchema(Vet ::class )
5050 errors.shouldBeEmpty()
5151 }
5252
5353 @Test
5454 fun `validateSchema with PetType should return no errors` () {
55- val errors = orm.validateSchema(listOf ( PetType ::class .java) )
55+ val errors = orm.validateSchema(PetType ::class )
5656 errors.shouldBeEmpty()
5757 }
5858
5959 @Test
6060 fun `validateSchema with Visit should return no errors` () {
61- val errors = orm.validateSchema(listOf ( Visit ::class .java) )
61+ val errors = orm.validateSchema(Visit ::class )
6262 errors.shouldBeEmpty()
6363 }
6464
6565 @Test
6666 fun `validateSchema with multiple valid types should return no errors` () {
6767 val errors = orm.validateSchema(
68- listOf (
69- City ::class .java,
70- Owner ::class .java,
71- Pet ::class .java,
72- PetType ::class .java,
73- Vet ::class .java,
74- Visit ::class .java,
75- ),
68+ City ::class ,
69+ Owner ::class ,
70+ Pet ::class ,
71+ PetType ::class ,
72+ Vet ::class ,
73+ Visit ::class ,
7674 )
7775 errors.shouldBeEmpty()
7876 }
@@ -88,7 +86,7 @@ open class SchemaValidationTest(
8886
8987 @Test
9088 fun `validateSchema with nonexistent table entity should return errors` () {
91- val errors = orm.validateSchema(listOf ( NonExistentEntity ::class .java) )
89+ val errors = orm.validateSchema(NonExistentEntity ::class )
9290 errors.shouldNotBeEmpty()
9391 }
9492
@@ -102,7 +100,7 @@ open class SchemaValidationTest(
102100
103101 @Test
104102 fun `validateSchema with mismatched columns should return errors` () {
105- val errors = orm.validateSchema(listOf ( CityMismatch ::class .java) )
103+ val errors = orm.validateSchema(CityMismatch ::class )
106104 errors.shouldNotBeEmpty()
107105 }
108106
@@ -111,37 +109,24 @@ open class SchemaValidationTest(
111109 @Test
112110 fun `validateSchemaOrThrow with valid types should not throw` () {
113111 // Should complete without exception for valid entity types.
114- orm.validateSchemaOrThrow(listOf ( City ::class .java , Vet ::class .java) )
112+ orm.validateSchemaOrThrow(City ::class , Vet ::class )
115113 }
116114
117115 @Test
118116 fun `validateSchemaOrThrow with invalid type should throw PersistenceException` () {
119117 assertThrows<PersistenceException > {
120- orm.validateSchemaOrThrow(listOf ( NonExistentEntity ::class .java) )
118+ orm.validateSchemaOrThrow(NonExistentEntity ::class )
121119 }
122120 }
123121
124122 @Test
125123 fun `validateSchemaOrThrow with mixed valid and invalid types should throw` () {
126124 assertThrows<PersistenceException > {
127- orm.validateSchemaOrThrow(listOf ( City ::class .java , NonExistentEntity ::class .java) )
125+ orm.validateSchemaOrThrow(City ::class , NonExistentEntity ::class )
128126 }
129127 }
130128
131- // validateSchema with empty list
132-
133- @Test
134- fun `validateSchema with empty list should return no errors` () {
135- val errors = orm.validateSchema(emptyList())
136- errors.shouldBeEmpty()
137- }
138-
139- @Test
140- fun `validateSchemaOrThrow with empty list should not throw` () {
141- orm.validateSchemaOrThrow(emptyList())
142- }
143-
144- // validateSchema on connection-backed template
129+ // validateSchema with no args (zero varargs)
145130
146131 @Test
147132 fun `validateSchema on connection-backed template should throw PersistenceException` () {
@@ -168,12 +153,12 @@ open class SchemaValidationTest(
168153
169154 @Test
170155 fun `validateSchema with OwnerView projection should return no errors` () {
171- val errors = orm.validateSchema(listOf ( OwnerView ::class .java) )
156+ val errors = orm.validateSchema(OwnerView ::class )
172157 errors.shouldBeEmpty()
173158 }
174159
175160 @Test
176161 fun `validateSchemaOrThrow with OwnerView projection should not throw` () {
177- orm.validateSchemaOrThrow(listOf ( OwnerView ::class .java) )
162+ orm.validateSchemaOrThrow(OwnerView ::class )
178163 }
179164}
0 commit comments