Skip to content

Commit 5600ede

Browse files
runningcodeclaude
andcommitted
test(spring-boot): Return a Mono from the Boot 3 WebFlux GraphQL resolver
The sample's resolver returned a Mono, so its test covered Sentry finishing the field's span when the Mono completes. The port returned a String, which only covers the synchronous path. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent ce37c91 commit 5600ede

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎sentry-spring-boot-jakarta/src/integrationTestWebflux/kotlin/io/sentry/spring/boot/jakarta/webfluxintegrationtest/WebfluxIntegrationTestApplication.kt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,13 @@ open class TodoController(private val webClient: WebClient) {
9797
/** Throws when given "crash", so tests can check error reporting. */
9898
@Controller
9999
open class GreetingController {
100+
// Returns a Mono, as a reactive app would, so the test covers Sentry finishing the field's span
101+
// asynchronously.
100102
@QueryMapping
101-
open fun greeting(@Argument name: String): String {
103+
open fun greeting(@Argument name: String): Mono<String> {
102104
if (name == "crash") {
103105
throw RuntimeException("causing an error for $name")
104106
}
105-
return "Hello $name!"
107+
return Mono.just("Hello $name!")
106108
}
107109
}

0 commit comments

Comments
 (0)