@@ -4,41 +4,44 @@ import io.sentry.ILogger
44import io.sentry.ISentryExecutorService
55import io.sentry.NoOpContinuousProfiler
66import io.sentry.asyncprofiler.profiling.JavaContinuousProfiler
7- import one.profiler.AsyncProfiler
8- import org.mockito.Mockito.mock
9- import org.mockito.Mockito.mockStatic
107import kotlin.test.Test
118import kotlin.test.assertSame
129import kotlin.test.assertTrue
13-
10+ import one.profiler.AsyncProfiler
11+ import org.mockito.Mockito.mock
12+ import org.mockito.Mockito.mockStatic
1413
1514class AsyncProfilerContinuousProfilerProviderTest {
1615
1716 @Test
1817 fun `provider returns JavaAsyncProfiler if AsyncProfiler can be loaded` () {
19- val profiler = AsyncProfilerContinuousProfilerProvider ().getContinuousProfiler(
20- mock(ILogger ::class .java),
21- " " ,
22- 10 ,
23- mock(ISentryExecutorService ::class .java)
24- )
18+ val profiler =
19+ AsyncProfilerContinuousProfilerProvider ()
20+ .getContinuousProfiler(
21+ mock(ILogger ::class .java),
22+ " " ,
23+ 10 ,
24+ mock(ISentryExecutorService ::class .java),
25+ )
2526
2627 assertTrue(profiler is JavaContinuousProfiler )
2728 }
2829
2930 @Test
3031 fun `provider return NoopProfiler if AsyncProfiler cannot be loaded` () {
31- mockStatic(AsyncProfiler ::class .java).use {
32+ mockStatic(AsyncProfiler ::class .java).use {
3233 it.`when `<Any > { AsyncProfiler .getInstance() }.thenReturn(null )
3334
34- val profiler = AsyncProfilerContinuousProfilerProvider ().getContinuousProfiler(
35- mock(ILogger ::class .java),
36- " " ,
37- 10 ,
38- mock(ISentryExecutorService ::class .java)
39- )
35+ val profiler =
36+ AsyncProfilerContinuousProfilerProvider ()
37+ .getContinuousProfiler(
38+ mock(ILogger ::class .java),
39+ " " ,
40+ 10 ,
41+ mock(ISentryExecutorService ::class .java),
42+ )
4043
41- assertSame(NoOpContinuousProfiler .getInstance(), profiler)
44+ assertSame(NoOpContinuousProfiler .getInstance(), profiler)
4245 }
4346 }
4447}
0 commit comments