Skip to content

Commit 0f70aa9

Browse files
authored
Merge 5b0a733 into 27d7cf8
2 parents 27d7cf8 + 5b0a733 commit 0f70aa9

File tree

9 files changed

+26
-30
lines changed

9 files changed

+26
-30
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ retrofit = "2.9.0"
3131
slf4j = "1.7.30"
3232
springboot2 = "2.7.18"
3333
springboot3 = "3.5.0"
34-
springboot4 = "4.0.0-M3"
34+
springboot4 = "4.0.0-RC1"
3535
# Android
3636
targetSdk = "34"
3737
compileSdk = "34"
@@ -165,6 +165,7 @@ springboot3-starter-security = { module = "org.springframework.boot:spring-boot-
165165
springboot3-starter-jdbc = { module = "org.springframework.boot:spring-boot-starter-jdbc", version.ref = "springboot3" }
166166
springboot3-starter-actuator = { module = "org.springframework.boot:spring-boot-starter-actuator", version.ref = "springboot3" }
167167
springboot4-otel = { module = "io.opentelemetry.instrumentation:opentelemetry-spring-boot-starter", version.ref = "otelInstrumentation" }
168+
springboot4-resttestclient = { module = "org.springframework.boot:spring-boot-resttestclient", version.ref = "springboot4" }
168169
springboot4-starter = { module = "org.springframework.boot:spring-boot-starter", version.ref = "springboot4" }
169170
springboot4-starter-graphql = { module = "org.springframework.boot:spring-boot-starter-graphql", version.ref = "springboot4" }
170171
springboot4-starter-quartz = { module = "org.springframework.boot:spring-boot-starter-quartz", version.ref = "springboot4" }

sentry-spring-7/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ dependencies {
7575
testImplementation(libs.springboot4.starter.webflux)
7676
testImplementation(libs.springboot4.starter.restclient)
7777
testImplementation(libs.springboot4.starter.webclient)
78+
testImplementation(libs.springboot4.resttestclient)
7879
testImplementation(projects.sentryReactor)
7980
}
8081

sentry-spring-7/src/test/kotlin/io/sentry/spring7/graphql/SentrySpringSubscriptionHandlerTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class SentrySpringSubscriptionHandlerTest {
4040
whenever(parameters.environment).thenReturn(dataFetchingEnvironment)
4141
val resultObject =
4242
SentrySpringSubscriptionHandler()
43-
.onSubscriptionResult(Flux.error<Any?>(exception), scopes, exceptionReporter, parameters)
44-
assertThrows<IllegalStateException> { (resultObject as Flux<Any?>).blockFirst() }
43+
.onSubscriptionResult(Flux.error<Any>(exception), scopes, exceptionReporter, parameters)
44+
assertThrows<IllegalStateException> { (resultObject as Flux<Any>).blockFirst() }
4545

4646
verify(exceptionReporter)
4747
.captureThrowable(
@@ -77,12 +77,12 @@ class SentrySpringSubscriptionHandlerTest {
7777
val resultObject =
7878
SentrySpringSubscriptionHandler()
7979
.onSubscriptionResult(
80-
Flux.error<Any?>(wrappedException),
80+
Flux.error<Any>(wrappedException),
8181
scopes,
8282
exceptionReporter,
8383
parameters,
8484
)
85-
assertThrows<SubscriptionPublisherException> { (resultObject as Flux<Any?>).blockFirst() }
85+
assertThrows<SubscriptionPublisherException> { (resultObject as Flux<Any>).blockFirst() }
8686

8787
verify(exceptionReporter)
8888
.captureThrowable(

sentry-spring-7/src/test/kotlin/io/sentry/spring7/mvc/SentrySpringIntegrationTest.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import io.sentry.spring7.tracing.SentryTracingConfiguration
2222
import io.sentry.spring7.tracing.SentryTracingFilter
2323
import io.sentry.spring7.tracing.SentryTransaction
2424
import io.sentry.transport.ITransport
25-
import java.time.Duration
2625
import java.util.concurrent.Callable
2726
import java.util.concurrent.TimeUnit
2827
import kotlin.test.BeforeTest
@@ -42,9 +41,9 @@ import org.mockito.kotlin.verify
4241
import org.mockito.kotlin.whenever
4342
import org.springframework.beans.factory.annotation.Autowired
4443
import org.springframework.boot.autoconfigure.SpringBootApplication
44+
import org.springframework.boot.resttestclient.TestRestTemplate
4545
import org.springframework.boot.test.context.SpringBootTest
46-
import org.springframework.boot.web.server.test.LocalServerPort
47-
import org.springframework.boot.web.server.test.client.TestRestTemplate
46+
import org.springframework.boot.test.web.server.LocalServerPort
4847
import org.springframework.boot.web.servlet.FilterRegistrationBean
4948
import org.springframework.context.annotation.Bean
5049
import org.springframework.context.annotation.Configuration
@@ -80,13 +79,15 @@ import org.springframework.web.reactive.function.client.WebClient
8079
class SentrySpringIntegrationTest {
8180

8281
companion object {
82+
@JvmStatic
8383
@BeforeClass
84-
fun `configure awaitlity`() {
84+
fun `configure awaitlity`(): Unit {
8585
Awaitility.setDefaultTimeout(500, TimeUnit.MILLISECONDS)
8686
}
8787

88+
@JvmStatic
8889
@AfterClass
89-
fun `reset awaitility`() {
90+
fun `reset awaitility`(): Unit {
9091
Awaitility.reset()
9192
}
9293
}
@@ -230,10 +231,8 @@ class SentrySpringIntegrationTest {
230231

231232
restTemplate.getForEntity("http://localhost:$port/throws-handled", String::class.java)
232233

233-
await.during(Duration.ofSeconds(2)).untilAsserted {
234-
verify(transport, never())
235-
.send(checkEvent { event -> assertThat(event).isNotNull() }, anyOrNull())
236-
}
234+
verify(transport, never())
235+
.send(checkEvent { event -> assertThat(event).isNotNull() }, anyOrNull())
237236
}
238237

239238
@Test

sentry-spring-7/src/test/kotlin/io/sentry/spring7/webflux/SentryWebfluxIntegrationTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ import org.mockito.kotlin.whenever
2727
import org.springframework.beans.factory.annotation.Autowired
2828
import org.springframework.boot.ApplicationRunner
2929
import org.springframework.boot.autoconfigure.SpringBootApplication
30-
import org.springframework.boot.security.autoconfigure.reactive.ReactiveSecurityAutoConfiguration
31-
import org.springframework.boot.security.autoconfigure.servlet.SecurityAutoConfiguration
30+
import org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration
31+
import org.springframework.boot.security.autoconfigure.web.reactive.ReactiveWebSecurityAutoConfiguration
3232
import org.springframework.boot.test.context.SpringBootTest
33-
import org.springframework.boot.web.server.test.LocalServerPort
33+
import org.springframework.boot.test.web.server.LocalServerPort
3434
import org.springframework.context.annotation.Bean
3535
import org.springframework.http.ResponseEntity
3636
import org.springframework.test.context.junit4.SpringRunner
@@ -136,7 +136,7 @@ class SentryWebfluxIntegrationTest {
136136
}
137137

138138
@SpringBootApplication(
139-
exclude = [ReactiveSecurityAutoConfiguration::class, SecurityAutoConfiguration::class]
139+
exclude = [ReactiveWebSecurityAutoConfiguration::class, SecurityAutoConfiguration::class]
140140
)
141141
open class App {
142142
private val transport = mock<ITransport>().also { whenever(it.isHealthy).thenReturn(true) }

sentry-spring-boot-4/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ dependencies {
102102
testImplementation(libs.springboot4.starter.webflux)
103103
testImplementation(libs.springboot4.starter.restclient)
104104
testImplementation(libs.springboot4.starter.webclient)
105+
testImplementation(libs.springboot4.resttestclient)
105106
}
106107

107108
configure<SourceSetContainer> { test { java.srcDir("src/test/java") } }

sentry-spring-boot-4/src/test/kotlin/io/sentry/spring/boot4/it/SentrySpringIntegrationTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import org.mockito.kotlin.whenever
2424
import org.slf4j.LoggerFactory
2525
import org.springframework.beans.factory.annotation.Autowired
2626
import org.springframework.boot.autoconfigure.SpringBootApplication
27+
import org.springframework.boot.resttestclient.TestRestTemplate
2728
import org.springframework.boot.test.context.SpringBootTest
28-
import org.springframework.boot.web.server.test.LocalServerPort
29-
import org.springframework.boot.web.server.test.client.TestRestTemplate
29+
import org.springframework.boot.test.web.server.LocalServerPort
3030
import org.springframework.context.annotation.Bean
3131
import org.springframework.context.annotation.Configuration
3232
import org.springframework.http.HttpEntity

sentry-spring-jakarta/src/test/kotlin/io/sentry/spring/jakarta/mvc/SentrySpringIntegrationTest.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import io.sentry.spring.jakarta.tracing.SentryTracingConfiguration
2222
import io.sentry.spring.jakarta.tracing.SentryTracingFilter
2323
import io.sentry.spring.jakarta.tracing.SentryTransaction
2424
import io.sentry.transport.ITransport
25-
import java.time.Duration
2625
import java.util.concurrent.Callable
2726
import java.util.concurrent.TimeUnit
2827
import kotlin.test.BeforeTest
@@ -230,10 +229,8 @@ class SentrySpringIntegrationTest {
230229

231230
restTemplate.getForEntity("http://localhost:$port/throws-handled", String::class.java)
232231

233-
await.during(Duration.ofSeconds(2)).untilAsserted {
234-
verify(transport, never())
235-
.send(checkEvent { event -> assertThat(event).isNotNull() }, anyOrNull())
236-
}
232+
verify(transport, never())
233+
.send(checkEvent { event -> assertThat(event).isNotNull() }, anyOrNull())
237234
}
238235

239236
@Test

sentry-spring/src/test/kotlin/io/sentry/spring/mvc/SentrySpringIntegrationTest.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import io.sentry.spring.tracing.SentryTracingConfiguration
2222
import io.sentry.spring.tracing.SentryTracingFilter
2323
import io.sentry.spring.tracing.SentryTransaction
2424
import io.sentry.transport.ITransport
25-
import java.time.Duration
2625
import java.util.concurrent.Callable
2726
import java.util.concurrent.TimeUnit
2827
import kotlin.test.BeforeTest
@@ -231,10 +230,8 @@ class SentrySpringIntegrationTest {
231230

232231
restTemplate.getForEntity("http://localhost:$port/throws-handled", String::class.java)
233232

234-
await.during(Duration.ofSeconds(2)).untilAsserted {
235-
verify(transport, never())
236-
.send(checkEvent { event -> assertThat(event).isNotNull() }, anyOrNull())
237-
}
233+
verify(transport, never())
234+
.send(checkEvent { event -> assertThat(event).isNotNull() }, anyOrNull())
238235
}
239236

240237
@Test

0 commit comments

Comments
 (0)