Open Closed

Integration test error in SeedTestData method #9211


User avatar
0
rsg160 created

Hi all, this time we are using a module template to which we want to apply some integration tests, create all the file structure as recommended in the documentation for testing an application service and we are getting the error you can see below, it seems to be happening in the SeedTestData method of the "TestBaseModule" but we can't figure out more than that, can you point us in the right direction?

SA.Modules.Reports.EntityFrameworkCore.Applications.Reports.EfCoreReportAppService_Tests.Should_Get_List_Of_Reports Source: ReportAppService_Tests.cs line 24 Duration: 1 ms

Message:  Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module SA.Modules.Reports.ReportsTestBaseModule, SA.Modules.Reports.TestBase, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null: Value cannot be null. (Parameter 'source'). See the inner exception for details. ---- System.ArgumentNullException : Value cannot be null. (Parameter 'source')

Stack Trace:  ModuleManager.InitializeModules(ApplicationInitializationContext context) AbpApplicationBase.InitializeModules() AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) AbpIntegratedTest1.ctor() ReportsTestBase1.ctor() ReportsApplicationTestBase1.ctor() ReportAppService_Tests1.ctor() line 18 EfCoreReportAppService_Tests.ctor() RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) ----- Inner Stack Trace ----- ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument) Enumerable.Select[TSource,TResult](IEnumerable1 source, Func2 selector) PermissionDataSeeder.SeedAsync(String providerName, String providerKey, IEnumerable1 grantedPermissions, Nullable1 tenantId) PermissionDataSeedContributor.SeedAsync(DataSeedContext context) DataSeeder.SeedAsync(DataSeedContext context) AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) CastleAbpMethodInvocationAdapter.ProceedAsync() UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) <<SeedTestData>b__0>d.MoveNext() line 61 --- End of stack trace from previous location --- TaskExtensions.WaitAndUnwrapException(Task task) <>c__DisplayClass15_0.<Run>b__0(Task t) ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- TaskExtensions.WaitAndUnwrapException(Task task) AsyncContext.Run(Func1 action) AsyncHelper.RunSync(Func1 action) ReportsTestBaseModule.SeedTestData(ApplicationInitializationContext context) line 57 ReportsTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) line 52 OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) ModuleManager.InitializeModules(ApplicationInitializationContext context)


1 Answer(s)
  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi,

    Could you also please share the steps to reproduce the problem and share the related code blocks, especially from the SeedTestData() method where the PermissionDataSeeder.SeedAsync(...) method is called?

    This will help us better understand the root cause and provide you with a more accurate solution. Thank you!

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on May 12, 2025, 05:22