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:
@@ -30,35 +30,20 @@ import 'package:unionflow_mobile_apps/features/contributions/domain/repositories
|
||||
|
||||
class _FakeContributionPageResult_0 extends _i1.SmartFake
|
||||
implements _i2.ContributionPageResult {
|
||||
_FakeContributionPageResult_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeContributionPageResult_0(Object parent, Invocation parentInvocation)
|
||||
: super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeContributionModel_1 extends _i1.SmartFake
|
||||
implements _i3.ContributionModel {
|
||||
_FakeContributionModel_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeContributionModel_1(Object parent, Invocation parentInvocation)
|
||||
: super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
class _FakeWavePaiementInitResult_2 extends _i1.SmartFake
|
||||
implements _i2.WavePaiementInitResult {
|
||||
_FakeWavePaiementInitResult_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
_FakeWavePaiementInitResult_2(Object parent, Invocation parentInvocation)
|
||||
: super(parent, parentInvocation);
|
||||
}
|
||||
|
||||
/// A class which mocks [IContributionRepository].
|
||||
@@ -76,62 +61,49 @@ class MockIContributionRepository extends _i1.Mock
|
||||
int? size = 50,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getMesCotisations,
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#size: size,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.ContributionPageResult>.value(
|
||||
_FakeContributionPageResult_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getMesCotisations,
|
||||
[],
|
||||
{
|
||||
Invocation.method(#getMesCotisations, [], {
|
||||
#page: page,
|
||||
#size: size,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.ContributionPageResult>);
|
||||
}),
|
||||
returnValue: _i5.Future<_i2.ContributionPageResult>.value(
|
||||
_FakeContributionPageResult_0(
|
||||
this,
|
||||
Invocation.method(#getMesCotisations, [], {
|
||||
#page: page,
|
||||
#size: size,
|
||||
}),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.ContributionPageResult>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.ContributionModel> getCotisationById(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCotisationById,
|
||||
[id],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<_i3.ContributionModel>.value(_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCotisationById,
|
||||
[id],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.ContributionModel>);
|
||||
Invocation.method(#getCotisationById, [id]),
|
||||
returnValue: _i5.Future<_i3.ContributionModel>.value(
|
||||
_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(#getCotisationById, [id]),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i3.ContributionModel>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.ContributionModel> createCotisation(
|
||||
_i3.ContributionModel? contribution) =>
|
||||
_i3.ContributionModel? contribution,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#createCotisation,
|
||||
[contribution],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<_i3.ContributionModel>.value(_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#createCotisation,
|
||||
[contribution],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.ContributionModel>);
|
||||
Invocation.method(#createCotisation, [contribution]),
|
||||
returnValue: _i5.Future<_i3.ContributionModel>.value(
|
||||
_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(#createCotisation, [contribution]),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i3.ContributionModel>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.ContributionModel> updateCotisation(
|
||||
@@ -139,35 +111,24 @@ class MockIContributionRepository extends _i1.Mock
|
||||
_i3.ContributionModel? contribution,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateCotisation,
|
||||
[
|
||||
id,
|
||||
contribution,
|
||||
],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<_i3.ContributionModel>.value(_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#updateCotisation,
|
||||
[
|
||||
id,
|
||||
contribution,
|
||||
],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.ContributionModel>);
|
||||
Invocation.method(#updateCotisation, [id, contribution]),
|
||||
returnValue: _i5.Future<_i3.ContributionModel>.value(
|
||||
_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(#updateCotisation, [id, contribution]),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i3.ContributionModel>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> deleteCotisation(String? id) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#deleteCotisation,
|
||||
[id],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
_i5.Future<void> deleteCotisation(String? id) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#deleteCotisation, [id]),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
)
|
||||
as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i3.ContributionModel> enregistrerPaiement(
|
||||
@@ -179,33 +140,35 @@ class MockIContributionRepository extends _i1.Mock
|
||||
String? referencePaiement,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#enregistrerPaiement,
|
||||
[cotisationId],
|
||||
{
|
||||
#montant: montant,
|
||||
#datePaiement: datePaiement,
|
||||
#methodePaiement: methodePaiement,
|
||||
#numeroPaiement: numeroPaiement,
|
||||
#referencePaiement: referencePaiement,
|
||||
},
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<_i3.ContributionModel>.value(_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#enregistrerPaiement,
|
||||
[cotisationId],
|
||||
{
|
||||
#montant: montant,
|
||||
#datePaiement: datePaiement,
|
||||
#methodePaiement: methodePaiement,
|
||||
#numeroPaiement: numeroPaiement,
|
||||
#referencePaiement: referencePaiement,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i3.ContributionModel>);
|
||||
Invocation.method(
|
||||
#enregistrerPaiement,
|
||||
[cotisationId],
|
||||
{
|
||||
#montant: montant,
|
||||
#datePaiement: datePaiement,
|
||||
#methodePaiement: methodePaiement,
|
||||
#numeroPaiement: numeroPaiement,
|
||||
#referencePaiement: referencePaiement,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i3.ContributionModel>.value(
|
||||
_FakeContributionModel_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#enregistrerPaiement,
|
||||
[cotisationId],
|
||||
{
|
||||
#montant: montant,
|
||||
#datePaiement: datePaiement,
|
||||
#methodePaiement: methodePaiement,
|
||||
#numeroPaiement: numeroPaiement,
|
||||
#referencePaiement: referencePaiement,
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i3.ContributionModel>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.WavePaiementInitResult> initierPaiementEnLigne({
|
||||
@@ -214,66 +177,54 @@ class MockIContributionRepository extends _i1.Mock
|
||||
required String? numeroTelephone,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#initierPaiementEnLigne,
|
||||
[],
|
||||
{
|
||||
#cotisationId: cotisationId,
|
||||
#methodePaiement: methodePaiement,
|
||||
#numeroTelephone: numeroTelephone,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.WavePaiementInitResult>.value(
|
||||
_FakeWavePaiementInitResult_2(
|
||||
this,
|
||||
Invocation.method(
|
||||
#initierPaiementEnLigne,
|
||||
[],
|
||||
{
|
||||
Invocation.method(#initierPaiementEnLigne, [], {
|
||||
#cotisationId: cotisationId,
|
||||
#methodePaiement: methodePaiement,
|
||||
#numeroTelephone: numeroTelephone,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.WavePaiementInitResult>);
|
||||
}),
|
||||
returnValue: _i5.Future<_i2.WavePaiementInitResult>.value(
|
||||
_FakeWavePaiementInitResult_2(
|
||||
this,
|
||||
Invocation.method(#initierPaiementEnLigne, [], {
|
||||
#cotisationId: cotisationId,
|
||||
#methodePaiement: methodePaiement,
|
||||
#numeroTelephone: numeroTelephone,
|
||||
}),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.WavePaiementInitResult>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>?> getMesCotisationsSynthese() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getMesCotisationsSynthese,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<Map<String, dynamic>?>.value(),
|
||||
) as _i5.Future<Map<String, dynamic>?>);
|
||||
Invocation.method(#getMesCotisationsSynthese, []),
|
||||
returnValue: _i5.Future<Map<String, dynamic>?>.value(),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>?>);
|
||||
|
||||
@override
|
||||
_i5.Future<Map<String, dynamic>> getStatistiques() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getStatistiques,
|
||||
[],
|
||||
),
|
||||
returnValue:
|
||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
_i5.Future<Map<String, dynamic>> getStatistiques() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getStatistiques, []),
|
||||
returnValue: _i5.Future<Map<String, dynamic>>.value(
|
||||
<String, dynamic>{},
|
||||
),
|
||||
)
|
||||
as _i5.Future<Map<String, dynamic>>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.ContributionPageResult> getMesCotisationsEnAttente() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getMesCotisationsEnAttente,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<_i2.ContributionPageResult>.value(
|
||||
_FakeContributionPageResult_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getMesCotisationsEnAttente,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.ContributionPageResult>);
|
||||
Invocation.method(#getMesCotisationsEnAttente, []),
|
||||
returnValue: _i5.Future<_i2.ContributionPageResult>.value(
|
||||
_FakeContributionPageResult_0(
|
||||
this,
|
||||
Invocation.method(#getMesCotisationsEnAttente, []),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.ContributionPageResult>);
|
||||
|
||||
@override
|
||||
_i5.Future<_i2.ContributionPageResult> getCotisations({
|
||||
@@ -285,53 +236,44 @@ class MockIContributionRepository extends _i1.Mock
|
||||
int? annee,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCotisations,
|
||||
[],
|
||||
{
|
||||
#page: page,
|
||||
#size: size,
|
||||
#membreId: membreId,
|
||||
#statut: statut,
|
||||
#type: type,
|
||||
#annee: annee,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<_i2.ContributionPageResult>.value(
|
||||
_FakeContributionPageResult_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCotisations,
|
||||
[],
|
||||
{
|
||||
Invocation.method(#getCotisations, [], {
|
||||
#page: page,
|
||||
#size: size,
|
||||
#membreId: membreId,
|
||||
#statut: statut,
|
||||
#type: type,
|
||||
#annee: annee,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i5.Future<_i2.ContributionPageResult>);
|
||||
}),
|
||||
returnValue: _i5.Future<_i2.ContributionPageResult>.value(
|
||||
_FakeContributionPageResult_0(
|
||||
this,
|
||||
Invocation.method(#getCotisations, [], {
|
||||
#page: page,
|
||||
#size: size,
|
||||
#membreId: membreId,
|
||||
#statut: statut,
|
||||
#type: type,
|
||||
#annee: annee,
|
||||
}),
|
||||
),
|
||||
),
|
||||
)
|
||||
as _i5.Future<_i2.ContributionPageResult>);
|
||||
|
||||
@override
|
||||
_i5.Future<void> envoyerRappel(String? cotisationId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#envoyerRappel,
|
||||
[cotisationId],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
_i5.Future<void> envoyerRappel(String? cotisationId) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#envoyerRappel, [cotisationId]),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
)
|
||||
as _i5.Future<void>);
|
||||
|
||||
@override
|
||||
_i5.Future<int> genererCotisationsAnnuelles(int? annee) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#genererCotisationsAnnuelles,
|
||||
[annee],
|
||||
),
|
||||
returnValue: _i5.Future<int>.value(0),
|
||||
) as _i5.Future<int>);
|
||||
Invocation.method(#genererCotisationsAnnuelles, [annee]),
|
||||
returnValue: _i5.Future<int>.value(0),
|
||||
)
|
||||
as _i5.Future<int>);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user