feat: BLoC tests complets + sécurité production + freerasp 7.5.1 migration

## Tests BLoC (Task P2.4 Mobile)
- 25 nouveaux fichiers *_bloc_test.dart + mocks générés (build_runner)
- Features couvertes : authentication, admin_users, adhesions, backup,
  communication/messaging, contributions, dashboard, finance (approval/budget),
  events, explore/network, feed, logs_monitoring, notifications, onboarding,
  organizations (switcher/types/CRUD), profile, reports, settings, solidarity
- ~380 tests, > 80% coverage BLoCs

## Sécurité Production (Task P2.2)
- lib/core/security/app_integrity_service.dart (freerasp 7.5.1)
- Migration API breaking changes freerasp 7.5.1 :
  - onRootDetected → onPrivilegedAccess
  - onDebuggerDetected → onDebug
  - onSignatureDetected → onAppIntegrity
  - onHookDetected → onHooks
  - onEmulatorDetected → onSimulator
  - onUntrustedInstallationSourceDetected → onUnofficialStore
  - onDeviceBindingDetected → onDeviceBinding
  - onObfuscationIssuesDetected → onObfuscationIssues
  - Talsec.start() split → start() + attachListener()
  - const AndroidConfig/IOSConfig → final (constructors call ConfigVerifier)
  - supportedAlternativeStores → supportedStores

## Pubspec
- bloc_test: ^9.1.7 → ^10.0.0 (compat flutter_bloc ^9.0.0)
- freerasp 7.5.1

## Config
- android/app/build.gradle : ajustements release
- lib/core/config/environment.dart : URLs API actualisées
- lib/main.dart + app_router : intégrations sécurité/BLoC

## Cleanup
- Suppression docs intermédiaires (TACHES_*.md, TASK_*_COMPLETION_REPORT.md,
  TESTS_UNITAIRES_PROGRESS.md)
- .g.dart régénérés (json_serializable)
- .mocks.dart régénérés (mockito)

## Résultat
- 142 fichiers, +27 596 insertions
- Toutes les tâches P2 mobile complétées

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
dahoud
2026-04-21 12:42:35 +00:00
parent 33f5b5a707
commit 37db88672b
142 changed files with 27599 additions and 16068 deletions

View File

