-
Notifications
You must be signed in to change notification settings - Fork 317
GraphQlTester created via @GraphQlTest
should use application JSON config
#345
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Can you show how the tester is created exactly? Or provide a sample. |
@GraphQlTest(PersonController::class)
internal class PersonControllerTest {
@Autowired
private lateinit var graphQlTester: GraphQlTester
@MockkBean
lateinit var personService: PersonService
@Test
fun `get all persons`() {
val person = Person(
UUID.randomUUID(),
firstName = "Test",
lastName = "Test",
createdAt = LocalDateTime.now()
)
val personResponse = PersonResponse(
person.id!!,
person.firstName,
person.lastName,
person.createdAt!!
)
coEvery { personService.getAllPeople() }.answers { flowOf(person) }
graphQlTester.documentName("getAllPeople")
.execute()
.path("people")
.entityList(PersonResponse::class.java)
.hasSize(1)
.contains(personResponse)
}
} And i found that changing to
make test pass, but as I guess it should also pass with previous solution. |
Currently, no JSON config options are exposed in the
|
@GraphQlTest
does not use application JSON config
I've exposed |
The enhancement is now pushed in Spring Boot 2.7.x, see spring-projects/spring-boot#30646. Changes are available in SNAPSHOTs now and will be released with 2.7.0-RC1 in a few days. Nothing else is required from my side, I think we can close this issue now. |
@GraphQlTest
does not use application JSON config@GraphQlTest
should use application JSON config
hi!
I found another problem this time during testing.
Controller:
Test:
query:
error:
This happened when I use data class for response object, when I use record from java I get :
and record looks like that:
And as you can see I have

com.fasterxml.jackson.datatype:jackson-datatype-jsr310
The text was updated successfully, but these errors were encountered: