Skip to content

Commit c082390

Browse files
authored
Add a test to check customTypeMapping is working from a service block (apollographql#1991)
1 parent 2a8c89f commit c082390

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

apollo-gradle-plugin/src/test/kotlin/com/apollographql/apollo/gradle/test/ConfigurationTests.kt

+18
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,24 @@ class ConfigurationTests {
2828
}
2929
}
3030

31+
@Test
32+
fun `customTypeMapping can be applied from a service block`() {
33+
withSimpleProject("""
34+
apollo {
35+
service("other") {
36+
schemaPath = "com/example/schema.json"
37+
}
38+
service("api") {
39+
customTypeMapping = ["DateTime": "java.util.Date"]
40+
schemaPath = "com/example/schema.json"
41+
}
42+
}
43+
""".trimIndent()) { dir ->
44+
TestUtils.executeTask("generateApolloSources", dir)
45+
TestUtils.assertFileContains(dir, "main/api/com/example/type/CustomType.java", "return Date.class;")
46+
}
47+
}
48+
3149
@Test
3250
fun `nullableValueType is working`() {
3351
for (pair in listOf(

0 commit comments

Comments
 (0)