@@ -38,7 +38,7 @@ class TypeInferenceTest : ShouldSpec({
3838 data class Test2 <T >(val vala2: T , val para2: Pair <T , String >)
3939 data class Test <T >(val vala: T , val tripl1: Triple <T , Test2 <Long >, T >)
4040
41- val struct = Struct .fromJson(schema(typeOf <Pair <String , Test <Int >>>()).prettyJson())!!
41+ val struct = Struct .fromJson(kotlinEncoderFor <Pair <String , Test <Int >>>().schema( ).prettyJson())!!
4242 should("contain correct typings") {
4343 expect(struct.fields).notToEqualNull().toContain.inAnyOrder.only.entries(
4444 hasField("first", "string"),
@@ -68,7 +68,7 @@ class TypeInferenceTest : ShouldSpec({
6868 data class Test2 <T >(val vala2: T , val para2: Pair <T , Single <Double >>)
6969 data class Test <T >(val vala: T , val tripl1: Triple <T , Test2 <Long >, T >)
7070
71- val struct = Struct .fromJson(schema(typeOf <Pair <String , Test <Int >>>()).prettyJson())!!
71+ val struct = Struct .fromJson(kotlinEncoderFor <Pair <String , Test <Int >>>().schema( ).prettyJson())!!
7272 should("contain correct typings") {
7373 expect(struct.fields).notToEqualNull().toContain.inAnyOrder.only.entries(
7474 hasField("first", "string"),
@@ -99,7 +99,7 @@ class TypeInferenceTest : ShouldSpec({
9999 context("org.jetbrains.spark.api.org.jetbrains.spark.api.schema without generics") {
100100 data class Test (val a: String , val b: Int , val c: Double )
101101
102- val struct = Struct .fromJson(schema(typeOf <Test >()).prettyJson())!!
102+ val struct = Struct .fromJson(kotlinEncoderFor <Test >().schema( ).prettyJson())!!
103103 should("return correct types too") {
104104 expect(struct.fields).notToEqualNull().toContain.inAnyOrder.only.entries(
105105 hasField("a", "string"),
@@ -109,7 +109,7 @@ class TypeInferenceTest : ShouldSpec({
109109 }
110110 }
111111 context("type with list of ints") {
112- val struct = Struct .fromJson(schema(typeOf <List <Int >>()).prettyJson())!!
112+ val struct = Struct .fromJson(kotlinEncoderFor <List <Int >>().schema( ).prettyJson())!!
113113 should("return correct types too") {
114114 expect(struct) {
115115 isOfType("array")
@@ -118,7 +118,7 @@ class TypeInferenceTest : ShouldSpec({
118118 }
119119 }
120120 context("type with list of Pairs int to long") {
121- val struct = Struct .fromJson(schema(typeOf <List <Pair <Int , Long >>>()).prettyJson())!!
121+ val struct = Struct .fromJson(kotlinEncoderFor <List <Pair <Int , Long >>>().schema( ).prettyJson())!!
122122 should("return correct types too") {
123123 expect(struct) {
124124 isOfType("array")
@@ -134,7 +134,7 @@ class TypeInferenceTest : ShouldSpec({
134134 context("type with list of generic data class with E generic name") {
135135 data class Test <E >(val e: E )
136136
137- val struct = Struct .fromJson(schema(typeOf <List <Test <String >>>()).prettyJson())!!
137+ val struct = Struct .fromJson(kotlinEncoderFor <List <Test <String >>>().schema( ).prettyJson())!!
138138 should("return correct types too") {
139139 expect(struct) {
140140 isOfType("array")
@@ -147,7 +147,7 @@ class TypeInferenceTest : ShouldSpec({
147147 }
148148 }
149149 context("type with list of list of int") {
150- val struct = Struct .fromJson(schema(typeOf <List <List <Int >>>()).prettyJson())!!
150+ val struct = Struct .fromJson(kotlinEncoderFor <List <List <Int >>>().schema( ).prettyJson())!!
151151 should("return correct types too") {
152152 expect(struct) {
153153 isOfType("array")
@@ -158,7 +158,7 @@ class TypeInferenceTest : ShouldSpec({
158158 }
159159 }
160160 context("Subtypes of list") {
161- val struct = Struct .fromJson(schema(typeOf <ArrayList <Int >>()).prettyJson())!!
161+ val struct = Struct .fromJson(kotlinEncoderFor <ArrayList <Int >>().schema( ).prettyJson())!!
162162 should("return correct types too") {
163163 expect(struct) {
164164 isOfType("array")
@@ -168,7 +168,7 @@ class TypeInferenceTest : ShouldSpec({
168168 }
169169 }
170170 context("Subtypes of list with nullable values") {
171- val struct = Struct .fromJson(schema(typeOf <ArrayList <Int ?>>()).prettyJson())!!
171+ val struct = Struct .fromJson(kotlinEncoderFor <ArrayList <Int ?>>().schema( ).prettyJson())!!
172172 should("return correct types too") {
173173 expect(struct) {
174174 isOfType("array")
@@ -180,7 +180,7 @@ class TypeInferenceTest : ShouldSpec({
180180 context("data class with props in order lon → lat") {
181181 data class Test (val lon: Double , val lat: Double )
182182
183- val struct = Struct .fromJson(schema(typeOf <Test >()).prettyJson())!!
183+ val struct = Struct .fromJson(kotlinEncoderFor <Test >().schema( ).prettyJson())!!
184184 should("Not change order of fields") {
185185 expect(struct.fields).notToEqualNull().containsExactly(
186186 hasField("lon", "double"),
@@ -191,7 +191,7 @@ class TypeInferenceTest : ShouldSpec({
191191 context("data class with nullable list inside") {
192192 data class Sample (val optionList: List <Int >? )
193193
194- val struct = Struct .fromJson(schema(typeOf <Sample >()).prettyJson())!!
194+ val struct = Struct .fromJson(kotlinEncoderFor <Sample >().schema( ).prettyJson())!!
195195
196196 should("show that list is nullable and element is not") {
197197 expect(struct)
@@ -213,7 +213,7 @@ class TypeInferenceTest : ShouldSpec({
213213 }
214214
215215 should("generate valid serializer schema") {
216- expect(encoder <Sample >().schema()) {
216+ expect(kotlinEncoderFor <Sample >().schema()) {
217217 this
218218 .feature("data type", { this.fields()?.toList() }) {
219219 this.notToEqualNull().toContain.inOrder.only.entry {
0 commit comments