diff --git a/CHANGELOG.md b/CHANGELOG.md index d0906042..9f0295b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] - NA +## [1.3.5] - 2023-07-12 + +### Added + - Support for tool app/service type in autosetup + ## [1.3.4] - 2023-07-11 ### Changed diff --git a/charts/orchestrator/Chart.yaml b/charts/orchestrator/Chart.yaml index 6efca947..97e99a42 100644 --- a/charts/orchestrator/Chart.yaml +++ b/charts/orchestrator/Chart.yaml @@ -38,13 +38,13 @@ sources: # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.4 +version: 1.3.5 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "1.3.4" +appVersion: "1.3.5" dependencies: - condition: postgresql.enabled diff --git a/charts/orchestrator/README.md b/charts/orchestrator/README.md index 852a3b1b..ea517084 100644 --- a/charts/orchestrator/README.md +++ b/charts/orchestrator/README.md @@ -1,6 +1,6 @@ # autosetup -![Version: 1.3.4](https://img.shields.io/badge/Version-1.3.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.3.4](https://img.shields.io/badge/AppVersion-1.3.4-informational?style=flat-square) +![Version: 1.3.5](https://img.shields.io/badge/Version-1.3.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.3.5](https://img.shields.io/badge/AppVersion-1.3.5-informational?style=flat-square) This service will help service provider to set up DFT/SDE with EDC and EDC as service in service provider environment. diff --git a/pom.xml b/pom.xml index a080e732..6025663e 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ org.eclipse.tractusx auto-setup - 1.3.4 + 1.3.5 auto-setup auto-setup diff --git a/src/main/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerController.java b/src/main/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerController.java index a30d5f2a..60ce6dcf 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerController.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerController.java @@ -22,12 +22,9 @@ import java.util.UUID; -import jakarta.validation.Valid; - import org.eclipse.tractusx.autosetup.manager.AutoSetupTriggerManager; import org.eclipse.tractusx.autosetup.model.AutoSetupRequest; import org.eclipse.tractusx.autosetup.model.AutoSetupResponse; -import org.eclipse.tractusx.autosetup.model.DFTUpdateRequest; import org.eclipse.tractusx.autosetup.service.AutoSetupOrchitestratorService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; @@ -44,6 +41,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.validation.Valid; @RestController @Tag(name = "AutoSetup", description = "Auto setup controller to perform all operation") @@ -61,18 +59,6 @@ public String getAllInstallPackages() { return appHandlerService.getAllInstallPackages(); } - /// internal access - // update dft packages input: keycloack details for frontend and backend, - // digital twin details - @Operation(summary = "Update DFT only packages", description = "This will update only DFT packages") - @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Created", content = @Content(schema = @Schema(implementation = UUID.class))) }) - @PutMapping("/internal/update-package/{executionId}") - public String updateDftPackage(@PathVariable("executionId") UUID executionId, - @RequestBody DFTUpdateRequest dftUpdateRequest) { - return appHandlerService.updateDftPackage(executionId.toString(), dftUpdateRequest); - } - // portal access @Operation(summary = "Start autosetup process", description = "This API will use to start the Auto setup process") @ApiResponses(value = { diff --git a/src/main/java/org/eclipse/tractusx/autosetup/manager/ConnectorRegistrationManager.java b/src/main/java/org/eclipse/tractusx/autosetup/manager/ConnectorRegistrationManager.java index 5ae2c758..2ce74a24 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/manager/ConnectorRegistrationManager.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/manager/ConnectorRegistrationManager.java @@ -37,7 +37,6 @@ import org.eclipse.tractusx.autosetup.portal.proxy.PortalIntegrationProxy; import org.eclipse.tractusx.autosetup.utility.LogUtil; import org.springframework.beans.factory.annotation.Value; -import org.springframework.core.io.FileSystemResource; import org.springframework.retry.annotation.Backoff; import org.springframework.retry.annotation.Retryable; import org.springframework.retry.support.RetrySynchronizationManager; @@ -90,13 +89,10 @@ public Map registerConnector(Customer customerDetails, SelectedT file = getTestFile(inputData.get("selfsigncertificate")); MultiValueMap body = new LinkedMultiValueMap<>(); - body.add("name", customerDetails.getOrganizationName()); body.add("connectorUrl", inputData.get("controlPlaneEndpoint")); - body.add("status", ACTIVE); body.add("location", customerDetails.getCountry()); - body.add("providerBpn", inputData.get("bpnNumber")); - body.add("certificate", new FileSystemResource(file.toFile())); + body.add("subscriptionId", inputData.get("subscriptionId")); Map header = new HashMap<>(); header.put("Authorization", "Bearer " + getKeycloakToken()); diff --git a/src/main/java/org/eclipse/tractusx/autosetup/manager/ManualDFTPackageUpdateManager.java b/src/main/java/org/eclipse/tractusx/autosetup/manager/ManualDFTPackageUpdateManager.java deleted file mode 100644 index 1116c11a..00000000 --- a/src/main/java/org/eclipse/tractusx/autosetup/manager/ManualDFTPackageUpdateManager.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2022, 2023 T-Systems International GmbH - * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.autosetup.manager; - -import static org.eclipse.tractusx.autosetup.constant.AppActions.CREATE; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.tractusx.autosetup.entity.AppServiceCatalogAndCustomerMapping; -import org.eclipse.tractusx.autosetup.entity.AutoSetupTriggerEntry; -import org.eclipse.tractusx.autosetup.exception.ServiceException; -import org.eclipse.tractusx.autosetup.mapper.AutoSetupTriggerMapper; -import org.eclipse.tractusx.autosetup.model.AutoSetupRequest; -import org.eclipse.tractusx.autosetup.model.Customer; -import org.eclipse.tractusx.autosetup.model.DFTUpdateRequest; -import org.eclipse.tractusx.autosetup.model.SelectedTools; -import org.eclipse.tractusx.autosetup.service.SDEAppWorkFlow; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.ObjectMapper; - -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@Service -@Slf4j -@RequiredArgsConstructor -public class ManualDFTPackageUpdateManager { - - private final AutoSetupTriggerMapper autoSetupTriggerMapper; - - private final SDEAppWorkFlow dftWorkFlow; - private final EmailManager emailManager; - - @Value("${portal.email.address}") - private String portalEmail; - - ObjectMapper mapper = new ObjectMapper(); - - public Map manualPackageUpdate(AutoSetupRequest autosetupRequest, DFTUpdateRequest dftUpdateRequest, - Map inputConfiguration, AutoSetupTriggerEntry trigger, - List appCatalogDetails) { - - Map map = null; - try { - - inputConfiguration.put("digital-twins.hostname", dftUpdateRequest.getDigitalTwinUrl()); - inputConfiguration.put("digital-twins.authentication.url", dftUpdateRequest.getDigitalTwinAuthUrl()); - inputConfiguration.put("digital-twins.authentication.clientId", dftUpdateRequest.getDigitalTwinClientId()); - inputConfiguration.put("digital-twins.authentication.clientSecret", - dftUpdateRequest.getDigitalTwinClientSecret()); - - inputConfiguration.put("dftkeycloakurl", dftUpdateRequest.getKeycloakUrl()); - inputConfiguration.put("dftcloakrealm", dftUpdateRequest.getKeycloakRealm()); - inputConfiguration.put("dftbackendkeycloakclientid", dftUpdateRequest.getKeycloakBackendClientId()); - inputConfiguration.put("dftfrontendkeycloakclientid", dftUpdateRequest.getKeycloakFrontendClientId()); - - inputConfiguration.put("dftportalclientid", dftUpdateRequest.getDftportalclientid()); - inputConfiguration.put("dftportalclientSecret", dftUpdateRequest.getDftportalclientSecret()); - - - List> autosetupResult = autoSetupTriggerMapper - .fromJsonStrToMap(trigger.getAutosetupResult()); - - autosetupResult.forEach(inputConfiguration::putAll); - - for (AppServiceCatalogAndCustomerMapping appServiceCatalog : appCatalogDetails) { - - List selectedTools = getToolInfo(appServiceCatalog); - - for (SelectedTools selectedTool : selectedTools) { - String label = selectedTool.getLabel(); - selectedTool.setLabel("dft-" + label); - - dftWorkFlow.deletePackageWorkFlow(selectedTool, inputConfiguration, trigger); - - // Sleep thread to wait for existing package deletetion - log.info("Waiting after deleting DFT packages"); - - Thread.sleep(15000); - - Customer customer = autosetupRequest.getCustomer(); - - map = dftWorkFlow.getWorkFlow(customer, selectedTool, CREATE, inputConfiguration, trigger); - - // Send an email - Map emailContent = new HashMap<>(); - emailContent.put("orgname", customer.getOrganizationName()); - emailContent.put("dftFrontEndUrl", map.get("dftFrontEndUrl")); - emailContent.put("toemail", customer.getEmail()); - emailContent.put("ccemail", portalEmail); - - emailManager.sendEmail(emailContent, "DFT Application Activited Successfully", "success_activate.html"); - log.info("Email sent successfully"); - // End of email sending code - - log.info("DFT Manual package update successfully!!!!"); - } - } - - } catch (Exception e) { - Thread.currentThread().interrupt(); - throw new ServiceException("ManualDFT PackageUpdate Oops! We have an exception - " + e.getMessage()); - } - return map; - } - - private List getToolInfo(AppServiceCatalogAndCustomerMapping appCatalog) { - - try { - String jsonStr = appCatalog.getServiceCatalog().getServiceTools(); - - if (jsonStr != null && !jsonStr.isEmpty()) { - return mapper.readValue(jsonStr, new TypeReference>() { - }); - } - } catch (Exception e) { - log.error("Error in parsing selected tools list"); - } - return List.of(); - } -} diff --git a/src/main/java/org/eclipse/tractusx/autosetup/manager/PortalIntegrationManager.java b/src/main/java/org/eclipse/tractusx/autosetup/manager/PortalIntegrationManager.java index 7eebc915..36f3e027 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/manager/PortalIntegrationManager.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/manager/PortalIntegrationManager.java @@ -91,9 +91,13 @@ public Map postServiceInstanceResultAndGetTenantSpecs(Customer c ServiceInstanceResultRequest serviceInstanceResultRequest = ServiceInstanceResultRequest.builder() .requestId(subscriptionId).offerUrl(applicationURL).build(); - - serviceInstanceResultResponse = portalIntegrationProxy.postServiceInstanceResultAndGetTenantSpecs(portalUrl, - header, serviceInstanceResultRequest); + + if ("app".equalsIgnoreCase(tool.getType())) + serviceInstanceResultResponse = portalIntegrationProxy.postAppInstanceResultAndGetTenantSpecs(portalUrl, + header, serviceInstanceResultRequest); + else + serviceInstanceResultResponse = portalIntegrationProxy + .postServiceInstanceResultAndGetTenantSpecs(portalUrl, header, serviceInstanceResultRequest); if (serviceInstanceResultResponse != null) { diff --git a/src/main/java/org/eclipse/tractusx/autosetup/model/DFTUpdateRequest.java b/src/main/java/org/eclipse/tractusx/autosetup/model/DFTUpdateRequest.java deleted file mode 100644 index 94a9e83c..00000000 --- a/src/main/java/org/eclipse/tractusx/autosetup/model/DFTUpdateRequest.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************** - * Copyright (c) 2022, 2023 T-Systems International GmbH - * Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation - * - * See the NOTICE file(s) distributed with this work for additional - * information regarding copyright ownership. - * - * This program and the accompanying materials are made available under the - * terms of the Apache License, Version 2.0 which is available at - * https://www.apache.org/licenses/LICENSE-2.0. - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - * SPDX-License-Identifier: Apache-2.0 - ********************************************************************************/ - -package org.eclipse.tractusx.autosetup.model; - -import lombok.Builder; -import lombok.Data; - -@Data -@Builder -public class DFTUpdateRequest { - - private String keycloakUrl; - private String keycloakRealm; - private String keycloakFrontendClientId; - private String keycloakBackendClientId; - - private String digitalTwinUrl; - private String digitalTwinAuthUrl; - private String digitalTwinClientId; - private String digitalTwinClientSecret; - - private String dftportalclientid; - private String dftportalclientSecret; - -} diff --git a/src/main/java/org/eclipse/tractusx/autosetup/model/SelectedTools.java b/src/main/java/org/eclipse/tractusx/autosetup/model/SelectedTools.java index 013dede0..4cfb0fcd 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/model/SelectedTools.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/model/SelectedTools.java @@ -34,6 +34,8 @@ public class SelectedTools { private ToolType tool; + + private String type; private String label; diff --git a/src/main/java/org/eclipse/tractusx/autosetup/portal/proxy/PortalIntegrationProxy.java b/src/main/java/org/eclipse/tractusx/autosetup/portal/proxy/PortalIntegrationProxy.java index c8bf2cf4..a9818e2e 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/portal/proxy/PortalIntegrationProxy.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/portal/proxy/PortalIntegrationProxy.java @@ -41,11 +41,18 @@ public interface PortalIntegrationProxy { KeycloakTokenResponse readAuthToken(URI url, @RequestBody MultiValueMap body); @PostMapping("/api/Apps/autoSetup") + public ServiceInstanceResultResponse postAppInstanceResultAndGetTenantSpecs(URI url, + @RequestHeader Map header, + @RequestBody ServiceInstanceResultRequest serviceInstanceResultRequest); + + + @PostMapping("/api/Services/autoSetup") public ServiceInstanceResultResponse postServiceInstanceResultAndGetTenantSpecs(URI url, @RequestHeader Map header, @RequestBody ServiceInstanceResultRequest serviceInstanceResultRequest); - @PostMapping("/api/administration/connectors/managed-daps") + + @PostMapping("/api/administration/connectors/managed") public String manageConnector(URI url, @RequestHeader Map header, @RequestBody MultiValueMap body); diff --git a/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java b/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java index 93e2caca..6192b11e 100644 --- a/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java +++ b/src/main/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorService.java @@ -45,12 +45,10 @@ import org.eclipse.tractusx.autosetup.manager.AutoSetupTriggerManager; import org.eclipse.tractusx.autosetup.manager.EmailManager; import org.eclipse.tractusx.autosetup.manager.InputConfigurationManager; -import org.eclipse.tractusx.autosetup.manager.ManualDFTPackageUpdateManager; import org.eclipse.tractusx.autosetup.mapper.AutoSetupRequestMapper; import org.eclipse.tractusx.autosetup.mapper.AutoSetupTriggerMapper; import org.eclipse.tractusx.autosetup.model.AutoSetupRequest; import org.eclipse.tractusx.autosetup.model.Customer; -import org.eclipse.tractusx.autosetup.model.DFTUpdateRequest; import org.eclipse.tractusx.autosetup.model.SelectedTools; import org.eclipse.tractusx.autosetup.repository.AutoSetupTriggerEntryRepository; import org.springframework.beans.factory.annotation.Autowired; @@ -61,7 +59,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import lombok.RequiredArgsConstructor; -import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @Service @@ -86,7 +83,6 @@ public class AutoSetupOrchitestratorService { private final DTAppWorkFlow dtAppWorkFlow; private final InputConfigurationManager inputConfigurationManager; - private final ManualDFTPackageUpdateManager manualDFTPackageUpdateManager; private final AutoSetupTriggerMapper autoSetupTriggerMapper; private final AutoSetupRequestMapper autoSetupRequestMapper; @@ -422,7 +418,7 @@ private void sdeDeployment(AutoSetupRequest autoSetupRequest, AppActions action, emailContent.put(TOEMAIL, portalEmail); // End of email sending code - emailManager.sendEmail(emailContent, "SDE/DFT Application Deployed Successfully", "success.html"); + emailManager.sendEmail(emailContent, "SDE Application Deployed Successfully", "success.html"); log.info(EMAIL_SENT_SUCCESSFULLY); trigger.setStatus(TriggerStatusEnum.MANUAL_UPDATE_PENDING.name()); @@ -435,7 +431,7 @@ private void sdeDeployment(AutoSetupRequest autoSetupRequest, AppActions action, emailContent.put(TOEMAIL, customer.getEmail()); emailContent.put("ccemail", portalEmail); - emailManager.sendEmail(emailContent, "SDE/DFT Application Activited Successfully", "success_activate.html"); + emailManager.sendEmail(emailContent, "SDE Application Activited Successfully", "success_activate.html"); log.info(EMAIL_SENT_SUCCESSFULLY); // End of email sending code @@ -524,57 +520,6 @@ private void executeInstallTool(AutoSetupTriggerEntry trigger, Map appCatalogDetails = verifyIsServiceValid(autosetupRequest); - - Map inputConfiguration = inputConfigurationManager - .prepareInputConfiguration(autosetupRequest, triggerId); - - Runnable runnable = () -> { - - try { - trigger.setTriggerType(UPDATE.name()); - trigger.setStatus(INPROGRESS.name()); - autoSetupTriggerManager.saveTriggerUpdate(trigger); - - Map output = manualDFTPackageUpdateManager.manualPackageUpdate(autosetupRequest, - dftUpdateRequest, inputConfiguration, trigger, appCatalogDetails); - - String json = autoSetupTriggerMapper.fromMaptoStr(extractResultMap(output)); - - trigger.setAutosetupResult(json); - - trigger.setStatus(TriggerStatusEnum.SUCCESS.name()); - - } catch (Exception e) { - - log.error("Error in manual package updation " + e.getMessage()); - trigger.setStatus(TriggerStatusEnum.FAILED.name()); - trigger.setRemark(e.getMessage()); - trigger.setAutosetupResult(""); - } - - LocalDateTime now = LocalDateTime.now(); - trigger.setModifiedTimestamp(now.toString()); - autoSetupTriggerManager.saveTriggerUpdate(trigger); - - }; - new Thread(runnable).start(); - - return trigger.getTriggerId(); - } else { - throw new NoDataFoundException("Autosetup entry not present for manual update"); - } - - } private List> extractResultMap(Map outputMap) { diff --git a/src/main/resources/flyway/V7__refactor_apps.sql b/src/main/resources/flyway/V7__refactor_apps.sql index 9f3f395e..d133c808 100644 --- a/src/main/resources/flyway/V7__refactor_apps.sql +++ b/src/main/resources/flyway/V7__refactor_apps.sql @@ -33,15 +33,15 @@ DELETE FROM app_service_catalog_tbl; INSERT INTO app_service_catalog_tbl (canonical_service_id, ct_name, service_tools, workflow) -VALUES('SDE-WITH-EDC-TX', 'SDE-WITH-EDC-TX', '[{"tool": "SDE_WITH_EDC_TRACTUS","label": "sdeedctx"}]', 'EDC_TX_SDE'); +VALUES('SDE-WITH-EDC-TX', 'SDE-WITH-EDC-TX', '[{"tool": "SDE_WITH_EDC_TRACTUS","label": "sdeedctx", "type": "app"}]', 'EDC_TX_SDE'); INSERT INTO app_service_catalog_tbl (canonical_service_id, ct_name, service_tools, workflow) -VALUES('EDC-TX', 'EDC-TX', '[{"tool": "EDC_TRACTUS","label": "edctx"}]', 'EDC_TX'); +VALUES('EDC-TX', 'EDC-TX', '[{"tool": "EDC_TRACTUS","label": "edctx", "type": "service"}]', 'EDC_TX'); INSERT INTO app_service_catalog_tbl (canonical_service_id, ct_name, service_tools, workflow) -VALUES('DT-REGISTRY', 'DT-REGISTRY', '[{"tool": "DT_REGISTRY","label": "dt"}]', 'DT_REGISTRY'); +VALUES('DT-REGISTRY', 'DT-REGISTRY', '[{"tool": "DT_REGISTRY","label": "dt", "type": "app"}]', 'DT_REGISTRY'); update app_tbl set package_version='0.3.5' where app_name='DT_REGISTRY'; diff --git a/src/main/resources/templates/success.html b/src/main/resources/templates/success.html index 42979f7d..9ee9caec 100644 --- a/src/main/resources/templates/success.html +++ b/src/main/resources/templates/success.html @@ -24,17 +24,17 @@ - SDE/DFT template + SDE template

