From 4b8c41aba723bbe946bdec23b001f32441b38888 Mon Sep 17 00:00:00 2001
From: verboomp
Date: Thu, 19 Feb 2026 13:25:23 +0100
Subject: [PATCH] fix test
---
.../core/utils/ImageUtilTest.java | 188 ++++++++
...uestionnaire_customer_controller_test.dart | 22 +-
.../test/testing/test_utils.dart | 4 +
.../test/testing/test_utils.mocks.dart | 423 ++++++++++++++----
4 files changed, 539 insertions(+), 98 deletions(-)
diff --git a/hartmann-foto-documentation-app/src/test/java/marketing/heyday/hartmann/fotodocumentation/core/utils/ImageUtilTest.java b/hartmann-foto-documentation-app/src/test/java/marketing/heyday/hartmann/fotodocumentation/core/utils/ImageUtilTest.java
index d907def..952843c 100644
--- a/hartmann-foto-documentation-app/src/test/java/marketing/heyday/hartmann/fotodocumentation/core/utils/ImageUtilTest.java
+++ b/hartmann-foto-documentation-app/src/test/java/marketing/heyday/hartmann/fotodocumentation/core/utils/ImageUtilTest.java
@@ -186,6 +186,194 @@ class ImageUtilTest {
assertEquals((byte) 0xFF, result[2]);
}
+ // --- EXIF orientation: applyOrientation ---
+
+ @Test
+ void applyOrientation_orientation1_returnsSameInstance() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 1);
+
+ assertSame(image, result);
+ }
+
+ @Test
+ void applyOrientation_orientation2_horizontalFlip_preservesDimensions() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 2);
+
+ assertEquals(800, result.getWidth());
+ assertEquals(600, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_orientation3_rotate180_preservesDimensions() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 3);
+
+ assertEquals(800, result.getWidth());
+ assertEquals(600, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_orientation4_verticalFlip_preservesDimensions() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 4);
+
+ assertEquals(800, result.getWidth());
+ assertEquals(600, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_orientation5_swapsDimensions() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 5);
+
+ assertEquals(600, result.getWidth());
+ assertEquals(800, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_orientation6_rotate90cw_swapsDimensions() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 6);
+
+ assertEquals(600, result.getWidth());
+ assertEquals(800, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_orientation7_swapsDimensions() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 7);
+
+ assertEquals(600, result.getWidth());
+ assertEquals(800, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_orientation8_rotate90ccw_swapsDimensions() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 8);
+
+ assertEquals(600, result.getWidth());
+ assertEquals(800, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_unknownOrientation_returnsSameInstance() {
+ BufferedImage image = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 99);
+
+ assertSame(image, result);
+ }
+
+ @Test
+ void applyOrientation_orientation2_flipsPixelsHorizontally() {
+ BufferedImage image = new BufferedImage(4, 2, BufferedImage.TYPE_INT_RGB);
+ image.setRGB(0, 0, 0xFF0000); // red at top-left
+
+ BufferedImage result = imageUtil.applyOrientation(image, 2);
+
+ assertEquals(0xFF0000, result.getRGB(3, 0) & 0xFFFFFF); // red at top-right
+ }
+
+ @Test
+ void applyOrientation_orientation3_rotates180() {
+ BufferedImage image = new BufferedImage(4, 2, BufferedImage.TYPE_INT_RGB);
+ image.setRGB(0, 0, 0xFF0000); // red at top-left
+
+ BufferedImage result = imageUtil.applyOrientation(image, 3);
+
+ assertEquals(0xFF0000, result.getRGB(3, 1) & 0xFFFFFF); // red at bottom-right
+ }
+
+ @Test
+ void applyOrientation_orientation6_rotates90cw_returnsNewImage() {
+ BufferedImage image = new BufferedImage(4, 2, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 6);
+
+ assertNotSame(image, result);
+ assertEquals(2, result.getWidth());
+ assertEquals(4, result.getHeight());
+ }
+
+ @Test
+ void applyOrientation_orientation8_rotates90ccw_returnsNewImage() {
+ BufferedImage image = new BufferedImage(4, 2, BufferedImage.TYPE_INT_RGB);
+
+ BufferedImage result = imageUtil.applyOrientation(image, 8);
+
+ assertNotSame(image, result);
+ assertEquals(2, result.getWidth());
+ assertEquals(4, result.getHeight());
+ }
+
+ // --- EXIF orientation: getExifOrientation ---
+
+ @Test
+ void getExifOrientation_pngWithNoExif_returns1() {
+ String base64 = createTestImageBase64(100, 100);
+ byte[] imageBytes = Base64.getDecoder().decode(base64);
+
+ int orientation = imageUtil.getExifOrientation(imageBytes);
+
+ assertEquals(1, orientation);
+ }
+
+ @Test
+ void getExifOrientation_invalidBytes_returns1() {
+ byte[] garbage = new byte[]{0x00, 0x01, 0x02, 0x03};
+
+ int orientation = imageUtil.getExifOrientation(garbage);
+
+ assertEquals(1, orientation);
+ }
+
+ // --- EXIF orientation through getImage (size 1 / default) ---
+
+ @Test
+ void getImage_size1_noExif_returnsOriginalUnchanged() {
+ String base64 = createTestImageBase64(400, 300);
+ byte[] original = Base64.getDecoder().decode(base64);
+
+ byte[] result = imageUtil.getImage(base64, 1);
+
+ assertArrayEquals(original, result);
+ }
+
+ @Test
+ void getImage_defaultSize_noExif_returnsOriginalUnchanged() {
+ String base64 = createTestImageBase64(400, 300);
+ byte[] original = Base64.getDecoder().decode(base64);
+
+ byte[] result = imageUtil.getImage(base64, 42);
+
+ assertArrayEquals(original, result);
+ }
+
+ // --- EXIF orientation with resize ---
+
+ @Test
+ void getImage_size2_rotatedImage_usesEffectiveWidthForResizeDecision() throws IOException {
+ // A tall image (600x800) with no EXIF won't be resized since width (600) < 1200
+ String base64 = createTestImageBase64(600, 800);
+ byte[] original = Base64.getDecoder().decode(base64);
+
+ byte[] result = imageUtil.getImage(base64, 2);
+
+ assertArrayEquals(original, result);
+ }
+
// --- Edge cases ---
@Test
diff --git a/hartmann-foto-documentation-frontend/test/controller/questionnaire_customer_controller_test.dart b/hartmann-foto-documentation-frontend/test/controller/questionnaire_customer_controller_test.dart
index 2a82055..c60a38f 100644
--- a/hartmann-foto-documentation-frontend/test/controller/questionnaire_customer_controller_test.dart
+++ b/hartmann-foto-documentation-frontend/test/controller/questionnaire_customer_controller_test.dart
@@ -49,7 +49,7 @@ void main() {
.thenAnswer((_) async => http.Response(_customerJson, 200));
var dto = await controller.get(id: 4);
- expect(dto, isA());
+ expect(dto, isA());
});
test('export a customer', () async {
@@ -67,7 +67,7 @@ void main() {
final client = MockClient();
DiContainer.instance.put(HttpClientUtils, TestHttpCLientUtilsImpl(client));
- when(client.get(Uri.parse('http://localhost:8080/api/questionnairecustomer/export/4?picture=1'), headers: {"Accept-Language": "en-US"}))
+ when(client.get(Uri.parse('http://localhost:8080/api/questionnairecustomer/export/4?questionnaire=1'), headers: {"Accept-Language": "en-US"}))
.thenAnswer((_) async => http.Response(_customerJson, 200));
var dto = await controller.export(customerId: 4, questionnaireId: 1);
@@ -100,28 +100,24 @@ String _customerJson = '''{
"id": 1,
"name": "Müller Apotheke",
"customerNumber": "1234",
- "pictures": [
+ "city": "Hannover",
+ "zip": "12345",
+ "questionnaires": [
{
"id": 1,
"comment": "good looking picture 1",
"category": null,
- "pictureDate": 1729764570000,
- "evaluation": 1,
+ "questionnaireDate": 1767262170000,
"username": "verboomp",
- "imageUrl": "",
- "normalSizeUrl": "",
- "thumbnailSizeUrl": ""
+ "evaluation": 1
},
{
"id": 2,
"comment": "good looking picture 2",
"category": null,
- "pictureDate": 1729764570000,
- "evaluation": 1,
+ "questionnaireDate": 1767348570000,
"username": "verboomp",
- "imageUrl": "",
- "normalSizeUrl": "",
- "thumbnailSizeUrl": ""
+ "evaluation": 1
}
]
}''';
diff --git a/hartmann-foto-documentation-frontend/test/testing/test_utils.dart b/hartmann-foto-documentation-frontend/test/testing/test_utils.dart
index 171ac39..c8cb2cb 100644
--- a/hartmann-foto-documentation-frontend/test/testing/test_utils.dart
+++ b/hartmann-foto-documentation-frontend/test/testing/test_utils.dart
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
+import 'package:fotodocumentation/controller/questionnaire_controller.dart';
+import 'package:fotodocumentation/controller/questionnaire_customer_controller.dart';
import 'package:http/http.dart' as http;
import 'package:mockito/annotations.dart';
@@ -66,6 +68,8 @@ Future pumpAppConfig(WidgetTester tester, String initialLocation) async {
FotoCustomerController,
PictureController,
JwtTokenStorage,
+ QuestionnaireController,
+ QuestionnaireCustomerControllerImpl,
http.Client,
])
void main() {}
diff --git a/hartmann-foto-documentation-frontend/test/testing/test_utils.mocks.dart b/hartmann-foto-documentation-frontend/test/testing/test_utils.mocks.dart
index e9ca159..a8595d5 100644
--- a/hartmann-foto-documentation-frontend/test/testing/test_utils.mocks.dart
+++ b/hartmann-foto-documentation-frontend/test/testing/test_utils.mocks.dart
@@ -3,22 +3,32 @@
// Do not manually edit this file.
// ignore_for_file: no_leading_underscores_for_library_prefixes
-import 'dart:async' as _i7;
-import 'dart:convert' as _i14;
-import 'dart:typed_data' as _i15;
-import 'dart:ui' as _i5;
+import 'dart:async' as _i10;
+import 'dart:convert' as _i21;
+import 'dart:typed_data' as _i22;
+import 'dart:ui' as _i8;
-import 'package:fotodocumentation/controller/foto_customer_controller.dart' as _i9;
-import 'package:fotodocumentation/controller/login_controller.dart' as _i6;
-import 'package:fotodocumentation/controller/picture_controller.dart' as _i11;
-import 'package:fotodocumentation/dto/customer_dto.dart' as _i10;
-import 'package:fotodocumentation/dto/jwt_token_pair_dto.dart' as _i8;
-import 'package:fotodocumentation/dto/picture_dto.dart' as _i12;
-import 'package:fotodocumentation/utils/jwt_token_storage.dart' as _i13;
-import 'package:fotodocumentation/utils/login_credentials.dart' as _i3;
-import 'package:http/http.dart' as _i2;
+import 'package:fotodocumentation/controller/base_controller.dart' as _i4;
+import 'package:fotodocumentation/controller/foto_customer_controller.dart'
+ as _i12;
+import 'package:fotodocumentation/controller/login_controller.dart' as _i9;
+import 'package:fotodocumentation/controller/picture_controller.dart' as _i14;
+import 'package:fotodocumentation/controller/questionnaire_controller.dart'
+ as _i17;
+import 'package:fotodocumentation/controller/questionnaire_customer_controller.dart'
+ as _i19;
+import 'package:fotodocumentation/dto/customer_dto.dart' as _i13;
+import 'package:fotodocumentation/dto/jwt_token_pair_dto.dart' as _i11;
+import 'package:fotodocumentation/dto/picture_dto.dart' as _i15;
+import 'package:fotodocumentation/dto/questionnaire_customer_dto.dart' as _i20;
+import 'package:fotodocumentation/dto/questionnaire_dto.dart' as _i18;
+import 'package:fotodocumentation/utils/http_client_utils.dart' as _i3;
+import 'package:fotodocumentation/utils/jwt_token_storage.dart' as _i16;
+import 'package:fotodocumentation/utils/login_credentials.dart' as _i6;
+import 'package:fotodocumentation/utils/url_utils.dart' as _i2;
+import 'package:http/http.dart' as _i5;
import 'package:mockito/mockito.dart' as _i1;
-import 'package:mockito/src/dummies.dart' as _i4;
+import 'package:mockito/src/dummies.dart' as _i7;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
@@ -35,8 +45,8 @@ import 'package:mockito/src/dummies.dart' as _i4;
// ignore_for_file: subtype_of_sealed_class
// ignore_for_file: invalid_use_of_internal_member
-class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
- _FakeResponse_0(
+class _FakeUrlUtils_0 extends _i1.SmartFake implements _i2.UrlUtils {
+ _FakeUrlUtils_0(
Object parent,
Invocation parentInvocation,
) : super(
@@ -45,9 +55,50 @@ class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
);
}
-class _FakeStreamedResponse_1 extends _i1.SmartFake
- implements _i2.StreamedResponse {
- _FakeStreamedResponse_1(
+class _FakeHttpClientUtils_1 extends _i1.SmartFake
+ implements _i3.HttpClientUtils {
+ _FakeHttpClientUtils_1(
+ Object parent,
+ Invocation parentInvocation,
+ ) : super(
+ parent,
+ parentInvocation,
+ );
+}
+
+class _FakeHeader_2 extends _i1.SmartFake implements _i4.Header {
+ _FakeHeader_2(
+ Object parent,
+ Invocation parentInvocation,
+ ) : super(
+ parent,
+ parentInvocation,
+ );
+}
+
+class _FakeException_3 extends _i1.SmartFake implements Exception {
+ _FakeException_3(
+ Object parent,
+ Invocation parentInvocation,
+ ) : super(
+ parent,
+ parentInvocation,
+ );
+}
+
+class _FakeResponse_4 extends _i1.SmartFake implements _i5.Response {
+ _FakeResponse_4(
+ Object parent,
+ Invocation parentInvocation,
+ ) : super(
+ parent,
+ parentInvocation,
+ );
+}
+
+class _FakeStreamedResponse_5 extends _i1.SmartFake
+ implements _i5.StreamedResponse {
+ _FakeStreamedResponse_5(
Object parent,
Invocation parentInvocation,
) : super(
@@ -59,7 +110,7 @@ class _FakeStreamedResponse_1 extends _i1.SmartFake
/// A class which mocks [LoginCredentials].
///
/// See the documentation for Mockito's code generation for more information.
-class MockLoginCredentials extends _i1.Mock implements _i3.LoginCredentials {
+class MockLoginCredentials extends _i1.Mock implements _i6.LoginCredentials {
MockLoginCredentials() {
_i1.throwOnMissingStub(this);
}
@@ -67,7 +118,7 @@ class MockLoginCredentials extends _i1.Mock implements _i3.LoginCredentials {
@override
String get fullname => (super.noSuchMethod(
Invocation.getter(#fullname),
- returnValue: _i4.dummyValue(
+ returnValue: _i7.dummyValue(
this,
Invocation.getter(#fullname),
),
@@ -104,7 +155,7 @@ class MockLoginCredentials extends _i1.Mock implements _i3.LoginCredentials {
);
@override
- void addListener(_i5.VoidCallback? listener) => super.noSuchMethod(
+ void addListener(_i8.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#addListener,
[listener],
@@ -113,7 +164,7 @@ class MockLoginCredentials extends _i1.Mock implements _i3.LoginCredentials {
);
@override
- void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod(
+ void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod(
Invocation.method(
#removeListener,
[listener],
@@ -143,13 +194,13 @@ class MockLoginCredentials extends _i1.Mock implements _i3.LoginCredentials {
/// A class which mocks [LoginController].
///
/// See the documentation for Mockito's code generation for more information.
-class MockLoginController extends _i1.Mock implements _i6.LoginController {
+class MockLoginController extends _i1.Mock implements _i9.LoginController {
MockLoginController() {
_i1.throwOnMissingStub(this);
}
@override
- _i7.Future<({_i8.JwtTokenPairDto? jwtTokenPairDto})> authenticate(
+ _i10.Future<({_i11.JwtTokenPairDto? jwtTokenPairDto})> authenticate(
String? username,
String? password,
) =>
@@ -161,18 +212,19 @@ class MockLoginController extends _i1.Mock implements _i6.LoginController {
password,
],
),
- returnValue: _i7.Future<({_i8.JwtTokenPairDto? jwtTokenPairDto})>.value(
- (jwtTokenPairDto: null)),
- ) as _i7.Future<({_i8.JwtTokenPairDto? jwtTokenPairDto})>);
+ returnValue:
+ _i10.Future<({_i11.JwtTokenPairDto? jwtTokenPairDto})>.value(
+ (jwtTokenPairDto: null)),
+ ) as _i10.Future<({_i11.JwtTokenPairDto? jwtTokenPairDto})>);
@override
- _i7.Future refreshAccessToken() => (super.noSuchMethod(
+ _i10.Future refreshAccessToken() => (super.noSuchMethod(
Invocation.method(
#refreshAccessToken,
[],
),
- returnValue: _i7.Future.value(false),
- ) as _i7.Future);
+ returnValue: _i10.Future.value(false),
+ ) as _i10.Future);
@override
bool isUsingJwtAuth() => (super.noSuchMethod(
@@ -184,17 +236,17 @@ class MockLoginController extends _i1.Mock implements _i6.LoginController {
) as bool);
}
-/// A class which mocks [CustomerController].
+/// A class which mocks [FotoCustomerController].
///
/// See the documentation for Mockito's code generation for more information.
-class MockCustomerController extends _i1.Mock
- implements _i9.FotoCustomerController {
- MockCustomerController() {
+class MockFotoCustomerController extends _i1.Mock
+ implements _i12.FotoCustomerController {
+ MockFotoCustomerController() {
_i1.throwOnMissingStub(this);
}
@override
- _i7.Future> getAll(
+ _i10.Future> getAll(
String? query,
String? startsWith,
) =>
@@ -206,22 +258,22 @@ class MockCustomerController extends _i1.Mock
startsWith,
],
),
- returnValue: _i7.Future>.value(
- <_i10.CustomerListDto>[]),
- ) as _i7.Future>);
+ returnValue: _i10.Future>.value(
+ <_i13.CustomerListDto>[]),
+ ) as _i10.Future>);
@override
- _i7.Future<_i10.CustomerDto?> get({required int? id}) => (super.noSuchMethod(
+ _i10.Future<_i13.CustomerDto?> get({required int? id}) => (super.noSuchMethod(
Invocation.method(
#get,
[],
{#id: id},
),
- returnValue: _i7.Future<_i10.CustomerDto?>.value(),
- ) as _i7.Future<_i10.CustomerDto?>);
+ returnValue: _i10.Future<_i13.CustomerDto?>.value(),
+ ) as _i10.Future<_i13.CustomerDto?>);
@override
- _i7.Future> export({
+ _i10.Future> export({
required int? customerId,
int? pictureId,
}) =>
@@ -234,42 +286,42 @@ class MockCustomerController extends _i1.Mock
#pictureId: pictureId,
},
),
- returnValue: _i7.Future>.value([]),
- ) as _i7.Future>);
+ returnValue: _i10.Future>.value([]),
+ ) as _i10.Future>);
}
/// A class which mocks [PictureController].
///
/// See the documentation for Mockito's code generation for more information.
-class MockPictureController extends _i1.Mock implements _i11.PictureController {
+class MockPictureController extends _i1.Mock implements _i14.PictureController {
MockPictureController() {
_i1.throwOnMissingStub(this);
}
@override
- _i7.Future delete(_i12.PictureDto? dto) => (super.noSuchMethod(
+ _i10.Future delete(_i15.PictureDto? dto) => (super.noSuchMethod(
Invocation.method(
#delete,
[dto],
),
- returnValue: _i7.Future.value(false),
- ) as _i7.Future);
+ returnValue: _i10.Future.value(false),
+ ) as _i10.Future);
@override
- _i7.Future updateEvaluation(_i12.PictureDto? dto) =>
+ _i10.Future updateEvaluation(_i15.PictureDto? dto) =>
(super.noSuchMethod(
Invocation.method(
#updateEvaluation,
[dto],
),
- returnValue: _i7.Future.value(false),
- ) as _i7.Future);
+ returnValue: _i10.Future.value(false),
+ ) as _i10.Future);
}
/// A class which mocks [JwtTokenStorage].
///
/// See the documentation for Mockito's code generation for more information.
-class MockJwtTokenStorage extends _i1.Mock implements _i13.JwtTokenStorage {
+class MockJwtTokenStorage extends _i1.Mock implements _i16.JwtTokenStorage {
MockJwtTokenStorage() {
_i1.throwOnMissingStub(this);
}
@@ -318,16 +370,217 @@ class MockJwtTokenStorage extends _i1.Mock implements _i13.JwtTokenStorage {
);
}
+/// A class which mocks [QuestionnaireController].
+///
+/// See the documentation for Mockito's code generation for more information.
+class MockQuestionnaireController extends _i1.Mock
+ implements _i17.QuestionnaireController {
+ MockQuestionnaireController() {
+ _i1.throwOnMissingStub(this);
+ }
+
+ @override
+ _i10.Future delete(_i18.QuestionnaireDto? dto) => (super.noSuchMethod(
+ Invocation.method(
+ #delete,
+ [dto],
+ ),
+ returnValue: _i10.Future.value(false),
+ ) as _i10.Future);
+
+ @override
+ _i10.Future updateEvaluation(_i18.QuestionnaireDto? dto) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #updateEvaluation,
+ [dto],
+ ),
+ returnValue: _i10.Future.value(false),
+ ) as _i10.Future);
+}
+
+/// A class which mocks [QuestionnaireCustomerControllerImpl].
+///
+/// See the documentation for Mockito's code generation for more information.
+class MockQuestionnaireCustomerControllerImpl extends _i1.Mock
+ implements _i19.QuestionnaireCustomerControllerImpl {
+ MockQuestionnaireCustomerControllerImpl() {
+ _i1.throwOnMissingStub(this);
+ }
+
+ @override
+ String get path => (super.noSuchMethod(
+ Invocation.getter(#path),
+ returnValue: _i7.dummyValue(
+ this,
+ Invocation.getter(#path),
+ ),
+ ) as String);
+
+ @override
+ _i2.UrlUtils get uriUtils => (super.noSuchMethod(
+ Invocation.getter(#uriUtils),
+ returnValue: _FakeUrlUtils_0(
+ this,
+ Invocation.getter(#uriUtils),
+ ),
+ ) as _i2.UrlUtils);
+
+ @override
+ _i3.HttpClientUtils get httpClientUtils => (super.noSuchMethod(
+ Invocation.getter(#httpClientUtils),
+ returnValue: _FakeHttpClientUtils_1(
+ this,
+ Invocation.getter(#httpClientUtils),
+ ),
+ ) as _i3.HttpClientUtils);
+
+ @override
+ _i10.Future> getAll(
+ String? query,
+ String? startsWith,
+ ) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #getAll,
+ [
+ query,
+ startsWith,
+ ],
+ ),
+ returnValue: _i10.Future>.value(
+ <_i20.QuestionnaireCustomerListDto>[]),
+ ) as _i10.Future>);
+
+ @override
+ _i10.Future<_i20.QuestionnaireCustomerDto?> get({required int? id}) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #get,
+ [],
+ {#id: id},
+ ),
+ returnValue: _i10.Future<_i20.QuestionnaireCustomerDto?>.value(),
+ ) as _i10.Future<_i20.QuestionnaireCustomerDto?>);
+
+ @override
+ _i10.Future> export({
+ required int? customerId,
+ int? questionnaireId,
+ }) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #export,
+ [],
+ {
+ #customerId: customerId,
+ #questionnaireId: questionnaireId,
+ },
+ ),
+ returnValue: _i10.Future>.value([]),
+ ) as _i10.Future>);
+
+ @override
+ _i4.Header getAuthHeader() => (super.noSuchMethod(
+ Invocation.method(
+ #getAuthHeader,
+ [],
+ ),
+ returnValue: _FakeHeader_2(
+ this,
+ Invocation.method(
+ #getAuthHeader,
+ [],
+ ),
+ ),
+ ) as _i4.Header);
+
+ @override
+ Exception getServerError(_i5.Response? response) => (super.noSuchMethod(
+ Invocation.method(
+ #getServerError,
+ [response],
+ ),
+ returnValue: _FakeException_3(
+ this,
+ Invocation.method(
+ #getServerError,
+ [response],
+ ),
+ ),
+ ) as Exception);
+
+ @override
+ _i10.Future> runGetListWithAuth(
+ String? uriStr,
+ List Function(dynamic)? convert,
+ ) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #runGetListWithAuth,
+ [
+ uriStr,
+ convert,
+ ],
+ ),
+ returnValue: _i10.Future>.value([]),
+ ) as _i10.Future>);
+
+ @override
+ _i10.Future runGetWithAuth(
+ String? uriStr,
+ T Function(dynamic)? convert,
+ ) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #runGetWithAuth,
+ [
+ uriStr,
+ convert,
+ ],
+ ),
+ returnValue: _i10.Future.value(),
+ ) as _i10.Future);
+
+ @override
+ _i10.Future> runGetBytesWithAuth(String? uriStr) =>
+ (super.noSuchMethod(
+ Invocation.method(
+ #runGetBytesWithAuth,
+ [uriStr],
+ ),
+ returnValue: _i10.Future>.value([]),
+ ) as _i10.Future>);
+
+ @override
+ _i10.Future runDeleteWithAuth(String? uriStr) => (super.noSuchMethod(
+ Invocation.method(
+ #runDeleteWithAuth,
+ [uriStr],
+ ),
+ returnValue: _i10.Future.value(false),
+ ) as _i10.Future);
+
+ @override
+ _i10.Future runPutWithAuth(String? uriStr) => (super.noSuchMethod(
+ Invocation.method(
+ #runPutWithAuth,
+ [uriStr],
+ ),
+ returnValue: _i10.Future.value(false),
+ ) as _i10.Future);
+}
+
/// A class which mocks [Client].
///
/// See the documentation for Mockito's code generation for more information.
-class MockClient extends _i1.Mock implements _i2.Client {
+class MockClient extends _i1.Mock implements _i5.Client {
MockClient() {
_i1.throwOnMissingStub(this);
}
@override
- _i7.Future<_i2.Response> head(
+ _i10.Future<_i5.Response> head(
Uri? url, {
Map? headers,
}) =>
@@ -337,7 +590,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
[url],
{#headers: headers},
),
- returnValue: _i7.Future<_i2.Response>.value(_FakeResponse_0(
+ returnValue: _i10.Future<_i5.Response>.value(_FakeResponse_4(
this,
Invocation.method(
#head,
@@ -345,10 +598,10 @@ class MockClient extends _i1.Mock implements _i2.Client {
{#headers: headers},
),
)),
- ) as _i7.Future<_i2.Response>);
+ ) as _i10.Future<_i5.Response>);
@override
- _i7.Future<_i2.Response> get(
+ _i10.Future<_i5.Response> get(
Uri? url, {
Map? headers,
}) =>
@@ -358,7 +611,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
[url],
{#headers: headers},
),
- returnValue: _i7.Future<_i2.Response>.value(_FakeResponse_0(
+ returnValue: _i10.Future<_i5.Response>.value(_FakeResponse_4(
this,
Invocation.method(
#get,
@@ -366,14 +619,14 @@ class MockClient extends _i1.Mock implements _i2.Client {
{#headers: headers},
),
)),
- ) as _i7.Future<_i2.Response>);
+ ) as _i10.Future<_i5.Response>);
@override
- _i7.Future<_i2.Response> post(
+ _i10.Future<_i5.Response> post(
Uri? url, {
Map? headers,
Object? body,
- _i14.Encoding? encoding,
+ _i21.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -385,7 +638,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
#encoding: encoding,
},
),
- returnValue: _i7.Future<_i2.Response>.value(_FakeResponse_0(
+ returnValue: _i10.Future<_i5.Response>.value(_FakeResponse_4(
this,
Invocation.method(
#post,
@@ -397,14 +650,14 @@ class MockClient extends _i1.Mock implements _i2.Client {
},
),
)),
- ) as _i7.Future<_i2.Response>);
+ ) as _i10.Future<_i5.Response>);
@override
- _i7.Future<_i2.Response> put(
+ _i10.Future<_i5.Response> put(
Uri? url, {
Map? headers,
Object? body,
- _i14.Encoding? encoding,
+ _i21.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -416,7 +669,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
#encoding: encoding,
},
),
- returnValue: _i7.Future<_i2.Response>.value(_FakeResponse_0(
+ returnValue: _i10.Future<_i5.Response>.value(_FakeResponse_4(
this,
Invocation.method(
#put,
@@ -428,14 +681,14 @@ class MockClient extends _i1.Mock implements _i2.Client {
},
),
)),
- ) as _i7.Future<_i2.Response>);
+ ) as _i10.Future<_i5.Response>);
@override
- _i7.Future<_i2.Response> patch(
+ _i10.Future<_i5.Response> patch(
Uri? url, {
Map? headers,
Object? body,
- _i14.Encoding? encoding,
+ _i21.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -447,7 +700,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
#encoding: encoding,
},
),
- returnValue: _i7.Future<_i2.Response>.value(_FakeResponse_0(
+ returnValue: _i10.Future<_i5.Response>.value(_FakeResponse_4(
this,
Invocation.method(
#patch,
@@ -459,14 +712,14 @@ class MockClient extends _i1.Mock implements _i2.Client {
},
),
)),
- ) as _i7.Future<_i2.Response>);
+ ) as _i10.Future<_i5.Response>);
@override
- _i7.Future<_i2.Response> delete(
+ _i10.Future<_i5.Response> delete(
Uri? url, {
Map? headers,
Object? body,
- _i14.Encoding? encoding,
+ _i21.Encoding? encoding,
}) =>
(super.noSuchMethod(
Invocation.method(
@@ -478,7 +731,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
#encoding: encoding,
},
),
- returnValue: _i7.Future<_i2.Response>.value(_FakeResponse_0(
+ returnValue: _i10.Future<_i5.Response>.value(_FakeResponse_4(
this,
Invocation.method(
#delete,
@@ -490,10 +743,10 @@ class MockClient extends _i1.Mock implements _i2.Client {
},
),
)),
- ) as _i7.Future<_i2.Response>);
+ ) as _i10.Future<_i5.Response>);
@override
- _i7.Future read(
+ _i10.Future read(
Uri? url, {
Map? headers,
}) =>
@@ -503,7 +756,7 @@ class MockClient extends _i1.Mock implements _i2.Client {
[url],
{#headers: headers},
),
- returnValue: _i7.Future.value(_i4.dummyValue(
+ returnValue: _i10.Future.value(_i7.dummyValue(
this,
Invocation.method(
#read,
@@ -511,10 +764,10 @@ class MockClient extends _i1.Mock implements _i2.Client {
{#headers: headers},
),
)),
- ) as _i7.Future);
+ ) as _i10.Future);
@override
- _i7.Future<_i15.Uint8List> readBytes(
+ _i10.Future<_i22.Uint8List> readBytes(
Uri? url, {
Map? headers,
}) =>
@@ -524,25 +777,25 @@ class MockClient extends _i1.Mock implements _i2.Client {
[url],
{#headers: headers},
),
- returnValue: _i7.Future<_i15.Uint8List>.value(_i15.Uint8List(0)),
- ) as _i7.Future<_i15.Uint8List>);
+ returnValue: _i10.Future<_i22.Uint8List>.value(_i22.Uint8List(0)),
+ ) as _i10.Future<_i22.Uint8List>);
@override
- _i7.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
+ _i10.Future<_i5.StreamedResponse> send(_i5.BaseRequest? request) =>
(super.noSuchMethod(
Invocation.method(
#send,
[request],
),
returnValue:
- _i7.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
+ _i10.Future<_i5.StreamedResponse>.value(_FakeStreamedResponse_5(
this,
Invocation.method(
#send,
[request],
),
)),
- ) as _i7.Future<_i2.StreamedResponse>);
+ ) as _i10.Future<_i5.StreamedResponse>);
@override
void close() => super.noSuchMethod(