Skip to content

Commit

Permalink
Adjustments to test configurations for movement of features.
Browse files Browse the repository at this point in the history
  • Loading branch information
gmcelhanon committed Jan 7, 2025
1 parent d087e16 commit db5b32a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using EdFi.Ods.Common.Security.Claims;
using EdFi.Ods.Repositories.NHibernate.Tests.Modules;
using Microsoft.Extensions.Configuration;
using Microsoft.FeatureManagement;
using NHibernate;
using NHibernate.Cfg;
using NUnit.Framework;
Expand Down Expand Up @@ -50,8 +51,11 @@ private void RegisterDependencies()
{
Engine = OneTimeGlobalDatabaseSetup.Instance.DatabaseEngine.Value,
};
builder.RegisterInstance(apiSettings).As<ApiSettings>()
.SingleInstance();

var fakeFeatureManager = new FakeFeatureManager();

builder.RegisterInstance(apiSettings).As<ApiSettings>().SingleInstance();
builder.RegisterInstance(fakeFeatureManager).As<IFeatureManager>().SingleInstance();

builder.Register(c => apiSettings.GetDatabaseEngine()).As<DatabaseEngine>();

Expand All @@ -66,8 +70,8 @@ private void RegisterDependencies()
builder.RegisterModule(new ContextStorageModule());
builder.RegisterModule(new ContextProviderModule());
builder.RegisterModule(new DbConnnectionStringBuilderAdapterFactoryModule());
builder.RegisterModule(new SqlServerSpecificModule(new FakeFeatureManager(), apiSettings.GetDatabaseEngine()));
builder.RegisterModule(new PostgresSpecificModule(new FakeFeatureManager(), apiSettings.GetDatabaseEngine()));
builder.RegisterModule(new SqlServerSpecificModule(fakeFeatureManager, apiSettings.GetDatabaseEngine()));
builder.RegisterModule(new PostgresSpecificModule(fakeFeatureManager, apiSettings.GetDatabaseEngine()));

builder.RegisterType<AuthorizationContextProvider>()
.As<IAuthorizationContextProvider>()
Expand Down
54 changes: 12 additions & 42 deletions tests/EdFi.Ods.WebApi.CompositeSpecFlowTests/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,24 @@
"EdFi_Ods": "Server=(local); Database=EdFi_Ods_Populated_Template_Test; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi.CompositeSpecFlowTests;",
"EdFi_Master": "Server=(local); Database=master; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi.CompositeSpecFlowTests;"
},
"FeatureManagement": {
"Extensions": false,
"Profiles": false,
"ChangeQueries": false,
"OpenApiMetadata": true,
"Composites": true,
"IdentityManagement": false,
"OwnershipBasedAuthorization": false,
"UniqueIdValidation": false,
"AggregateDependencies": true,
"TokenInfo": true
},
"ApiSettings": {
"Mode": "Sandbox",
"Engine": "SQLServer",
"EncryptSecrets": false,
"UseReverseProxyHeaders": false,
"Years": [],
"Features": [
{
"Name": "Extensions",
"IsEnabled": false
},
{
"Name": "Profiles",
"IsEnabled": false
},
{
"Name": "ChangeQueries",
"IsEnabled": false
},
{
"Name": "OpenApiMetadata",
"IsEnabled": true
},
{
"Name": "Composites",
"IsEnabled": true
},
{
"Name": "IdentityManagement",
"IsEnabled": false
},
{
"Name": "OwnershipBasedAuthorization",
"IsEnabled": false
},
{
"Name": "UniqueIdValidation",
"IsEnabled": false
},
{
"Name": "AggregateDependencies",
"IsEnabled": true
},
{
"Name": "TokenInfo",
"IsEnabled": true
}
],
"ExcludedExtensions": [
]
},
Expand Down
59 changes: 13 additions & 46 deletions tests/EdFi.Ods.WebApi.IntegrationTests/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,57 +12,24 @@
"EdFi_Security": "Server=(local); Database=EdFi_Security_Test; Trusted_Connection=True; Persist Security Info=True; Application Name=EdFi.Ods.WebApi.IntegrationTests;",
"EdFi_Master": "Server=(local); Database=master; Trusted_Connection=True; Application Name=EdFi.Ods.WebApi.IntegrationTests;"
},
"FeatureManagement": {
"Extensions": false,
"Profiles": false,
"ChangeQueries": false,
"OpenApiMetadata": true,
"Composites": true,
"IdentityManagement": true,
"OwnershipBasedAuthorization": false,
"UniqueIdValidation": false,
"AggregateDependencies": true,
"TokenInfo": true,
"XsdMetadata": true
},
"ApiSettings": {
"Engine": "SQLServer",
"EncryptSecrets": false,
"UseReverseProxyHeaders": false,
"Years": [],
"Features": [
{
"Name": "Extensions",
"IsEnabled": false
},
{
"Name": "Profiles",
"IsEnabled": false
},
{
"Name": "ChangeQueries",
"IsEnabled": false
},
{
"Name": "OpenApiMetadata",
"IsEnabled": true
},
{
"Name": "Composites",
"IsEnabled": true
},
{
"Name": "IdentityManagement",
"IsEnabled": true
},
{
"Name": "OwnershipBasedAuthorization",
"IsEnabled": false
},
{
"Name": "UniqueIdValidation",
"IsEnabled": false
},
{
"Name": "AggregateDependencies",
"IsEnabled": true
},
{
"Name": "TokenInfo",
"IsEnabled": true
},
{
"Name": "XsdMetadata",
"IsEnabled": true
}
],
"ExcludedExtensions": [
]
},
Expand Down

0 comments on commit db5b32a

Please sign in to comment.