@@ -60,8 +60,8 @@ internal class AWSCloudWatchLoggingPluginImplementationTest {
60
60
region = " REGION" ,
61
61
logGroupName = " LOG_GROUP"
62
62
)
63
- every { loggingConstraintsResolver::localLoggingConstraint.set(capture(loggingConstraintsSlot)) }.answers { }
64
- coEvery { cloudWatchLogManager.startSync() }.answers { }
63
+ every { loggingConstraintsResolver::localLoggingConstraint.set(capture(loggingConstraintsSlot)) } returns Unit
64
+ coEvery { cloudWatchLogManager.startSync() } returns Unit
65
65
awsCloudWatchLoggingPluginImplementation.configure(
66
66
awsLoggingConfig
67
67
)
@@ -77,8 +77,8 @@ internal class AWSCloudWatchLoggingPluginImplementationTest {
77
77
region = " REGION" ,
78
78
logGroupName = " LOG_GROUP"
79
79
)
80
- every { loggingConstraintsResolver::localLoggingConstraint.set(any()) }.answers { }
81
- coEvery { cloudWatchLogManager.startSync() }.answers { }
80
+ every { loggingConstraintsResolver::localLoggingConstraint.set(any()) } returns Unit
81
+ coEvery { cloudWatchLogManager.startSync() } returns Unit
82
82
awsCloudWatchLoggingPluginImplementation.configure(
83
83
awsLoggingConfig
84
84
)
@@ -88,15 +88,15 @@ internal class AWSCloudWatchLoggingPluginImplementationTest {
88
88
89
89
@Test
90
90
fun `on enable` () = runTest {
91
- coEvery { cloudWatchLogManager.startSync() }.answers { }
91
+ coEvery { cloudWatchLogManager.startSync() } returns Unit
92
92
awsCloudWatchLoggingPluginImplementation.enable()
93
93
assertTrue(awsCloudWatchLoggingPluginImplementation.isPluginEnabled)
94
94
coVerify(exactly = 1 ) { cloudWatchLogManager.startSync() }
95
95
}
96
96
97
97
@Test
98
98
fun `on disable` () {
99
- every { cloudWatchLogManager.stopSync() }.answers { }
99
+ every { cloudWatchLogManager.stopSync() } returns Unit
100
100
awsCloudWatchLoggingPluginImplementation.disable()
101
101
assertFalse(awsCloudWatchLoggingPluginImplementation.isPluginEnabled)
102
102
verify(exactly = 1 ) { cloudWatchLogManager.stopSync() }
@@ -106,8 +106,8 @@ internal class AWSCloudWatchLoggingPluginImplementationTest {
106
106
fun `on flush logs success` () = runTest {
107
107
val onSuccess = mockk<Action >()
108
108
val onError = mockk<Consumer <AmplifyException >>()
109
- coEvery { cloudWatchLogManager.syncLogEventsWithCloudwatch() }.answers { }
110
- every { onSuccess.call() }.answers { }
109
+ coEvery { cloudWatchLogManager.syncLogEventsWithCloudwatch() } returns Unit
110
+ every { onSuccess.call() } returns Unit
111
111
awsCloudWatchLoggingPluginImplementation.flushLogs(onSuccess, onError)
112
112
coVerify(exactly = 1 ) { cloudWatchLogManager.syncLogEventsWithCloudwatch() }
113
113
verify(exactly = 1 ) { onSuccess.call() }
@@ -120,7 +120,7 @@ internal class AWSCloudWatchLoggingPluginImplementationTest {
120
120
val onError = mockk<Consumer <AmplifyException >>()
121
121
val exception = slot<AmplifyException >()
122
122
coEvery { cloudWatchLogManager.syncLogEventsWithCloudwatch() }.throws(IllegalStateException ())
123
- every { onError.accept(capture(exception)) }.answers { }
123
+ every { onError.accept(capture(exception)) } returns Unit
124
124
awsCloudWatchLoggingPluginImplementation.flushLogs(onSuccess, onError)
125
125
coVerify(exactly = 1 ) { cloudWatchLogManager.syncLogEventsWithCloudwatch() }
126
126
verify(exactly = 0 ) { onSuccess.call() }
0 commit comments