Skip to content

Commit

Permalink
tests: fix unit tests
Browse files Browse the repository at this point in the history
Refs: CPLP-2958
  • Loading branch information
Phil91 committed Jul 25, 2023
1 parent 13a9f8f commit c5c150a
Show file tree
Hide file tree
Showing 10 changed files with 365 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/marketplace/Apps.Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using Org.Eclipse.TractusX.Portal.Backend.Offers.Library.Service;
using Org.Eclipse.TractusX.Portal.Backend.Offers.Library.Web.DependencyInjection;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;

var VERSION = "v2";
Expand All @@ -49,5 +50,6 @@
.AddOfferDocumentServices();
builder.Services
.AddOfferServices();
.AddOfferServices()
.AddProvisioningDBAccess(builder.Configuration);
});
5 changes: 4 additions & 1 deletion src/marketplace/Services.Service/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
using Org.Eclipse.TractusX.Portal.Backend.Offers.Library.DependencyInjection;
using Org.Eclipse.TractusX.Portal.Backend.Offers.Library.Web.DependencyInjection;
using Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.DBAccess;
using Org.Eclipse.TractusX.Portal.Backend.Provisioning.Library;
using Org.Eclipse.TractusX.Portal.Backend.Services.Service.BusinessLogic;
using Org.Eclipse.TractusX.Portal.Backend.Services.Service.DependencyInjection;
Expand All @@ -46,5 +47,7 @@
.AddTechnicalUserProfile()
.AddOfferDocumentServices();
builder.Services.AddOfferServices();
builder.Services
.AddOfferServices()
.AddProvisioningDBAccess(builder.Configuration);
});
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static IServiceCollection AddProvisioningManager(this IServiceCollection
}

