Skip to content

Commit 6be9898

Browse files
authored
chore(datastore): added unit tests for Amplify Api Native Bridge (#4983)
* chore(datastore): added unit tests for Amplify Api Native Bridge Unit tests for Query, Mutate, Subscribe, and Unsubscribe * chore(datastore): updated Amplify Api Native Bridge unit tests per feedback * chore(datastore): Formatted file
1 parent 9c0d8fa commit 6be9898

File tree

2 files changed

+998
-4
lines changed

2 files changed

+998
-4
lines changed

packages/amplify_datastore/lib/amplify_datastore.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class AmplifyDataStore extends DataStorePluginInterface
110110
config.api?.awsPlugin?.all.entries.forEach((e) {
111111
endpoints[e.key] = e.value.authorizationType.name;
112112
});
113-
final nativePlugin = _NativeAmplifyApi(authProviders);
113+
final nativePlugin = NativeAmplifyApi(authProviders);
114114
NativeApiPlugin.setup(nativePlugin);
115115

116116
final nativeBridge = NativeApiBridge();
@@ -292,10 +292,11 @@ class _NativeAmplifyAuthCognito
292292
String get runtimeTypeName => '_NativeAmplifyAuthCognito';
293293
}
294294

295-
class _NativeAmplifyApi
295+
@visibleForTesting
296+
class NativeAmplifyApi
296297
with AWSDebuggable, AmplifyLoggerMixin
297298
implements NativeApiPlugin {
298-
_NativeAmplifyApi(this._authProviders);
299+
NativeAmplifyApi(this._authProviders);
299300

300301
/// The registered [APIAuthProvider] instances.
301302
final Map<APIAuthorizationType<AmplifyAuthProvider>, APIAuthProvider>
@@ -305,7 +306,7 @@ class _NativeAmplifyApi
305306
_subscriptionsCache = {};
306307

307308
@override
308-
String get runtimeTypeName => '_NativeAmplifyApi';
309+
String get runtimeTypeName => 'NativeAmplifyApi';
309310

310311
@override
311312
Future<String?> getLatestAuthToken(String providerName) {

0 commit comments

Comments
 (0)