From b2e1b7d529368c5431795379167dbb78d3cf1076 Mon Sep 17 00:00:00 2001 From: Dillon Nys <24740863+dnys1@users.noreply.github.com> Date: Wed, 23 Feb 2022 10:44:39 -0700 Subject: [PATCH] fix(core): Implement Result in AtomicResult (#1393) * fix(core): Implement Result in AtomicResult * Fix AtomicResultTest --- .../kotlin/com/amazonaws/amplify/amplify_core/AtomicResult.kt | 2 +- .../com/amazonaws/amplify/amplify_core/AtomicResultTest.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/amplify_core/android/src/main/kotlin/com/amazonaws/amplify/amplify_core/AtomicResult.kt b/packages/amplify_core/android/src/main/kotlin/com/amazonaws/amplify/amplify_core/AtomicResult.kt index 8028ad9148..8d59c05b67 100644 --- a/packages/amplify_core/android/src/main/kotlin/com/amazonaws/amplify/amplify_core/AtomicResult.kt +++ b/packages/amplify_core/android/src/main/kotlin/com/amazonaws/amplify/amplify_core/AtomicResult.kt @@ -51,7 +51,7 @@ class AtomicResult(private val result: MethodChannel.Result, private val operati } } - override fun error(errorCode: String?, errorMessage: String?, errorDetails: Any?) { + override fun error(errorCode: String, errorMessage: String?, errorDetails: Any?) { scope.launch { if (isSent.getAndSet(true)) { Log.w( diff --git a/packages/amplify_core/android/src/test/kotlin/com/amazonaws/amplify/amplify_core/AtomicResultTest.kt b/packages/amplify_core/android/src/test/kotlin/com/amazonaws/amplify/amplify_core/AtomicResultTest.kt index 27c9380738..2684d7aa12 100644 --- a/packages/amplify_core/android/src/test/kotlin/com/amazonaws/amplify/amplify_core/AtomicResultTest.kt +++ b/packages/amplify_core/android/src/test/kotlin/com/amazonaws/amplify/amplify_core/AtomicResultTest.kt @@ -46,8 +46,8 @@ class AtomicResultTest { @Test fun errorIsForwarded() = coroutinesTestRule.testDispatcher.runBlockingTest { val atomicResult = AtomicResult(mockResult, "errorIsForwarded") - atomicResult.error(null, null, null) - verify(mockResult).error(null, null, null) + atomicResult.error("", null, null) + verify(mockResult).error("", null, null) } @Test