@@ -46,24 +46,14 @@ import 'package:unionflow_mobile_apps/shared/models/membre_search_result.dart'
class _FakeMembreSearchResult_0 extends _i1.SmartFake
implements _i2.MembreSearchResult {
_FakeMembreSearchResult_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeMembreSearchResult_0(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
class _FakeMembreCompletModel_1 extends _i1.SmartFake
implements _i3.MembreCompletModel {
_FakeMembreCompletModel_1(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
_FakeMembreCompletModel_1(Object parent, Invocation parentInvocation)
: super(parent, parentInvocation);
}
/// A class which mocks [GetMembers].
@@ -81,29 +71,23 @@ class MockGetMembers extends _i1.Mock implements _i4.GetMembers {
String? recherche,
}) =>
(super.noSuchMethod(
Invocation.method(
#call,
[],
{
#page: page,
#size: size,
#recherche: recherche,
},
),
returnValue:
_i5.Future<_i2.MembreSearchResult>.value(_FakeMembreSearchResult_0(
this,
Invocation.method(
#call,
[],
{
Invocation.method(#call, [], {
#page: page,
#size: size,
#recherche: recherche,
},
),
)),
) as _i5.Future<_i2.MembreSearchResult>);
}),
returnValue: _i5.Future<_i2.MembreSearchResult>.value(
_FakeMembreSearchResult_0(
this,
Invocation.method(#call, [], {
#page: page,
#size: size,
#recherche: recherche,
}),
),
),
)
as _i5.Future<_i2.MembreSearchResult>);
}
/// A class which mocks [GetMemberById].
@@ -115,13 +99,12 @@ class MockGetMemberById extends _i1.Mock implements _i6.GetMemberById {
}
@override
_i5.Future<_i3.MembreCompletModel?> call(String? id) => (super.noSuchMethod(
Invocation.method(
#call,
[id],
),
returnValue: _i5.Future<_i3.MembreCompletModel?>.value(),
) as _i5.Future<_i3.MembreCompletModel?>);
_i5.Future<_i3.MembreCompletModel?> call(String? id) =>
(super.noSuchMethod(
Invocation.method(#call, [id]),
returnValue: _i5.Future<_i3.MembreCompletModel?>.value(),
)
as _i5.Future<_i3.MembreCompletModel?>);
}
/// A class which mocks [CreateMember].
@@ -135,19 +118,15 @@ class MockCreateMember extends _i1.Mock implements _i7.CreateMember {
@override
_i5.Future<_i3.MembreCompletModel> call(_i3.MembreCompletModel? membre) =>
(super.noSuchMethod(
Invocation.method(
#call,
[membre],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#call,
[membre],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
Invocation.method(#call, [membre]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#call, [membre]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
}
/// A class which mocks [UpdateMember].
@@ -164,25 +143,15 @@ class MockUpdateMember extends _i1.Mock implements _i8.UpdateMember {
_i3.MembreCompletModel? membre,
) =>
(super.noSuchMethod(
Invocation.method(
#call,
[
id,
membre,
],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#call,
[
id,
membre,
],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
Invocation.method(#call, [id, membre]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#call, [id, membre]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
}
/// A class which mocks [DeleteMember].
@@ -194,14 +163,13 @@ class MockDeleteMember extends _i1.Mock implements _i9.DeleteMember {
}
@override
_i5.Future<void> call(String? id) => (super.noSuchMethod(
Invocation.method(
#call,
[id],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
_i5.Future<void> call(String? id) =>
(super.noSuchMethod(
Invocation.method(#call, [id]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
}
/// A class which mocks [SearchMembers].
@@ -219,29 +187,23 @@ class MockSearchMembers extends _i1.Mock implements _i10.SearchMembers {
int? size = 20,
}) =>
(super.noSuchMethod(
Invocation.method(
#call,
[],
{
#criteria: criteria,
#page: page,
#size: size,
},
),
returnValue:
_i5.Future<_i2.MembreSearchResult>.value(_FakeMembreSearchResult_0(
this,
Invocation.method(
#call,
[],
{
Invocation.method(#call, [], {
#criteria: criteria,
#page: page,
#size: size,
},
),
)),
) as _i5.Future<_i2.MembreSearchResult>);
}),
returnValue: _i5.Future<_i2.MembreSearchResult>.value(
_FakeMembreSearchResult_0(
this,
Invocation.method(#call, [], {
#criteria: criteria,
#page: page,
#size: size,
}),
),
),
)
as _i5.Future<_i2.MembreSearchResult>);
}
/// A class which mocks [GetMemberStats].
@@ -253,14 +215,14 @@ class MockGetMemberStats extends _i1.Mock implements _i12.GetMemberStats {
}
@override
_i5.Future<Map<String, dynamic>> call() => (super.noSuchMethod(
Invocation.method(
#call,
[],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
_i5.Future<Map<String, dynamic>> call() =>
(super.noSuchMethod(
Invocation.method(#call, []),
returnValue: _i5.Future<Map<String, dynamic>>.value(
<String, dynamic>{},
),
)
as _i5.Future<Map<String, dynamic>>);
}
/// A class which mocks [IMembreRepository].
@@ -278,57 +240,46 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
String? recherche,
}) =>
(super.noSuchMethod(
Invocation.method(
#getMembres,
[],
{
#page: page,
#size: size,
#recherche: recherche,
},
),
returnValue:
_i5.Future<_i2.MembreSearchResult>.value(_FakeMembreSearchResult_0(
this,
Invocation.method(
#getMembres,
[],
{
Invocation.method(#getMembres, [], {
#page: page,
#size: size,
#recherche: recherche,
},
),
)),
) as _i5.Future<_i2.MembreSearchResult>);
}),
returnValue: _i5.Future<_i2.MembreSearchResult>.value(
_FakeMembreSearchResult_0(
this,
Invocation.method(#getMembres, [], {
#page: page,
#size: size,
#recherche: recherche,
}),
),
),
)
as _i5.Future<_i2.MembreSearchResult>);
@override
_i5.Future<_i3.MembreCompletModel?> getMembreById(String? id) =>
(super.noSuchMethod(
Invocation.method(
#getMembreById,
[id],
),
returnValue: _i5.Future<_i3.MembreCompletModel?>.value(),
) as _i5.Future<_i3.MembreCompletModel?>);
Invocation.method(#getMembreById, [id]),
returnValue: _i5.Future<_i3.MembreCompletModel?>.value(),
)
as _i5.Future<_i3.MembreCompletModel?>);
@override
_i5.Future<_i3.MembreCompletModel> createMembre(
_i3.MembreCompletModel? membre) =>
_i3.MembreCompletModel? membre,
) =>
(super.noSuchMethod(
Invocation.method(
#createMembre,
[membre],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#createMembre,
[membre],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
Invocation.method(#createMembre, [membre]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#createMembre, [membre]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
@override
_i5.Future<_i3.MembreCompletModel> updateMembre(
@@ -336,69 +287,50 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
_i3.MembreCompletModel? membre,
) =>
(super.noSuchMethod(
Invocation.method(
#updateMembre,
[
id,
membre,
],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#updateMembre,
[
id,
membre,
],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
Invocation.method(#updateMembre, [id, membre]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#updateMembre, [id, membre]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
@override
_i5.Future<void> deleteMembre(String? id) => (super.noSuchMethod(
Invocation.method(
#deleteMembre,
[id],
),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
) as _i5.Future<void>);
_i5.Future<void> deleteMembre(String? id) =>
(super.noSuchMethod(
Invocation.method(#deleteMembre, [id]),
returnValue: _i5.Future<void>.value(),
returnValueForMissingStub: _i5.Future<void>.value(),
)
as _i5.Future<void>);
@override
_i5.Future<_i3.MembreCompletModel> activateMembre(String? id) =>
(super.noSuchMethod(
Invocation.method(
#activateMembre,
[id],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#activateMembre,
[id],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
Invocation.method(#activateMembre, [id]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#activateMembre, [id]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
@override
_i5.Future<_i3.MembreCompletModel> deactivateMembre(String? id) =>
(super.noSuchMethod(
Invocation.method(
#deactivateMembre,
[id],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#deactivateMembre,
[id],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
Invocation.method(#deactivateMembre, [id]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#deactivateMembre, [id]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
@override
_i5.Future<_i2.MembreSearchResult> searchMembres({
@@ -407,29 +339,23 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
int? size = 20,
}) =>
(super.noSuchMethod(
Invocation.method(
#searchMembres,
[],
{
#criteria: criteria,
#page: page,
#size: size,
},
),
returnValue:
_i5.Future<_i2.MembreSearchResult>.value(_FakeMembreSearchResult_0(
this,
Invocation.method(
#searchMembres,
[],
{
Invocation.method(#searchMembres, [], {
#criteria: criteria,
#page: page,
#size: size,
},
),
)),
) as _i5.Future<_i2.MembreSearchResult>);
}),
returnValue: _i5.Future<_i2.MembreSearchResult>.value(
_FakeMembreSearchResult_0(
this,
Invocation.method(#searchMembres, [], {
#criteria: criteria,
#page: page,
#size: size,
}),
),
),
)
as _i5.Future<_i2.MembreSearchResult>);
@override
_i5.Future<_i2.MembreSearchResult> getActiveMembers({
@@ -437,27 +363,21 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
int? size = 20,
}) =>
(super.noSuchMethod(
Invocation.method(
#getActiveMembers,
[],
{
#page: page,
#size: size,
},
),
returnValue:
_i5.Future<_i2.MembreSearchResult>.value(_FakeMembreSearchResult_0(
this,
Invocation.method(
#getActiveMembers,
[],
{
Invocation.method(#getActiveMembers, [], {
#page: page,
#size: size,
},
),
)),
) as _i5.Future<_i2.MembreSearchResult>);
}),
returnValue: _i5.Future<_i2.MembreSearchResult>.value(
_FakeMembreSearchResult_0(
this,
Invocation.method(#getActiveMembers, [], {
#page: page,
#size: size,
}),
),
),
)
as _i5.Future<_i2.MembreSearchResult>);
@override
_i5.Future<_i2.MembreSearchResult> getBureauMembers({
@@ -465,54 +385,44 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
int? size = 20,
}) =>
(super.noSuchMethod(
Invocation.method(
#getBureauMembers,
[],
{
#page: page,
#size: size,
},
),
returnValue:
_i5.Future<_i2.MembreSearchResult>.value(_FakeMembreSearchResult_0(
this,
Invocation.method(
#getBureauMembers,
[],
{
Invocation.method(#getBureauMembers, [], {
#page: page,
#size: size,
},
),
)),
) as _i5.Future<_i2.MembreSearchResult>);
}),
returnValue: _i5.Future<_i2.MembreSearchResult>.value(
_FakeMembreSearchResult_0(
this,
Invocation.method(#getBureauMembers, [], {
#page: page,
#size: size,
}),
),
),
)
as _i5.Future<_i2.MembreSearchResult>);
@override
_i5.Future<Map<String, dynamic>> getMembresStats() => (super.noSuchMethod(
Invocation.method(
#getMembresStats,
[],
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
_i5.Future<Map<String, dynamic>> getMembresStats() =>
(super.noSuchMethod(
Invocation.method(#getMembresStats, []),
returnValue: _i5.Future<Map<String, dynamic>>.value(
<String, dynamic>{},
),
)
as _i5.Future<Map<String, dynamic>>);
@override
_i5.Future<_i3.MembreCompletModel> resetMotDePasse(String? id) =>
(super.noSuchMethod(
Invocation.method(
#resetMotDePasse,
[id],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#resetMotDePasse,
[id],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
Invocation.method(#resetMotDePasse, [id]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#resetMotDePasse, [id]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
@override
_i5.Future<_i3.MembreCompletModel> affecterOrganisation(
@@ -520,25 +430,21 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
String? organisationId,
) =>
(super.noSuchMethod(
Invocation.method(
#affecterOrganisation,
[
membreId,
organisationId,
],
),
returnValue:
_i5.Future<_i3.MembreCompletModel>.value(_FakeMembreCompletModel_1(
this,
Invocation.method(
#affecterOrganisation,
[
Invocation.method(#affecterOrganisation, [
membreId,
organisationId,
],
),
)),
) as _i5.Future<_i3.MembreCompletModel>);
]),
returnValue: _i5.Future<_i3.MembreCompletModel>.value(
_FakeMembreCompletModel_1(
this,
Invocation.method(#affecterOrganisation, [
membreId,
organisationId,
]),
),
),
)
as _i5.Future<_i3.MembreCompletModel>);
@override
_i5.Future<Map<String, dynamic>> inviterMembre(
@@ -547,17 +453,16 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
String? roleOrg,
}) =>
(super.noSuchMethod(
Invocation.method(
#inviterMembre,
[
membreId,
organisationId,
],
{#roleOrg: roleOrg},
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
Invocation.method(
#inviterMembre,
[membreId, organisationId],
{#roleOrg: roleOrg},
),
returnValue: _i5.Future<Map<String, dynamic>>.value(
<String, dynamic>{},
),
)
as _i5.Future<Map<String, dynamic>>);
@override
_i5.Future<Map<String, dynamic>> activerAdhesion(
@@ -566,17 +471,16 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
String? motif,
}) =>
(super.noSuchMethod(
Invocation.method(
#activerAdhesion,
[
membreId,
organisationId,
],
{#motif: motif},
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
Invocation.method(
#activerAdhesion,
[membreId, organisationId],
{#motif: motif},
),
returnValue: _i5.Future<Map<String, dynamic>>.value(
<String, dynamic>{},
),
)
as _i5.Future<Map<String, dynamic>>);
@override
_i5.Future<Map<String, dynamic>> suspendrAdhesion(
@@ -585,17 +489,16 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
String? motif,
}) =>
(super.noSuchMethod(
Invocation.method(
#suspendrAdhesion,
[
membreId,
organisationId,
],
{#motif: motif},
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
Invocation.method(
#suspendrAdhesion,
[membreId, organisationId],
{#motif: motif},
),
returnValue: _i5.Future<Map<String, dynamic>>.value(
<String, dynamic>{},
),
)
as _i5.Future<Map<String, dynamic>>);
@override
_i5.Future<Map<String, dynamic>> radierAdhesion(
@@ -604,15 +507,14 @@ class MockIMembreRepository extends _i1.Mock implements _i13.IMembreRepository {
String? motif,
}) =>
(super.noSuchMethod(
Invocation.method(
#radierAdhesion,
[
membreId,
organisationId,
],
{#motif: motif},
),
returnValue:
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
) as _i5.Future<Map<String, dynamic>>);
Invocation.method(
#radierAdhesion,
[membreId, organisationId],
{#motif: motif},
),
returnValue: _i5.Future<Map<String, dynamic>>.value(
<String, dynamic>{},
),
)
as _i5.Future<Map<String, dynamic>>);
}