return services
.AddServiceAccountCreation(configuration.GetSection("Provisioning"));
.AddServiceAccountCreation(configuration.GetSection("Provisioning"));
;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@
<ProjectReference Include="..\..\..\src\portalbackend\PortalBackend.PortalEntities\PortalBackend.PortalEntities.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="appsettings.IntegrationTests.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
191 changes: 191 additions & 0 deletions tests/marketplace/Apps.Service.Tests/appsettings.IntegrationTests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"HealthChecks": [],
"Cors": {
"AllowedOrigins": []
},
"Keycloak": {
"central": {
"ConnectionString": "",
"ClientId": "",
"ClientSecret": "",
"AuthRealm": ""
},
"shared": {
"ConnectionString": "",
"ClientId": "",
"ClientSecret": "",
"AuthRealm": ""
}
},
"JwtBearerOptions": {
"RequireHttpsMetadata": true,
"MetadataAddress": "",
"SaveToken": true,
"TokenValidationParameters": {
"ValidateIssuer": true,
"ValidIssuer": "",
"ValidateIssuerSigningKey": true,
"ValidAudience": "",
"ValidateAudience": true,
"ValidateLifetime": true,
"ClockSkew": 600000
}
},
"ConnectionStrings": {
"PortalDb": "justaplaceholder",
"ProvisioningDB": "justaplaceholder"
},
"AppMarketPlace": {
"CatenaAdminRoles": [
{
"ClientId": "Cl2-CX-Portal",
"UserRoleNames": [
"CX Admin"
]
}
],
"SubmitAppNotificationTypeIds": [
"APP_RELEASE_REQUEST"
],
"BasePortalAddress": "http://localhost:3000",
"AppOverviewAddress": "http://localhost:3000/appoverview",
"SalesManagerRoles": [
{
"ClientId": "Cl2-CX-Portal",
"UserRoleNames": [
"Sales Manager"
]
}
],
"ServiceManagerRoles": [
{
"ClientId": "Cl2-CX-Portal",
"UserRoleNames": [
"App Manager"
]
}
],
"OfferStatusIds": [
"IN_REVIEW",
"ACTIVE"
],
"ActiveAppCompanyAdminRoles": [
{
"ClientId": "Cl2-CX-Portal",
"UserRoleNames": [
"IT Admin",
"Company Admin"
]
}
],
"ActiveAppNotificationTypeIds": [
"APP_ROLE_ADDED"
],
"ApproveAppNotificationTypeIds": [
"APP_RELEASE_APPROVAL"
],
"ApproveAppUserRoles": [
{
"ClientId": "Cl2-CX-Portal",
"UserRoleNames": [
"Sales Manager",
"Service Manager"
]
}
],
"ApplicationsMaxPageSize": 20,
"AppImageDocumentTypeIds": [
"APP_LEADIMAGE",
"APP_IMAGE",
"APP_CONTRACT",
"ADDITIONAL_DETAILS",
"APP_TECHNICAL_INFORMATION",
"CONFORMITY_APPROVAL_BUSINESS_APPS"
],
"ITAdminRoles": [
{
"ClientId": "Cl2-CX-Portal",
"UserRoleNames": [
"IT Admin"
]
}
],
"UserManagementAddress": "http://localhost:3000/usermanagement",
"DeleteDocumentTypeIds": [
"APP_CONTRACT",
"ADDITIONAL_DETAILS",
"APP_TECHNICAL_INFORMATION",
"APP_LEADIMAGE",
"APP_IMAGE",
"CONFORMITY_APPROVAL_BUSINESS_APPS"
],
"SubmitAppDocumentTypeIds": [
"APP_LEADIMAGE",
"APP_IMAGE",
"CONFORMITY_APPROVAL_BUSINESS_APPS"
],
"UploadAppDocumentTypeIds": [
{
"DocumentTypeId": "APP_TECHNICAL_INFORMATION",
"MediaTypes": [
"PDF"
]
},
{
"DocumentTypeId": "APP_LEADIMAGE",
"MediaTypes": [
"PDF"
]
},
{
"DocumentTypeId": "APP_IMAGE",
"MediaTypes": [
"PDF"
]
},
{
"DocumentTypeId": "APP_CONTRACT",
"MediaTypes": [
"JPEG",
"PNG",
"SVG"
]
},
{
"DocumentTypeId": "ADDITIONAL_DETAILS",
"MediaTypes": [
"JPEG",
"PNG",
"SVG"
]
},
{
"DocumentTypeId": "CONFORMITY_APPROVAL_BUSINESS_APPS",
"MediaTypes": [
"PDF"
]
}
],
"TechnicalUserProfileClient": "technical_roles_management",
"CompanyAdminRoles": [
{
"ClientId": "Cl2-CX-Portal",
"UserRoleNames": [
"Company Admin"
]
}
]
},
"Provisioning": {
"CentralRealm": "CX-Central",
"CentralRealmId": "CX-Central"
},
"MailingService": {
"Mail": {
"SmtpHost": "test",
"SmtpPort": 587,
"SmtpUser": "test",
"SmtpPassword": "test"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@
<ProjectReference Include="..\..\shared\Tests.Shared\Tests.Shared.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="appsettings.IntegrationTests.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"HealthChecks": [],
"Cors": {
"AllowedOrigins": []
},
"Keycloak": {
"central": {
"ConnectionString": "",
"ClientId": "",
"ClientSecret": "",
"AuthRealm": ""
},
"shared": {
"ConnectionString": "",
"ClientId": "",
"ClientSecret": "",
"AuthRealm": ""
}
},
"JwtBearerOptions": {
"RequireHttpsMetadata": true,
"MetadataAddress": "",
"SaveToken": true,
"TokenValidationParameters": {
"ValidateIssuer": true,
"ValidIssuer": "",
"ValidateIssuerSigningKey": true,
"ValidAudience": "",
"ValidateAudience": true,
"ValidateLifetime": true,
"ClockSkew": 600000
}
},
"ConnectionStrings": {
"PortalDb": "justaplaceholder",
"ProvisioningDB": "justaplaceholder"
},
"Provisioning": {
"CentralRealm": "CX-Central",
"CentralRealmId": "CX-Central"
},
"Services":{
"BasePortalAddress": "http://localhost:3000",
"UserManagementAddress": "http://localhost:3000/usermanagement",
"ServiceMarketplaceAddress": "http://localhost:3000/servicemarketplace",
"CatenaAdminRoles": {
"Cl2-CX-Portal": [
"CX Admin"
]
},
"CompanyAdminRoles": {
"Cl2-CX-Portal": [
"IT Admin"
]
},
"ServiceAccountRoles": {
"technical_roles_management": [
"Digital Twin Management"
]
},
"ServiceManagerRoles": {
"Cl2-CX-Portal": [
"Service Manager"
]
},
"SalesManagerRoles": {
"Cl2-CX-Portal": [
"Sales Manager"
]
},
"DocumentTypeIds": [
"ADDITIONAL_DETAILS"
],
"ContentTypeSettings": [
"application/pdf"
],
"SubmitServiceNotificationTypeIds": [
"SERVICE_RELEASE_REQUEST"
],
"ApproveServiceNotificationTypeIds": [
"SERVICE_RELEASE_APPROVAL"
],
"ApproveServiceUserRoles": {
"Cl2-CX-Portal": [
"Sales Manager",
"Service Manager"
]
},
"ITAdminRoles": {
"Cl2-CX-Portal": [
"IT Admin"
]
},
"TechnicalUserProfileClient": "technical_roles_management",
"ServiceImageDocumentTypeIds": [
"SERVICE_LEADIMAGE"
],
"DeleteDocumentTypeIds": [
"APP_CONTRACT",
"DATA_CONTRACT",
"ADDITIONAL_DETAILS",
"APP_LEADIMAGE",
"APP_IMAGE"
],
"UploadServiceDocumentTypeIds": {
"APP_CONTRACT": [
"application/pdf"
],
"ADDITIONAL_DETAILS": [
"application/pdf"
],
"APP_TECHNICAL_INFORMATION": [
"application/pdf"
],
"APP_LEADIMAGE": [
"image/jpeg",
"image/png",
"image/svg+xml"
],
"APP_IMAGE": [
"image/jpeg",
"image/png",
"image/svg+xml"
],
"CONFORMITY_APPROVAL_BUSINESS_APPS": [
"application/pdf"
]
},
"OfferStatusIds": [
"IN_REVIEW"
]
},
"MailingService": {
"Mail": {
"SmtpHost": "test",
"SmtpPort": 587,
"SmtpUser": "test",
"SmtpPassword": "test"
}
}
}
Loading

0 comments on commit c5c150a

Please sign in to comment.