@@ -8,7 +8,6 @@ import io.sentry.EventProcessor
88import io.sentry.FilterString
99import io.sentry.Hint
1010import io.sentry.IContinuousProfiler
11- import io.sentry.ILogger
1211import io.sentry.IProfileConverter
1312import io.sentry.IScopes
1413import io.sentry.ITransportFactory
@@ -58,9 +57,7 @@ import org.assertj.core.api.Assertions.assertThat
5857import org.mockito.internal.util.MockUtil.isMock
5958import org.mockito.kotlin.any
6059import org.mockito.kotlin.anyOrNull
61- import org.mockito.kotlin.eq
6260import org.mockito.kotlin.mock
63- import org.mockito.kotlin.never
6461import org.mockito.kotlin.verify
6562import org.mockito.kotlin.whenever
6663import org.quartz.JobExecutionContext
@@ -198,56 +195,6 @@ class SentryAutoConfigurationTest {
198195 }
199196 }
200197
201- @Test
202- fun `legacy logs property emits no warning when absent` () {
203- val logger = mock<ILogger >()
204- dsnEnabledRunner
205- .withPropertyValues(" sentry.debug=true" )
206- .withBean(ILogger ::class .java, { logger })
207- .withUserConfiguration(LoggerConfiguration ::class .java)
208- .run { verify(logger, never()).log(eq(SentryLevel .WARNING ), any<String >()) }
209- }
210-
211- @Test
212- fun `legacy logs property true emits migration warning` () {
213- val logger = mock<ILogger >()
214- dsnEnabledRunner
215- .withPropertyValues(" sentry.debug=true" , " sentry.logs.enabled=true" )
216- .withBean(ILogger ::class .java, { logger })
217- .withUserConfiguration(LoggerConfiguration ::class .java)
218- .run {
219- verify(logger)
220- .log(
221- SentryLevel .WARNING ,
222- " The 'sentry.logs.enabled' property is no longer supported. Manual " +
223- " Sentry.logger() calls no longer require it, and automatic logging " +
224- " integrations now require their own opt-ins." ,
225- * emptyArray(),
226- )
227- assertThat(it.getBean(SentryProperties ::class .java).logging.isEnableLogs).isFalse()
228- }
229- }
230-
231- @Test
232- fun `legacy logs property false emits migration warning` () {
233- val logger = mock<ILogger >()
234- dsnEnabledRunner
235- .withPropertyValues(" sentry.debug=true" , " sentry.logs.enabled=false" )
236- .withBean(ILogger ::class .java, { logger })
237- .withUserConfiguration(LoggerConfiguration ::class .java)
238- .run {
239- verify(logger)
240- .log(
241- SentryLevel .WARNING ,
242- " The 'sentry.logs.enabled' property no longer disables manual Sentry.logger() " +
243- " calls. Automatic logging integrations remain disabled unless enabled through " +
244- " their own opt-ins." ,
245- * emptyArray(),
246- )
247- assertThat(it.getBean(SentryProperties ::class .java).logging.isEnableLogs).isFalse()
248- }
249- }
250-
251198 @Test
252199 fun `properties are applied to SentryOptions` () {
253200 contextRunner
@@ -1369,13 +1316,6 @@ class SentryAutoConfigurationTest {
13691316 @Bean open fun sentryTransport () = transport
13701317 }
13711318
1372- @Configuration(proxyBeanMethods = false )
1373- open class LoggerConfiguration {
1374- @Bean
1375- open fun loggerConfiguration (logger : ILogger ) =
1376- Sentry .OptionsConfiguration <SentryOptions > { it.setLogger(logger) }
1377- }
1378-
13791319 @Configuration(proxyBeanMethods = false )
13801320 open class NoOpTransportConfiguration {
13811321
0 commit comments