Hello Team,

-

The SDE/DFT application deployed successfully for ${orgname}.

+

The SDE application deployed successfully for ${orgname}.

Frontend URL : ${sdeFrontEndUrl}

Backend URL : ${sdeBackEndUrl}

-

Please send the Digital Twin and Keycloak details to configure SDE/DFT tool for ${orgname} use.

+

Please send the Digital Twin and Keycloak details to configure SDE tool for ${orgname} use.

Kind Regards
Catina-X

diff --git a/src/main/resources/templates/success_activate.html b/src/main/resources/templates/success_activate.html index 77179866..40855607 100644 --- a/src/main/resources/templates/success_activate.html +++ b/src/main/resources/templates/success_activate.html @@ -31,7 +31,7 @@

Hello ${orgname},

-

The SDE/DFT tool successfully activated for your use.

+

The SDE successfully activated for your use.

Please click here to start using it.

DT Registry Details

@@ -45,7 +45,7 @@

EDC ApiKeyValue : ${edcApiKeyValue}

Your connector status through connector test service: ${connectorTestResult}, check status again here

-

Note: You need to use your own organization login credential to login SDE/DFT tool.

+

Note: You need to use your own organization login credential to login SDE tool.

Kind Regards
Catina-X

diff --git a/src/test/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerControllerTest.java b/src/test/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerControllerTest.java index b9379fcf..51888266 100644 --- a/src/test/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerControllerTest.java +++ b/src/test/java/org/eclipse/tractusx/autosetup/controller/AutoSetupHandlerControllerTest.java @@ -25,7 +25,6 @@ import org.eclipse.tractusx.autosetup.manager.AutoSetupTriggerManager; import org.eclipse.tractusx.autosetup.model.AutoSetupRequest; import org.eclipse.tractusx.autosetup.model.AutoSetupResponse; -import org.eclipse.tractusx.autosetup.model.DFTUpdateRequest; import org.eclipse.tractusx.autosetup.service.AutoSetupOrchitestratorService; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; @@ -61,30 +60,6 @@ class AutoSetupHandlerControllerTest { @Autowired private MockMvc mockMvc; - @Test - void updateDftPackage() throws Exception { - String request = "{\n" + - " \"keycloakUrl\": \"https://keycloak.cx.dih-cloud.com\",\n" + - " \"keycloakRealm\": \"orchestrator\",\n" + - " \"keycloakFrontendClientId\": \"orchestratorservice\",\n" + - " \"keycloakBackendClientId\": \"orchestratorservice\",\n" + - " \"digitalTwinUrl\": \"https://semantics.dev.demo.catena-x.net/registry\",\n" + - " \"digitalTwinAuthUrl\": \"https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token\",\n" + - " \"digitalTwinClientId\": \"sa-cl6-cx-17\",\n" + - " \"digitalTwinClientSecret\": \"T8yxHEoPdluIQkPwJi3KSGf3mcSTWoij\"\n" + - "}"; - String response = "1ca680dc-8947-4afa-9621-2a72a31f9bb9"; - Mockito.when(appHandlerService.updateDftPackage(Mockito.anyString(),Mockito.any(DFTUpdateRequest.class))).thenReturn(response); - RequestBuilder requestBuilder = MockMvcRequestBuilders - .put("/internal/update-package/1ca680dc-8947-4afa-9621-2a72a31f9bb9") - .accept(MediaType.APPLICATION_JSON).content(request) - .contentType(MediaType.APPLICATION_JSON); - MvcResult result = mockMvc.perform(requestBuilder).andReturn(); - - MockHttpServletResponse apiResponse = result.getResponse(); - - assertEquals(HttpStatus.OK.value(), apiResponse.getStatus()); - } @Test void createPackage() throws Exception { @@ -100,7 +75,7 @@ void createPackage() throws Exception { " \"bpnNumber\": \"BPN12345611\",\n" + " \"role\": \"recycler\",\n" + " \"subscriptionId\": \"DAS-D234\",\n" + - " \"serviceId\": \"T-SYSTEM-DFT-EDC\"\n" + + " \"serviceId\": \"T-SYSTEM-SDE-EDC\"\n" + " }\n" + "}"; String response = "1ca680dc-8947-4afa-9621-2a72a31f9bb9"; @@ -130,7 +105,7 @@ void updatePackage() throws Exception { " \"bpnNumber\": \"BPN12345611\",\n" + " \"role\": \"recycler\",\n" + " \"subscriptionId\": \"DAS-D234\",\n" + - " \"serviceId\": \"T-SYSTEM-DFT-EDC\"\n" + + " \"serviceId\": \"T-SYSTEM-SDE-EDC\"\n" + " }\n" + "}"; String response = "1ca680dc-8947-4afa-9621-2a72a31f9bb9"; @@ -160,7 +135,7 @@ void deletePackage() throws Exception { " \"bpnNumber\": \"BPN12345611\",\n" + " \"role\": \"recycler\",\n" + " \"subscriptionId\": \"DAS-D234\",\n" + - " \"serviceId\": \"T-SYSTEM-DFT-EDC\"\n" + + " \"serviceId\": \"T-SYSTEM-SDE-EDC\"\n" + " }\n" + "}"; String response = "1ca680dc-8947-4afa-9621-2a72a31f9bb9"; @@ -193,7 +168,7 @@ void getCheckDetails() throws Exception { " \"properties\": {\n" + " \"bpnNumber\": \"BPN12345611\",\n" + " \"subscriptionId\": \"DAS-D234\",\n" + - " \"serviceId\": \"T-SYSTEM-DFT-EDC\",\n" + + " \"serviceId\": \"T-SYSTEM-SDE-EDC\",\n" + " \"role\": \"recycler\"\n" + " }\n" + " },\n" + diff --git a/src/test/java/org/eclipse/tractusx/autosetup/manager/InputConfigurationManagerTest.java b/src/test/java/org/eclipse/tractusx/autosetup/manager/InputConfigurationManagerTest.java index 0492b50d..d35efcea 100644 --- a/src/test/java/org/eclipse/tractusx/autosetup/manager/InputConfigurationManagerTest.java +++ b/src/test/java/org/eclipse/tractusx/autosetup/manager/InputConfigurationManagerTest.java @@ -59,7 +59,7 @@ void prepareInputConfiguration() { " \"bpnNumber\": \"BPN12345611\",\n" + " \"role\": \"recycler\",\n" + " \"subscriptionId\": \"DAS-D234\",\n" + - " \"serviceId\": \"T-SYSTEM-DFT-EDC\"\n" + + " \"serviceId\": \"T-SYSTEM-SDE-EDC\"\n" + " }\n" + "}"; String uuID = UUID.randomUUID().toString(); diff --git a/src/test/java/org/eclipse/tractusx/autosetup/manager/SDEManagerTest.java b/src/test/java/org/eclipse/tractusx/autosetup/manager/SDEManagerTest.java index eb63cdc6..fd3d21b6 100644 --- a/src/test/java/org/eclipse/tractusx/autosetup/manager/SDEManagerTest.java +++ b/src/test/java/org/eclipse/tractusx/autosetup/manager/SDEManagerTest.java @@ -63,7 +63,7 @@ void managePackage() { mockInputMap.put("dnsNameURLProtocol", "https"); Map resultMap = sdeManager.managePackage(null, AppActions.CREATE, selectedTools, mockInputMap, null); - assertEquals(22, resultMap.size()); + assertEquals(26, resultMap.size()); assertEquals("test", mockInputMap.get("dnsName")); } } \ No newline at end of file diff --git a/src/test/java/org/eclipse/tractusx/autosetup/manager/VaultManagerTest.java b/src/test/java/org/eclipse/tractusx/autosetup/manager/VaultManagerTest.java index f4ce2527..3cdcc065 100644 --- a/src/test/java/org/eclipse/tractusx/autosetup/manager/VaultManagerTest.java +++ b/src/test/java/org/eclipse/tractusx/autosetup/manager/VaultManagerTest.java @@ -93,7 +93,7 @@ void uploadKeyandValues() { .build(); mockInputMap = vaultManager.uploadKeyandValues(customer, selectedTools,mockInputMap, autoSetupTriggerEntry); - assertEquals(14, mockInputMap.size()); + assertEquals(15, mockInputMap.size()); assertEquals("test", mockInputMap.get("targetCluster")); } } \ No newline at end of file diff --git a/src/test/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorServiceTest.java b/src/test/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorServiceTest.java index f3651b58..f5116bc5 100644 --- a/src/test/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorServiceTest.java +++ b/src/test/java/org/eclipse/tractusx/autosetup/service/AutoSetupOrchitestratorServiceTest.java @@ -24,6 +24,7 @@ import org.eclipse.tractusx.autosetup.kubeapps.proxy.KubeAppManageProxy; import org.eclipse.tractusx.autosetup.mapper.AutoSetupRequestMapper; import org.eclipse.tractusx.autosetup.model.AutoSetupRequest; +import org.eclipse.tractusx.autosetup.portal.proxy.PortalIntegrationProxy; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.springframework.beans.factory.annotation.Autowired; @@ -44,6 +45,9 @@ class AutoSetupOrchitestratorServiceTest { //@Spy @Autowired private AutoSetupOrchitestratorService autoSetupOrchitestratorService; + + @MockBean + private PortalIntegrationProxy portalIntegrationProxy; @MockBean