1
- package dev .hilla . springnative ;
1
+ package dev .hilla ;
2
2
3
3
import java .io .IOException ;
4
4
import java .nio .charset .StandardCharsets ;
9
9
import org .junit .Assert ;
10
10
import org .junit .Test ;
11
11
12
- public class HillaHintsRegistrarTest {
12
+ public class OpenAPIUtilTest {
13
13
14
14
@ Test
15
15
public void emptySchemaReturnsNoComponents () throws IOException {
@@ -19,14 +19,16 @@ public void emptySchemaReturnsNoComponents() throws IOException {
19
19
20
20
@ Test
21
21
public void singleType () throws IOException {
22
- Assert .assertEquals (Set
23
- .of ("com.example.application.endpoints.helloreact.MyOtherType" ),
22
+ Assert .assertEquals (Set .of (
23
+ "com.example.application.endpoints.helloreact.HelloReactEndpoint" ,
24
+ "com.example.application.endpoints.helloreact.MyOtherType" ),
24
25
parse ("openapi-customtype.json" ));
25
26
}
26
27
27
28
@ Test
28
29
public void referringTypes () throws IOException {
29
30
Assert .assertEquals (Set .of (
31
+ "com.example.application.endpoints.helloreact.HelloReactEndpoint" ,
30
32
"com.example.application.endpoints.helloreact.MyType" ,
31
33
"com.example.application.endpoints.helloreact.MyOtherType" ),
32
34
parse ("openapi-referring-customtypes.json" ));
@@ -35,6 +37,7 @@ public void referringTypes() throws IOException {
35
37
@ Test
36
38
public void nestedType () throws IOException {
37
39
Assert .assertEquals (Set .of (
40
+ "com.example.application.endpoints.helloreact.HelloReactEndpoint" ,
38
41
"com.example.application.endpoints.helloreact.HelloReactEndpoint$MyInnerType" ),
39
42
parse ("openapi-innertype.json" ));
40
43
}
@@ -43,7 +46,7 @@ private Set<String> parse(String openapiFilename) throws IOException {
43
46
String openApi = IOUtils .toString (
44
47
getClass ().getResourceAsStream (openapiFilename ),
45
48
StandardCharsets .UTF_8 );
46
- return HillaHintsRegistrar . parseOpenApi (openApi );
49
+ return OpenAPIUtil . findOpenApiClasses (openApi );
47
50
}
48
51
49
52
}
0 commit comments