Skip to content

chore(datastore): added unit tests for Amplify Api Native Bridge #4983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/amplify_datastore/lib/amplify_datastore.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class AmplifyDataStore extends DataStorePluginInterface
config.api?.awsPlugin?.all.entries.forEach((e) {
endpoints[e.key] = e.value.authorizationType.name;
});
final nativePlugin = _NativeAmplifyApi(authProviders);
final nativePlugin = NativeAmplifyApi(authProviders);
NativeApiPlugin.setup(nativePlugin);

final nativeBridge = NativeApiBridge();
Expand Down Expand Up @@ -292,10 +292,11 @@ class _NativeAmplifyAuthCognito
String get runtimeTypeName => '_NativeAmplifyAuthCognito';
}

class _NativeAmplifyApi
@visibleForTesting
class NativeAmplifyApi
with AWSDebuggable, AmplifyLoggerMixin
implements NativeApiPlugin {
_NativeAmplifyApi(this._authProviders);
NativeAmplifyApi(this._authProviders);

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

@override
String get runtimeTypeName => '_NativeAmplifyApi';
String get runtimeTypeName => 'NativeAmplifyApi';

@override
Future<String?> getLatestAuthToken(String providerName) {
Expand Down
Loading
Loading