Skip to content

Commit b9768d3

Browse files
committed
feat(nextcloud_test): use neon client for tests
Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
1 parent f135dde commit b9768d3

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

packages/nextcloud/pubspec_overrides.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# melos_managed_dependency_overrides: cookie_store,dynamite,dynamite_runtime,neon_lints,nextcloud_test
1+
# melos_managed_dependency_overrides: cookie_store,dynamite,dynamite_runtime,neon_http_client,neon_lints,nextcloud_test
22
dependency_overrides:
33
cookie_store:
44
path: ../cookie_store
55
dynamite:
66
path: ../dynamite/dynamite
77
dynamite_runtime:
88
path: ../dynamite/dynamite_runtime
9+
neon_http_client:
10+
path: ../neon_http_client
911
neon_lints:
1012
path: ../neon_lints
1113
nextcloud_test:

packages/nextcloud_test/lib/src/test_client.dart

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'dart:async';
22
import 'dart:convert';
33

44
import 'package:cookie_store/cookie_store.dart';
5+
import 'package:neon_http_client/neon_http_client.dart';
56
import 'package:nextcloud/nextcloud.dart';
67
import 'package:nextcloud_test/src/docker_container.dart';
78
import 'package:nextcloud_test/src/fixtures.dart';
@@ -45,6 +46,13 @@ extension TestNextcloudClient on NextcloudClient {
4546
appPassword = (result.stdout as String).split('\n')[1];
4647
}
4748

49+
final httpClient = NeonHttpClient(
50+
cookieStore: CookieStore(),
51+
client: getProxyHttpClient(
52+
onRequest: appendFixture,
53+
),
54+
);
55+
4856
return NextcloudClient(
4957
Uri(
5058
scheme: 'http',
@@ -54,12 +62,7 @@ extension TestNextcloudClient on NextcloudClient {
5462
loginName: username,
5563
password: username,
5664
appPassword: appPassword,
57-
cookieJar: CookieJarAdapter(
58-
CookieStore(),
59-
),
60-
httpClient: getProxyHttpClient(
61-
onRequest: appendFixture,
62-
),
65+
httpClient: httpClient,
6366
);
6467
}
6568
}

packages/nextcloud_test/pubspec.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ dependencies:
1313
path: packages/cookie_store
1414
http: ^1.2.0
1515
meta: ^1.0.0
16+
neon_http_client:
17+
git:
18+
url: https://github.com/nextcloud/neon
19+
path: packages/neon_http_client
1620
nextcloud: ^6.1.0
1721
process_run: ^1.0.0+1
1822
test: ^1.24.0

packages/nextcloud_test/pubspec_overrides.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
# melos_managed_dependency_overrides: cookie_store,dynamite_runtime,neon_lints,nextcloud
1+
# melos_managed_dependency_overrides: cookie_store,dynamite_runtime,neon_http_client,neon_lints,nextcloud
22
dependency_overrides:
33
cookie_store:
44
path: ../cookie_store
55
dynamite_runtime:
66
path: ../dynamite/dynamite_runtime
7+
neon_http_client:
8+
path: ../neon_http_client
79
neon_lints:
810
path: ../neon_lints
911
nextcloud:

0 commit comments

Comments
 (0)