Skip to content

Commit

Permalink
readd test
Browse files Browse the repository at this point in the history
  • Loading branch information
martha-johnston committed Jan 21, 2025
1 parent 7d4e0d9 commit 5eb2e20
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test/unit_test/services/discovery_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ class FakeDiscoveryClient extends DiscoveryClient {
}

void main() {
// late DiscoveryClient client;
// late MockDiscoveryServiceClient serviceClient;
late DiscoveryClient client;
late MockDiscoveryServiceClient serviceClient;

// setUp(() {
// serviceClient = MockDiscoveryServiceClient();
// client = FakeDiscoveryClient('discovery', MockClientChannelBase(), serviceClient);
// });
setUp(() {
serviceClient = MockDiscoveryServiceClient();
client = FakeDiscoveryClient('discovery', MockClientChannelBase(), serviceClient);
});

// group('Discovery RPC Client Tests', () {
// test('discoverResources', () async {
// final expected = [ComponentConfig()];
// when(serviceClient.discoverResources(any))
// .thenAnswer((_) => MockResponseFuture.value(DiscoverResourcesResponse(discoveries: expected)));
// final response = await client.discoverResources('discoveryName');
// expect(response, equals(expected));
// });
// });
group('Discovery RPC Client Tests', () {
test('discoverResources', () async {
final expected = [ComponentConfig()];
when(serviceClient.discoverResources(any))
.thenAnswer((_) => MockResponseFuture.value(DiscoverResourcesResponse(discoveries: expected)));
final response = await client.discoverResources('discoveryName');
expect(response, equals(expected));
});
});
}

0 comments on commit 5eb2e20

Please sign in to comment.