Merge branch 'DEVELOP' of ssh://git.eclipse.org:29418/openk-usermodules/org.eclipse.openk-usermodules.gridFailureInformation.backend into SI-153-SARIS-Schnittstelle
diff --git a/SAMO-Interface/Dockerfile_DevServer b/SAMO-Interface/Dockerfile_DevServer
index fdddeaf..946af64 100644
--- a/SAMO-Interface/Dockerfile_DevServer
+++ b/SAMO-Interface/Dockerfile_DevServer
@@ -1,8 +1,19 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/SAMO-Interface/pom.xml b/SAMO-Interface/pom.xml
index 1ccfd73..d7e35f3 100644
--- a/SAMO-Interface/pom.xml
+++ b/SAMO-Interface/pom.xml
@@ -1,11 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.2.4.RELEASE</version>
+ <version>2.2.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.eclipse.openk</groupId>
diff --git a/SAMO-Interface/pom_backup.xml b/SAMO-Interface/pom_backup.xml
index 159e251..c10abcb 100644
--- a/SAMO-Interface/pom_backup.xml
+++ b/SAMO-Interface/pom_backup.xml
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
diff --git a/SAMO-Interface/sonar-project.properties b/SAMO-Interface/sonar-project.properties
index 16f4b39..e6c68aa 100644
--- a/SAMO-Interface/sonar-project.properties
+++ b/SAMO-Interface/sonar-project.properties
@@ -1,3 +1,15 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
# must be unique in a given SonarQube instance
sonar.projectKey=openk.pta.de:samointerface
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/SarisInterfaceApplication.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/SarisInterfaceApplication.java
index d736ac8..d1a9085 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/SarisInterfaceApplication.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/SarisInterfaceApplication.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface;
import org.springframework.boot.SpringApplication;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/api/StoerungsauskunftApi.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/api/StoerungsauskunftApi.java
deleted file mode 100644
index db72880..0000000
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/api/StoerungsauskunftApi.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
-*/
-package org.eclipse.openk.gridfailureinformation.samointerface.api;
-
-import org.eclipse.openk.gridfailureinformation.samointerface.dtos.StoerungsauskunftOutage;
-import org.eclipse.openk.gridfailureinformation.samointerface.dtos.StoerungsauskunftUserNotification;
-import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestParam;
-
-import java.util.List;
-
-
-@FeignClient(name="Stoerauskunft.de", url= "${stoerungsauskunft.apiUrl}")
-public interface StoerungsauskunftApi {
-
- @PostMapping(value= "/outage")
- feign.Response postOutage(@RequestBody List<StoerungsauskunftOutage> outage);
-
- @GetMapping(value= "/reports")
- List<StoerungsauskunftUserNotification> getUserNotification(@RequestParam(value="sectorType") Integer sectorType);
-
-}
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/FeignClientConfig.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/FeignClientConfig.java
deleted file mode 100644
index 066b93b..0000000
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/FeignClientConfig.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.eclipse.openk.gridfailureinformation.samointerface.config;
-
-import feign.RequestInterceptor;
-import feign.auth.BasicAuthRequestInterceptor;
-import lombok.extern.log4j.Log4j2;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-@Log4j2
-@Configuration
-public class FeignClientConfig {
-
- @Value("${stoerungsauskunft.user}")
- public String user;
- @Value("${stoerungsauskunft.password}")
- public String password;
-
- @Bean
- public RequestInterceptor basicAuthRequestInterceptor() {
- return new BasicAuthRequestInterceptor(user, password);
- }
-
-}
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SFTPConfig.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SFTPConfig.java
index bc7a03a..136766e 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SFTPConfig.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SFTPConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface.config;
import com.jcraft.jsch.ChannelSftp;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SwaggerConfig.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SwaggerConfig.java
index 8123284..8368afa 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SwaggerConfig.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/SwaggerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface.config;
import lombok.extern.log4j.Log4j2;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqConfig.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqConfig.java
index 77a3727..bcdc972 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqConfig.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface.config.rabbitMq;
import lombok.Data;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqProperties.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqProperties.java
index 6e0d653..4c5d39e 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqProperties.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/config/rabbitMq/RabbitMqProperties.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface.config.rabbitMq;
import lombok.Getter;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/controller/ImportController.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/controller/ImportController.java
deleted file mode 100644
index 9b150df..0000000
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/controller/ImportController.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *******************************************************************************
- * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0.
- *
- * SPDX-License-Identifier: EPL-2.0
- *******************************************************************************
- */
-package org.eclipse.openk.gridfailureinformation.samointerface.controller;
-
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import lombok.extern.log4j.Log4j2;
-import org.eclipse.openk.gridfailureinformation.samointerface.service.ImportService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseStatus;
-import org.springframework.web.bind.annotation.RestController;
-
-import javax.xml.bind.JAXBException;
-
-@Log4j2
-@RestController
-@RequestMapping("/samo")
-public class ImportController {
-
- @Autowired
- private ImportService importService;
-
- @GetMapping("/test")
- @ApiOperation(value = "Import von Störungsinformationen von SARIS zu SIT")
- @ApiResponses(value = {
- @ApiResponse(code = 201, message = "Störungsinformation erfolgreich importiert"),
- @ApiResponse(code = 500, message = "Konnte nicht durchgeführt werden")
- })
- @ResponseStatus(HttpStatus.OK)
- public void testSamo() throws JAXBException {
-
- System.err.println("tester");
- }
-
-}
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/SAMOOutage.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/SAMOOutage.java
index a081837..f062a2d 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/SAMOOutage.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/SAMOOutage.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface.dtos;
import lombok.Data;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftOutage.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftOutage.java
index 023a3b0..f79cc47 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftOutage.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftOutage.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface.dtos;
import lombok.Data;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftUserNotification.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftUserNotification.java
index 0b5efbe..ef230cc 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftUserNotification.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/dtos/StoerungsauskunftUserNotification.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.samointerface.dtos;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
diff --git a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportService.java b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportService.java
index 15eefb1..e652684 100644
--- a/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportService.java
+++ b/SAMO-Interface/src/main/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportService.java
@@ -86,7 +86,7 @@
.build());
log.info("Succesfully sent message from SAMO-Interface to main-app with metaId: " + foreignFailureMessageDto.getMetaId());
} catch (Exception e) {
- log.debug(e.getMessage(), e);
+ log.error(e.getMessage(), e);
throw new InternalServerErrorException("could.not.push.message");
}
diff --git a/SAMO-Interface/src/main/resources/application.yml b/SAMO-Interface/src/main/resources/application.yml
index 8ca94ea..6e307cb 100644
--- a/SAMO-Interface/src/main/resources/application.yml
+++ b/SAMO-Interface/src/main/resources/application.yml
@@ -31,31 +31,6 @@
server:
max-http-header-size: 262144
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: x
-
-gridFailureInformation:
- maxListSize: 2000
-
-feign:
- client:
- config:
- default:
- connectTimeout: 60000
- readTimeout: 60000
-cors:
- corsEnabled: false
-
-stoerungsauskunft:
- apiUrl: https://stage-api-operator.stoerungsauskunft.de/api/v1.0/
- user: ${GFI_STOERUNGSAUSKUNFT_USERNAME}
- password: ${GFI_STOERUNGSAUSKUNFT_PASSWORD}
- scheduling-import:
- enabled: false
- cron: 0 */15 * ? * *
-
sftp:
enable-polling: true
host: 169.50.13.154
@@ -73,11 +48,6 @@
spring:
profiles: test
-jwt:
- tokenHeader: Authorization
- useStaticJwt: true
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
---
spring:
@@ -89,17 +59,9 @@
org.eclipse.openk: DEBUG
org.springframework.web: ERROR
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
server:
port: 9198
-cors:
- corsEnabled: true
-
---
spring:
@@ -138,14 +100,6 @@
session:
tracking-modes: cookie
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
-cors:
- corsEnabled: true
-
swagger:
baseUrl: /test-stoerungsauskunft-interface
diff --git a/SAMO-Interface/src/main/resources/application_localdev.yml b/SAMO-Interface/src/main/resources/application_localdev.yml
index ef109a2..cc1bc56 100644
--- a/SAMO-Interface/src/main/resources/application_localdev.yml
+++ b/SAMO-Interface/src/main/resources/application_localdev.yml
@@ -28,16 +28,6 @@
org.eclipse.openk: DEBUG
org.springframework.web: ERROR
-eureka:
- client:
- service-url:
- defaulZone: http://localhost:8761/
- instance:
- prefer-ip-address: true
-
-index-channel:
- enabled: true
-
server:
port: 9196
max-http-header-size: 262144
@@ -48,32 +38,8 @@
gridFailureInformation:
maxListSize: 2000
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
-feign:
- client:
- config:
- default:
- connectTimeout: 5000
- readTimeout: 5000
- loggerLevel: FULL
-
logging.level.org.eclipse.openk.gridfailureinformation.jobs.stoerauskunftinterface.api.StoerauskunftApi: DEBUG
-cors:
- corsEnabled: true
-
-stoerungsauskunft:
- apiUrl: https://stage-api-operator.stoerungsauskunft.de/api/v1.0/
- user: ${GFI_STOERUNGSAUSKUNFT_USERNAME}
- password: ${GFI_STOERUNGSAUSKUNFT_PASSWORD}
- scheduling-import:
- enabled: false
- cron: 0 */15 * ? * *
-
---
spring:
diff --git a/SAMO-Interface/src/main/resources/logback-spring.xml b/SAMO-Interface/src/main/resources/logback-spring.xml
index e441ee9..cb06553 100644
--- a/SAMO-Interface/src/main/resources/logback-spring.xml
+++ b/SAMO-Interface/src/main/resources/logback-spring.xml
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<configuration>
<property name="LOGS" value="./logs"/>
@@ -24,19 +38,6 @@
</rollingPolicy>
</appender>
- <appender name="RollingFileFeign" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${LOGS}/feignclient.log</file>
- <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
- <Pattern>%d %p %c{60} [%t] %m%n</Pattern>
- </encoder>
-
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <fileNamePattern>${LOGS}/archived/feignclient-%d{yyyy-MM-dd}.gz</fileNamePattern>
- <MaxHistory>30</MaxHistory>
- <cleanHistoryOnStart>true</cleanHistoryOnStart>
- </rollingPolicy>
- </appender>
-
<!-- LOG everything at INFO level -->
<root level="info">
<appender-ref ref="RollingFileStd"/>
@@ -44,13 +45,9 @@
</root>
<!-- LOG "com.baeldungorg.eclipse.openk.contactbasedata*" at INFO level -->
- <logger name="org.eclipse.openk.gridfailureinformation.samointerface" level="info" additivity="false">
+ <logger name="org.eclipse.openk.gridfailureinformation.samointerface" additivity="false">
<appender-ref ref="RollingFileStd"/>
<appender-ref ref="Console"/>
</logger>
- <logger name="org.eclipse.openk.gridfailureinformation.samointerface.api.StoerungsauskunftApi" level="info" additivity="false">
- <appender-ref ref="RollingFileFeign"/>
- </logger>
-
</configuration>
\ No newline at end of file
diff --git a/SAMO-Interface/src/main/resources/messages.properties b/SAMO-Interface/src/main/resources/messages.properties
index b8b3b11..7109bdb 100644
--- a/SAMO-Interface/src/main/resources/messages.properties
+++ b/SAMO-Interface/src/main/resources/messages.properties
@@ -1,4 +1,16 @@
-#Fehlermeldungen
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+# Fehlermeldungen
could.not.push.message=Das Objekt konnte nicht an RabbitMQ gesendet werden.
diff --git a/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/controller/ImportControllerTest.java b/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/controller/ImportControllerTest.java
index 0328049..a256663 100644
--- a/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/controller/ImportControllerTest.java
+++ b/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/controller/ImportControllerTest.java
@@ -15,7 +15,6 @@
package org.eclipse.openk.gridfailureinformation.samointerface.controller;
import org.eclipse.openk.gridfailureinformation.samointerface.SarisInterfaceApplication;
-import org.eclipse.openk.gridfailureinformation.samointerface.api.StoerungsauskunftApi;
import org.eclipse.openk.gridfailureinformation.samointerface.service.ImportService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -37,9 +36,6 @@
public class ImportControllerTest {
@MockBean
- private StoerungsauskunftApi stoerungsauskunftApi;
-
- @MockBean
private ImportService importService;
@Autowired
diff --git a/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportServiceTest.java b/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportServiceTest.java
index 79c76cc..5534c5e 100644
--- a/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportServiceTest.java
+++ b/SAMO-Interface/src/test/java/org/eclipse/openk/gridfailureinformation/samointerface/service/ImportServiceTest.java
@@ -16,7 +16,6 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.eclipse.openk.gridfailureinformation.samointerface.SarisInterfaceApplication;
-import org.eclipse.openk.gridfailureinformation.samointerface.api.StoerungsauskunftApi;
import org.eclipse.openk.gridfailureinformation.samointerface.config.TestConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -38,9 +37,6 @@
@Autowired
ObjectMapper objectMapper;
- @MockBean
- StoerungsauskunftApi stoerungsauskunftApi;
-
/* @Test
public void shoulImportUserNotification() throws IOException {
diff --git a/addressImport/Dockerfile b/addressImport/Dockerfile
index cd97cb3..f849f88 100644
--- a/addressImport/Dockerfile
+++ b/addressImport/Dockerfile
@@ -1,7 +1,18 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
FROM openjdk:8-jre-alpine
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/addressImport/pom.xml b/addressImport/pom.xml
index cdd6bba..4b0ebff 100644
--- a/addressImport/pom.xml
+++ b/addressImport/pom.xml
@@ -1,11 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.2.4.RELEASE</version>
+ <version>2.2.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.eclipse.openk</groupId>
@@ -69,6 +83,10 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-security</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
@@ -112,6 +130,11 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
<version>${powerMockReflect.version}</version>
diff --git a/addressImport/sonar-project.properties b/addressImport/sonar-project.properties
index 5aa9988..501f52b 100644
--- a/addressImport/sonar-project.properties
+++ b/addressImport/sonar-project.properties
@@ -1,3 +1,15 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
# must be unique in a given SonarQube instance
sonar.projectKey=openk.pta.de:addressImporter
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
diff --git a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/AddressImportApplication.java b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/AddressImportApplication.java
index 212780f..44ff3ec 100644
--- a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/AddressImportApplication.java
+++ b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/AddressImportApplication.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.importadresses;
import org.springframework.boot.SpringApplication;
diff --git a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/config/SecurityConfig.java b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/config/SecurityConfig.java
new file mode 100644
index 0000000..236578f
--- /dev/null
+++ b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/config/SecurityConfig.java
@@ -0,0 +1,69 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
+package org.eclipse.openk.gridfailureinformation.importadresses.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.crypto.factory.PasswordEncoderFactories;
+import org.springframework.security.crypto.password.PasswordEncoder;
+
+
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(
+ prePostEnabled = true,
+ securedEnabled = true,
+ jsr250Enabled = true)
+public class SecurityConfig extends WebSecurityConfigurerAdapter {
+
+ @Value("${security.endpoint.user}")
+ private String user;
+ @Value("${security.endpoint.password}")
+ private String password;
+
+ @Override
+ protected void configure(HttpSecurity http ) throws Exception {
+ http
+ .csrf().disable()
+ .authorizeRequests().anyRequest().authenticated()
+ .and()
+ .httpBasic();
+ }
+
+ @Bean
+ public PasswordEncoder passwordEncoder() {
+ return PasswordEncoderFactories.createDelegatingPasswordEncoder();
+ }
+
+ @Autowired
+ public void configureGlobal(AuthenticationManagerBuilder auth)
+ throws Exception
+ {
+ auth.inMemoryAuthentication()
+ .withUser(user)
+ .password(passwordEncoder().encode(password))
+ .roles("USER");
+ }
+
+
+}
+
diff --git a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/config/SwaggerConfig.java b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/config/SwaggerConfig.java
index fbedd0d..21cc136 100644
--- a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/config/SwaggerConfig.java
+++ b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/config/SwaggerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.importadresses.config;
import lombok.extern.log4j.Log4j2;
@@ -18,9 +32,9 @@
@Profile("!prod")
public class SwaggerConfig {
- @Value("${swagger.baseUrl}")
+ @Value("${swagger.baseUrl:}")
public String baseUrl;
- @Value("${swagger.proxyUrl}")
+ @Value("${swagger.proxyUrl:}")
public String proxyUrl;
@Bean
diff --git a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AdressImportController.java b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AdressImportController.java
index 7e456c8..79d8242 100644
--- a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AdressImportController.java
+++ b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AdressImportController.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.importadresses.controller;
import io.swagger.annotations.ApiOperation;
diff --git a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/jobs/JobManager.java b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/jobs/JobManager.java
index b7fc5b5..7462249 100644
--- a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/jobs/JobManager.java
+++ b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/jobs/JobManager.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.importadresses.jobs;
import lombok.extern.log4j.Log4j2;
diff --git a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/service/AddressImportService.java b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/service/AddressImportService.java
index 38dd75c..0a6e993 100644
--- a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/service/AddressImportService.java
+++ b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/service/AddressImportService.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.importadresses.service;
import com.opencsv.CSVParser;
diff --git a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/util/UtmConverter.java b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/util/UtmConverter.java
index 0e03889..2a1fe48 100644
--- a/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/util/UtmConverter.java
+++ b/addressImport/src/main/java/org/eclipse/openk/gridfailureinformation/importadresses/util/UtmConverter.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.importadresses.util;
diff --git a/addressImport/src/main/resources/application.yml b/addressImport/src/main/resources/application.yml
index 863ad63..7abdedd 100644
--- a/addressImport/src/main/resources/application.yml
+++ b/addressImport/src/main/resources/application.yml
@@ -18,6 +18,8 @@
server:
max-http-header-size: 262144
+ error:
+ include-message: never
utm:
zoneNumber: 32
@@ -60,9 +62,9 @@
org.springframework.web: ERROR
org.hibernate: ERROR
-swagger:
- baseUrl:
- proxyUrl:
+security.endpoint:
+ user: ${GFI_MANUAL_ENDPOINTS_USERNAME}
+ password: ${GFI_MANUAL_ENDPOINTS_PASSWORD}
---
@@ -159,7 +161,6 @@
swagger:
baseUrl: /addressImporter
- proxyUrl:
adressimport:
cleanup: true
diff --git a/addressImport/src/main/resources/application_localdev.yml b/addressImport/src/main/resources/application_localdev.yml
index 055b657..e5a4cfa 100644
--- a/addressImport/src/main/resources/application_localdev.yml
+++ b/addressImport/src/main/resources/application_localdev.yml
@@ -74,10 +74,10 @@
org.eclipse.openk: DEBUG
org.springframework.web: ERROR
org.hibernate: ERROR
-
-swagger:
- baseUrl:
- proxyUrl:
+
+security.endpoint:
+ user: ${GFI_MANUAL_ENDPOINTS_USERNAME}
+ password: ${GFI_MANUAL_ENDPOINTS_PASSWORD}
---
diff --git a/addressImport/src/main/resources/logback-spring.xml b/addressImport/src/main/resources/logback-spring.xml
index 1e91265..a8cf2ee 100644
--- a/addressImport/src/main/resources/logback-spring.xml
+++ b/addressImport/src/main/resources/logback-spring.xml
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<configuration>
<property name="LOGS" value="./logs"/>
@@ -32,7 +46,7 @@
</root>
<!-- LOG "com.baeldungorg.eclipse.openk.contactbasedata*" at INFO level -->
- <logger name="org.eclipse.openk.gridfailureinformation.importadresses" level="info" additivity="false">
+ <logger name="org.eclipse.openk.gridfailureinformation.importadresses" additivity="false">
<appender-ref ref="RollingFile"/>
<appender-ref ref="Console"/>
</logger>
diff --git a/addressImport/src/test/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AddressImportControllerTest.java b/addressImport/src/test/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AddressImportControllerTest.java
index 5d467ee..c45fb37 100644
--- a/addressImport/src/test/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AddressImportControllerTest.java
+++ b/addressImport/src/test/java/org/eclipse/openk/gridfailureinformation/importadresses/controller/AddressImportControllerTest.java
@@ -21,8 +21,11 @@
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
+
+import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -39,6 +42,7 @@
private MockMvc mockMvc;
@Test
+ @WithMockUser(value = "mockedUser")
public void shouldTriggerStartImport() throws Exception {
mockMvc.perform(post("/addresses/import"))
@@ -46,4 +50,13 @@
verify(jobManager).triggerStartImport();
}
+
+ @Test
+ public void shouldTriggerStartImportAndReturnUnauthorized() throws Exception {
+
+ mockMvc.perform(post("/addresses/import"))
+ .andExpect(status().isUnauthorized());
+
+ verify(jobManager, times(0)).triggerStartImport();
+ }
}
diff --git a/addressImport/src/test/resources/application-test.yml b/addressImport/src/test/resources/application-test.yml
index c1b2fbe..ee48215 100644
--- a/addressImport/src/test/resources/application-test.yml
+++ b/addressImport/src/test/resources/application-test.yml
@@ -52,6 +52,10 @@
readTimeout: 60000
cors:
corsEnabled: false
+
+security.endpoint:
+ user: user
+ password: secret
---
diff --git a/gfsBackendService/Dockerfile_Branch b/gfsBackendService/Dockerfile_Branch
index 6b742d7..8249349 100644
--- a/gfsBackendService/Dockerfile_Branch
+++ b/gfsBackendService/Dockerfile_Branch
@@ -1,8 +1,20 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
+
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/gfsBackendService/Dockerfile_DevServer b/gfsBackendService/Dockerfile_DevServer
index 71fc8f5..4cfb8c6 100644
--- a/gfsBackendService/Dockerfile_DevServer
+++ b/gfsBackendService/Dockerfile_DevServer
@@ -1,8 +1,20 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
+
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/gfsBackendService/Dockerfile_DevServerUnsecure b/gfsBackendService/Dockerfile_DevServerUnsecure
index 0db171e..fed7633 100644
--- a/gfsBackendService/Dockerfile_DevServerUnsecure
+++ b/gfsBackendService/Dockerfile_DevServerUnsecure
@@ -1,8 +1,20 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
+
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/gfsBackendService/pom.xml b/gfsBackendService/pom.xml
index f277f84..b241807 100644
--- a/gfsBackendService/pom.xml
+++ b/gfsBackendService/pom.xml
@@ -1,11 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.2.4.RELEASE</version>
+ <version>2.2.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.eclipse.openk</groupId>
@@ -52,8 +67,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-integration</artifactId>
- <version>2.2.5.RELEASE</version>
+ <artifactId>spring-boot-starter-integration</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
diff --git a/gfsBackendService/sonar-project.properties b/gfsBackendService/sonar-project.properties
index 58afd24..c14723e 100644
--- a/gfsBackendService/sonar-project.properties
+++ b/gfsBackendService/sonar-project.properties
@@ -1,3 +1,15 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
# must be unique in a given SonarQube instance
sonar.projectKey=openk.pta.de:gfsBackendService
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/GridFailureInformationApplication.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/GridFailureInformationApplication.java
index 7972ecb..a09cc1f 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/GridFailureInformationApplication.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/GridFailureInformationApplication.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation;
import org.springframework.boot.SpringApplication;
@@ -5,7 +19,6 @@
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication
@EnableFeignClients
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/api/impl/CustomPageImpl.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/api/impl/CustomPageImpl.java
index 2218cc0..c6870ee 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/api/impl/CustomPageImpl.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/api/impl/CustomPageImpl.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.api.impl;
import com.fasterxml.jackson.annotation.JsonCreator;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/GfiProcessEnvironment.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/GfiProcessEnvironment.java
index dbe09ea..60a7be4 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/GfiProcessEnvironment.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/GfiProcessEnvironment.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import lombok.Data;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/tasks/ProcessHelper.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/tasks/ProcessHelper.java
index 588a4d0..0ef574a 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/tasks/ProcessHelper.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/tasks/ProcessHelper.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl.tasks;
import lombok.RequiredArgsConstructor;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/CorsConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/CorsConfig.java
index a21064c..195bf2b 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/CorsConfig.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/CorsConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config;
import lombok.Data;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/DmzExportSchedulerConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/DmzExportSchedulerConfig.java
index 54edae4..70756a8 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/DmzExportSchedulerConfig.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/DmzExportSchedulerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config;
import lombok.extern.log4j.Log4j2;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/ExceptionHandlerConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/ExceptionHandlerConfig.java
new file mode 100644
index 0000000..e50525b
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/ExceptionHandlerConfig.java
@@ -0,0 +1,51 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
+package org.eclipse.openk.gridfailureinformation.config;
+
+import org.springframework.boot.web.servlet.error.DefaultErrorAttributes;
+import org.springframework.boot.web.servlet.error.ErrorAttributes;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.context.request.WebRequest;
+
+import java.util.Map;
+
+@Configuration
+public class ExceptionHandlerConfig {
+ public static final String KEY_STATUS = "status";
+ public static final String KEY_ERROR = "error";
+ public static final String KEY_MESSAGE = "message";
+ public static final String KEY_TIMESTAMP = "timestamp";
+ public static final String KEY_ERRORS = "errors";
+
+ @Bean
+ public ErrorAttributes errorAttributes() {
+ return new DefaultErrorAttributes() {
+
+ @Override
+ public Map<String ,Object> getErrorAttributes(
+ WebRequest webRequest
+ ,boolean includeStackTrace
+ ) {
+ Map<String ,Object> defaultMap
+ = super.getErrorAttributes( webRequest , false );
+
+ defaultMap.put(KEY_MESSAGE, "");
+
+ return defaultMap;
+ }
+ };
+ }
+}
\ No newline at end of file
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java
index 9d1c5f0..5573f3b 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/FESettings.java
@@ -46,6 +46,9 @@
@Value("${spring.settings.overviewMapInitialLongitude}")
public String overviewMapInitialLongitude;
+ @Value("${spring.settings.dataExternInitialVisibility}")
+ public String dataExternInitialVisibility;
+
@Value("${spring.settings.emailSubjectCompleteInit:}")
private String emailSubjectCompleteInit;
@Value("${spring.settings.emailContentCompleteInit:}")
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/JpaAuditConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/JpaAuditConfig.java
index bfb34a7..1dcb0a1 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/JpaAuditConfig.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/JpaAuditConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config;
import org.springframework.context.annotation.Bean;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/ResourceConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/ResourceConfig.java
index 73c4f90..ac058ee 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/ResourceConfig.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/ResourceConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config;
import lombok.extern.log4j.Log4j2;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/SwaggerConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/SwaggerConfig.java
index fa4d1d0..6f23bb0 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/SwaggerConfig.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/SwaggerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config;
import lombok.extern.log4j.Log4j2;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqChannel.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqChannel.java
index 6dc3210..84cd8b0 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqChannel.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqChannel.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config.rabbitMq;
import lombok.AllArgsConstructor;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java
index d0de867..662142d 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config.rabbitMq;
import lombok.Data;
@@ -11,6 +25,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
+
import javax.annotation.PostConstruct;
@Profile("!test & !testCors")
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java
index 05e9a1b..381f3de 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/rabbitMq/RabbitMqProperties.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config.rabbitMq;
import lombok.Getter;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/constants/Constants.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/constants/Constants.java
index c67d851..0162baa 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/constants/Constants.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/constants/Constants.java
@@ -43,6 +43,7 @@
public static final String CHANNEL_NOT_EXISTING = "channel.not.existing";
public static final String PUBLICATION_CHANNEL_MAIL = "Mail";
+ public static final String PUBLICATION_CHANNEL_OWNDMZ = "Störinfotool-eigene-Web-Komponenten";
public static final String FREETEXT_ADDRESS_TYPE="freetext";
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ExportController.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ExportController.java
index 6a02b9b..6347b25 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ExportController.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ExportController.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.controller;
import io.swagger.annotations.ApiOperation;
@@ -8,7 +22,11 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.annotation.Secured;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
import java.util.UUID;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ImportMessageConsumer.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ImportMessageConsumer.java
index 016a2d5..6c7e185 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ImportMessageConsumer.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/ImportMessageConsumer.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.controller;
import lombok.extern.log4j.Log4j2;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/enums/OperationType.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/enums/OperationType.java
index 6be1e24..fa1826d 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/enums/OperationType.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/enums/OperationType.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.enums;
public enum OperationType {
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/OperationDeniedException.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/OperationDeniedException.java
index 3c87da4..851bcde 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/OperationDeniedException.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/OperationDeniedException.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.exceptions;
import org.eclipse.openk.gridfailureinformation.enums.OperationType;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/UnauthorizedException.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/UnauthorizedException.java
index 3c09f21..3204661 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/UnauthorizedException.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/exceptions/UnauthorizedException.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.exceptions;
import org.springframework.http.HttpStatus;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/tools/AddressSplitterMerger.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/tools/AddressSplitterMerger.java
index ca367d8..792103c 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/tools/AddressSplitterMerger.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/tools/AddressSplitterMerger.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mapper.tools;
import org.eclipse.openk.gridfailureinformation.constants.Constants;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java
index 9bc57c7..8bb0f25 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/HtblFailureInformation.java
@@ -73,6 +73,7 @@
private String publicationFreetext;
private Boolean condensed;
private String addressType;
+ private String faultLocationArea;
@CreatedDate
@Column(name = "create_date")
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java
index 5b7c41c..89563e1 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/model/TblFailureInformation.java
@@ -76,6 +76,7 @@
private Boolean condensed;
private Integer condensedCount;
private String addressType;
+ private String faultLocationArea;
@CreatedDate
@Column(name = "create_date")
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/AddressRepository.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/AddressRepository.java
index 4e1791d..b3b4818 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/AddressRepository.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/AddressRepository.java
@@ -52,6 +52,8 @@
List<String> findAllCommunitysForDistrictheating();
@Query("select distinct a.community from TblAddress a where telecommConnection = true")
List<String> findAllCommunitysForTelecomm();
+ @Query("select distinct a from TblAddress a where postcode = :postcode and community = :community and district = :district and street = :street and housenumber = :housenumber")
+ List<TblAddress> findByCompleteAdress(String postcode, String community, String district, String street, String housenumber);
@Query("select distinct a.district from TblAddress a where community = :community")
List<String> findDistrictsByCommunity(@Param("community") String community);
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/AddressService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/AddressService.java
index a9c1e0c..518de9d 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/AddressService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/AddressService.java
@@ -138,7 +138,7 @@
communityList = addressRepository.findAllCommunitys();
}
- return communityList;
+ return communityList.stream().filter(c -> !c.isEmpty()).collect(toCollection(ArrayList::new));
}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java
index a418990..1c4bfed 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ExportService.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.service;
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -49,6 +63,8 @@
import java.util.UUID;
import java.util.stream.Collectors;
+import static org.eclipse.openk.gridfailureinformation.constants.Constants.PUBLICATION_CHANNEL_OWNDMZ;
+
@Service
@Log4j2
@Validated
@@ -209,6 +225,7 @@
List<FailureInformationDto> failureInfoDtossVeroeffentlicht = tblFailureInfosVeroeffentlicht.stream()
.filter( x -> currTableViewUuidSet.contains(x.getUuid()))
+ .filter( this::hasSITWebComponentChannel)
.map( failureInformationMapper::toFailureInformationDto )
.map( failureInformationService::enrichFailureInfo )
.collect(Collectors.toList());
@@ -221,7 +238,13 @@
}
}
- public void exportFeSettingsToDMZ(){
+ private boolean hasSITWebComponentChannel(TblFailureInformation x) {
+ return publicationChannelRepository.findByTblFailureInformation(x).stream()
+ .map(TblFailureInformationPublicationChannel::getPublicationChannel)
+ .anyMatch( PUBLICATION_CHANNEL_OWNDMZ::equalsIgnoreCase);
+ }
+
+ public void exportFeSettingsToDMZ(){
try {
sitCacheApi.postFeSettings(settingsService.getFESettings());
} catch (Exception e) {
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java
index 9bfcef4..768a9ef 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationService.java
@@ -28,7 +28,6 @@
import org.eclipse.openk.gridfailureinformation.exceptions.OperationDeniedException;
import org.eclipse.openk.gridfailureinformation.mapper.FailureInformationMapper;
import org.eclipse.openk.gridfailureinformation.mapper.FailureInformationPublicationChannelMapper;
-import org.eclipse.openk.gridfailureinformation.mapper.tools.AddressSplitterMerger;
import org.eclipse.openk.gridfailureinformation.model.HtblFailureInformation;
import org.eclipse.openk.gridfailureinformation.model.RefBranch;
import org.eclipse.openk.gridfailureinformation.model.RefExpectedReason;
@@ -81,8 +80,6 @@
import java.util.UUID;
import java.util.stream.Collectors;
-import static org.eclipse.openk.gridfailureinformation.constants.Constants.FREETEXT_ADDRESS_TYPE;
-
@Log4j2
@Service
public class FailureInformationService {
@@ -271,7 +268,7 @@
= failureInformationStationRepository.findByFkTblFailureInformation(tblToStore.getId());
failureInformationStationRepository.deleteAll(tblFailureStations);
- stationSet.forEach(x-> {
+ stationList.forEach(x-> {
TblFailureInformationStation newRecord = new TblFailureInformationStation();
newRecord.setStationStationId(x.getStationId());
newRecord.setFkTblFailureInformation(tblToStore.getId());
@@ -581,46 +578,62 @@
private void setAddress(List<TblFailureInformation> listFailureInfos, TblFailureInformation condensedFailureInformation){
- Optional<TblFailureInformation> firstCompleteFailureInformation = listFailureInfos
- .stream()
- .filter(f -> (f.getPostcode() != null && f.getStreet() != null && f.getHousenumber() != null) || (f.getAddressType() != null && f.getAddressType().equals(FREETEXT_ADDRESS_TYPE)))
- .findFirst();
+ resetCondensedFailureInformationAdress(condensedFailureInformation);
- if (!firstCompleteFailureInformation.isPresent()) {
- setCondensedFailureInformationAddress(condensedFailureInformation, null);
- } else {
- String address = concatAddress(firstCompleteFailureInformation.get());
+ setAddressForCondensedFailureInformation(listFailureInfos, condensedFailureInformation);
- List<TblFailureInformation> filteredList = listFailureInfos
- .stream()
- .filter(f -> (f.getPostcode() != null && f.getStreet() != null && f.getHousenumber() != null) || (f.getAddressType() != null && f.getAddressType().equals(FREETEXT_ADDRESS_TYPE)))
- .filter(f -> concatAddress(f).equals(address))
- .collect(Collectors.toList());
+ }
- if (listFailureInfos.size() == filteredList.size()) {
- setCondensedFailureInformationAddress(condensedFailureInformation, firstCompleteFailureInformation.get());
+ private void resetCondensedFailureInformationAdress(TblFailureInformation condensedFailureInformation) {
+ condensedFailureInformation.setCity(null);
+ condensedFailureInformation.setDistrict(null);
+ condensedFailureInformation.setPostcode(null);
+ condensedFailureInformation.setStreet(null);
+ condensedFailureInformation.setHousenumber(null);
+ condensedFailureInformation.setLongitude(null);
+ condensedFailureInformation.setLatitude(null);
+ condensedFailureInformation.setAddressType(null);
+ }
+
+ private void setAddressForCondensedFailureInformation(List<TblFailureInformation> listFailureInfos,
+ TblFailureInformation condensedFailureInformation) {
+ Optional<TblFailureInformation> tblInfTocheck =
+ listFailureInfos.stream().filter(f -> (f.getCity() != null)).findFirst();
+ if (tblInfTocheck.isPresent()) {
+ long count =
+ listFailureInfos.stream().filter(p -> tblInfTocheck.get().getCity().equals(p.getCity())).count();
+ if (count == listFailureInfos.size()) {
+ condensedFailureInformation.setCity(tblInfTocheck.get().getCity());
+ condensedFailureInformation.setDistrict(tblInfTocheck.get().getDistrict());
+ condensedFailureInformation.setPostcode(tblInfTocheck.get().getPostcode());
+ condensedFailureInformation.setStreet(tblInfTocheck.get().getStreet());
+ condensedFailureInformation.setHousenumber(tblInfTocheck.get().getHousenumber());
+ condensedFailureInformation.setLongitude(tblInfTocheck.get().getLongitude());
+ condensedFailureInformation.setLatitude(tblInfTocheck.get().getLatitude());
+ condensedFailureInformation.setAddressType(tblInfTocheck.get().getAddressType());
+ condensedFailureInformation.setFaultLocationArea(tblInfTocheck.get().getFaultLocationArea());
}
- else{
- setCondensedFailureInformationAddress(condensedFailureInformation, null);
- }
+ }
+ else {
+ // There is not info in the list having at least a city
+ // ... so try at least to merge the coordinates
+ setCondensedFailureInformationCoordinates( listFailureInfos, condensedFailureInformation);
}
}
- private void setCondensedFailureInformationAddress(TblFailureInformation condensedFailureInformation, TblFailureInformation failureInformation) {
- condensedFailureInformation.setPostcode(failureInformation != null ? failureInformation.getPostcode() : null);
- condensedFailureInformation.setStreet(failureInformation != null ? failureInformation.getStreet() : null);
- condensedFailureInformation.setHousenumber(failureInformation != null ? failureInformation.getHousenumber() : null);
- condensedFailureInformation.setCity(failureInformation != null ? failureInformation.getCity() : null);
- condensedFailureInformation.setDistrict(failureInformation != null ? failureInformation.getDistrict() : null);
- condensedFailureInformation.setLongitude(failureInformation != null ? failureInformation.getLongitude() : null);
- condensedFailureInformation.setLatitude(failureInformation != null ? failureInformation.getLatitude() : null);
- condensedFailureInformation.setAddressType(failureInformation != null ? failureInformation.getAddressType() : null);
+
+ //set first found coordinates if there is no consense at all
+ private void setCondensedFailureInformationCoordinates(List<TblFailureInformation> listFailureInfos, TblFailureInformation condensedFailureInformation) {
+ Optional<TblFailureInformation> firstFailureInformationFiltered = listFailureInfos
+ .stream().filter(f -> (f.getLongitude() != null && f.getLatitude() != null )).findFirst();
+
+ if (firstFailureInformationFiltered.isPresent()) {
+ condensedFailureInformation.setLongitude(firstFailureInformationFiltered.get().getLongitude());
+ condensedFailureInformation.setLatitude(firstFailureInformationFiltered.get().getLatitude());
+ condensedFailureInformation.setFaultLocationArea(firstFailureInformationFiltered.get().getFaultLocationArea());
+ }
}
- private String concatAddress(TblFailureInformation failureInformation) {
- if (failureInformation == null) return null;
- return failureInformation.getPostcode() + failureInformation.getStreet() + failureInformation.getHousenumber();
- }
private void setExpectedReason(List<TblFailureInformation> listFailureInfos, TblFailureInformation condensedFailureInformation){
RefExpectedReason firstExpReason = listFailureInfos.get(0).getRefExpectedReason();
@@ -821,7 +834,16 @@
.orElseThrow(() -> new NotFoundException("failure.info.uuid.not.existing"));
if(isStatusNewPlannedCreated(existingTblFailureInformation)){
-
+
+ if (existingTblFailureInformation.getTblFailureInformationCondensed() != null) {
+ TblFailureInformation tblFailureInformationCondensed =
+ existingTblFailureInformation.getTblFailureInformationCondensed();
+
+ Integer condensedCount = tblFailureInformationCondensed.getCondensedCount();
+ tblFailureInformationCondensed.setCondensedCount(--condensedCount);
+ failureInformationRepository.save(tblFailureInformationCondensed);
+ }
+
failureInformationPublicationChannelRepository.findByTblFailureInformation(existingTblFailureInformation)
.forEach(failureInformationPublicationChannelRepository::delete);
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ImportService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ImportService.java
index f6afdc0..534688b 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ImportService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/ImportService.java
@@ -1,16 +1,39 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.service;
import lombok.extern.log4j.Log4j2;
+import org.apache.commons.lang.StringUtils;
import org.eclipse.openk.gridfailureinformation.bpmn.impl.GfiProcessState;
+import org.eclipse.openk.gridfailureinformation.constants.Constants;
import org.eclipse.openk.gridfailureinformation.exceptions.InternalServerErrorException;
import org.eclipse.openk.gridfailureinformation.mapper.FailureInformationMapper;
+import org.eclipse.openk.gridfailureinformation.model.TblAddress;
+import org.eclipse.openk.gridfailureinformation.repository.AddressRepository;
import org.eclipse.openk.gridfailureinformation.util.ImportDataValidator;
-import org.eclipse.openk.gridfailureinformation.viewmodel.*;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureInformationDto;
+import org.eclipse.openk.gridfailureinformation.viewmodel.ForeignFailureDataDto;
+import org.eclipse.openk.gridfailureinformation.viewmodel.ImportDataDto;
+import org.eclipse.openk.gridfailureinformation.viewmodel.RadiusDto;
+import org.eclipse.openk.gridfailureinformation.viewmodel.StationDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
+import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;
import java.util.Optional;
@@ -37,6 +60,9 @@
StationService stationService;
@Autowired
+ private AddressRepository addressRepository;
+
+ @Autowired
FailureInformationMapper failureInformationMapper;
@Autowired
@@ -71,20 +97,41 @@
gfiProcessState = GfiProcessState.NEW;
}
+ if (foreignFailureDataDto.isAutopublish()) {
+ gfiProcessState = GfiProcessState.QUALIFIED;
+ failureInformationDto.setPublicationStatus(Constants.PUB_STATUS_VEROEFFENTLICHT);
+ }
+
FailureInformationDto retVal = failureInformationService.insertFailureInfo(failureInformationDto, gfiProcessState);
- log.info("External failure information [" + importDataDto.getMetaId() + "] from " + importDataDto.getSource() + " imported (inserted).");
+ log.info("External failure information [MetaId: " + importDataDto.getMetaId() + "] from " + importDataDto.getSource() + " imported (inserted).");
return retVal;
- }
- else {
+ } else {
+
+ UUID statusInternIdExistingDto = existingDto.getStatusInternId();
+
+ //When status of already existing failureinformation completed or canceled do not update but log it.
+ if (statusInternIdExistingDto.equals(statusService.getStatusFromId(GfiProcessState.COMPLETED.getStatusValue()).getUuid()) ||
+ statusInternIdExistingDto.equals(statusService.getStatusFromId(GfiProcessState.CANCELED.getStatusValue()).getUuid())) {
+ log.info("External failure information [MetaId: " + importDataDto.getMetaId() + "] from " + importDataDto.getSource() +
+ " tried to update already existing failure information [UUID: "+ existingDto.getUuid() + "]" +
+ " but was ignored since its status is already CANCELED or COMPLETED.");
+ return null;
+ }
+
FailureInformationDto updatedDto = setUpdateFromForeignDto(importDataDto, foreignFailureDataDto, existingDto);
- if( existingDto.getStatusInternId().equals(
+ if(!foreignFailureDataDto.isAutopublish() && statusInternIdExistingDto.equals(
statusService.getStatusFromId(GfiProcessState.QUALIFIED.getStatusValue()).getUuid()
)) {
updatedDto.setStatusInternId(
statusService.getStatusFromId(GfiProcessState.UPDATED.getStatusValue()).getUuid()
);
+ } else {
+ if (foreignFailureDataDto.isAutopublish()) {
+ log.info("Autopublish for external failure information [" + importDataDto.getMetaId() + "] from " + importDataDto.getSource() + " is true, current status remains unchanged.");
+ }
}
+
FailureInformationDto retVal = failureInformationService.updateFailureInfo(updatedDto);
log.info("External failure information [" + importDataDto.getMetaId() + "] from " + importDataDto.getSource() + " imported (updated).");
return retVal;
@@ -108,26 +155,28 @@
private void setFromForeignDto(ImportDataDto importDataDto, ForeignFailureDataDto foreignFailureDataDto, FailureInformationDto failureInformationDto) {
- failureInformationDto.setCity(foreignFailureDataDto.getCity());
- failureInformationDto.setDistrict(foreignFailureDataDto.getDistrict());
failureInformationDto.setFailureBegin(foreignFailureDataDto.getFailureBegin());
failureInformationDto.setFailureEndPlanned(foreignFailureDataDto.getFailureEndPlanned());
failureInformationDto.setFailureEndResupplied(foreignFailureDataDto.getFailureEndResupplied());
- failureInformationDto.setHousenumber(foreignFailureDataDto.getHousenumber());
failureInformationDto.setDescription(foreignFailureDataDto.getDescription());
- failureInformationDto.setLatitude(foreignFailureDataDto.getLatitude());
- failureInformationDto.setLongitude(foreignFailureDataDto.getLongitude());
- failureInformationDto.setPostcode(foreignFailureDataDto.getPostcode());
failureInformationDto.setPressureLevel(foreignFailureDataDto.getPressureLevel());
failureInformationDto.setStationDescription(foreignFailureDataDto.getStationDescription());
String foreignStationId = foreignFailureDataDto.getStationId();
failureInformationDto.setStationId(foreignStationId);
+
+ failureInformationDto.setPostcode(foreignFailureDataDto.getPostcode());
+ failureInformationDto.setCity(foreignFailureDataDto.getCity());
+ failureInformationDto.setDistrict(foreignFailureDataDto.getDistrict());
+ failureInformationDto.setStreet(foreignFailureDataDto.getStreet());
+ failureInformationDto.setHousenumber(foreignFailureDataDto.getHousenumber());
+
+ setCoordinates(foreignFailureDataDto, failureInformationDto);
+
failureInformationDto.setStationIds(new LinkedList<>());
if( foreignStationId != null && !foreignStationId.isEmpty()) {
importStation(failureInformationDto.getStationIds(), foreignStationId);
}
- failureInformationDto.setStreet(foreignFailureDataDto.getStreet());
failureInformationDto.setVoltageLevel(foreignFailureDataDto.getVoltageLevel());
String branchName = foreignFailureDataDto.getBranch();
@@ -142,6 +191,26 @@
failureInformationDto.setObjectReferenceExternalSystem(importDataDto.getAssembledRefId());
}
+ private void setCoordinates(ForeignFailureDataDto foreignFailureDataDto, FailureInformationDto failureInformationDto) {
+ BigDecimal latitude = foreignFailureDataDto.getLatitude();
+ BigDecimal longitude = foreignFailureDataDto.getLongitude();
+
+ if (StringUtils.isNotBlank(failureInformationDto.getHousenumber())) {
+ List<TblAddress> uniqueAddressList =
+ addressRepository.findByCompleteAdress(failureInformationDto.getPostcode(),
+ failureInformationDto.getCity(), failureInformationDto.getDistrict(),
+ failureInformationDto.getStreet(), failureInformationDto.getHousenumber());
+ if (!uniqueAddressList.isEmpty()) {
+ TblAddress uniqueTblAddress = uniqueAddressList.get(0);
+ latitude = uniqueTblAddress.getLatitude();
+ longitude = uniqueTblAddress.getLongitude();
+ }
+ }
+
+ failureInformationDto.setLatitude(latitude);
+ failureInformationDto.setLongitude(longitude);
+ }
+
private void importStation(List<UUID> targetList, String stationIdToImport) {
StationDto selectedStation = stationService.getStationsById( stationIdToImport );
if( selectedStation != null ) {
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java
index 501fb27..a9c7777 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/SettingsService.java
@@ -57,6 +57,8 @@
feSettingsDto.setOverviewMapInitialLatitude(feSettings.getOverviewMapInitialLatitude());
feSettingsDto.setOverviewMapInitialLongitude(feSettings.getOverviewMapInitialLongitude());
+ feSettingsDto.setDataExternInitialVisibility(feSettings.getDataExternInitialVisibility());
+
FESettingsDto.VisibilityConfiguration visibilityConfiguration = new FESettingsDto.VisibilityConfiguration();
feSettingsDto.setVisibilityConfiguration(visibilityConfiguration);
visibilityConfiguration.setFieldVisibility(
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/StationService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/StationService.java
index 13d4bb1..142cbd3 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/StationService.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/StationService.java
@@ -43,6 +43,8 @@
public List<StationDto> getStations() {
return stationRepository.findAll().stream()
.map(stationMapper::toStationDto)
+ .sorted( (x, y) -> (x.getStationName()+"@"+ x.getStationId())
+ .compareTo(y.getStationName()+"@"+y.getStationId()))
.collect(Collectors.toList());
}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilter.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilter.java
index 521224e..7c6d32f 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilter.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilter.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.util;
import org.eclipse.openk.gridfailureinformation.model.TblAddress;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java
index 26ebeb4..961211f 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FESettingsDto.java
@@ -90,5 +90,7 @@
private String overviewMapInitialLatitude;
private String overviewMapInitialLongitude;
+ private String dataExternInitialVisibility;
+
private VisibilityConfiguration visibilityConfiguration;
}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureInformationDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureInformationDto.java
index b63b7c5..11ae178 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureInformationDto.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureInformationDto.java
@@ -64,6 +64,7 @@
private String publicationFreetext;
private Boolean condensed;
private Long condensedCount;
+ private String faultLocationArea;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
private Date createDate;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ForeignFailureDataDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ForeignFailureDataDto.java
index 08c298c..80ebf19 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ForeignFailureDataDto.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ForeignFailureDataDto.java
@@ -30,6 +30,8 @@
@Data
public class ForeignFailureDataDto implements Serializable {
+ private boolean isAutopublish;
+
@NotNull
private boolean isPlanned;
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ImportDataDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ImportDataDto.java
index f528277..bd447de 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ImportDataDto.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/ImportDataDto.java
@@ -49,7 +49,7 @@
@NotNull
@Size(max=100)
- @Pattern(regexp="[A-Za-z0-9\\s_/(),.;:-]+")
+ @Pattern(regexp="[A-Za-z0-9ÄäÖöÜüß\\s_/(),.;:-]+")
private String source;
@NotNull
diff --git a/gfsBackendService/src/main/resources/application.yml b/gfsBackendService/src/main/resources/application.yml
index 743a97d..ef6e0bd 100644
--- a/gfsBackendService/src/main/resources/application.yml
+++ b/gfsBackendService/src/main/resources/application.yml
@@ -40,6 +40,9 @@
- name: Störungsauskunft.de
exportQueue: sit_stoerungsauskunft_export_queue
exportKey: sit_stoerungsauskunft_export_key
+ - name: Störinfotool-eigene-Web-Komponenten
+ exportQueue: sit_own_export_queue
+ exportKey: sit_own_export_key
# UI Setting (Map)
settings:
@@ -48,6 +51,7 @@
overviewMapInitialLatitude: 49.656634
overviewMapInitialLongitude: 8.423207
daysInPastToShowClosedInfos: 365
+ dataExternInitialVisibility: hide
# Initial emailsubject and content
emailSubjectPublishInit: "Die Störung (Sparte: $Sparte$) mit Beginn: $Störungsbeginn_gemeldet$ wurde in den Status veröffentlicht geändert."
emailContentPublishInit: "Veröffentlicht [TEST]\n
@@ -89,28 +93,28 @@
visibilityConfiguration:
fieldVisibility:
- failureClassification: hide
- responsibility: hide
- description: hide
- internalRemark: hide
+ failureClassification: show
+ responsibility: show
+ description: show
+ internalRemark: show
tableInternColumnVisibility:
- failureClassification: hide
+ failureClassification: show
responsibility: show
description: show
statusIntern: show
statusExtern: show
publicationStatus: show
branch: show
- voltageLevel: hide
+ voltageLevel: show
pressureLevel: show
failureBegin: show
failureEndPlanned: show
failureEndResupplied: show
- expectedReasonText: hide
+ expectedReasonText: show
internalRemark: show
postcode: show
city: show
- district: hide
+ district: show
street: show
housenumber: show
radius: show
@@ -118,14 +122,14 @@
tableExternColumnVisibility:
branch: show
failureBegin: show
- failureEndPlanned: hide
+ failureEndPlanned: show
expectedReasonText: show
description: show
- postcode: hide
+ postcode: show
city: show
- district: hide
+ district: show
street: show
- failureClassification: hide
+ failureClassification: show
mapExternTooltipVisibility:
failureBegin: show
failureEndPlanned: show
@@ -158,8 +162,8 @@
services:
authNAuth:
name: authNAuthService
- technical-username: admin_technical_portal
- technical-userpassword: admin_technical_portal
+ technical-username: ${GFI_AUTHNAUTH_USERNAME}
+ technical-userpassword: ${GFI_AUTHNAUTH_PASSWORD}
contacts:
name: contactService
communicationType:
@@ -223,6 +227,11 @@
simple:
auto-startup: false
+services:
+ authNAuth:
+ name: authNAuthService
+ technical-username: Testme
+ technical-userpassword: Testme
jpa:
hibernate:
@@ -251,6 +260,12 @@
simple:
auto-startup: false
+services:
+ authNAuth:
+ name: authNAuthService
+ technical-username: Testme
+ technical-userpassword: Testme
+
flyway:
enabled: false
@@ -337,7 +352,9 @@
- name: Störungsauskunft.de
exportQueue: sit_stoerungsauskunft_export_queue_branch
exportKey: sit_stoerungsauskunft_export_key
-
+ - name: Störinfotool-eigene-Web-Komponenten
+ exportQueue: sit_own_export_queue
+ exportKey: sit_own_export_key
logging:
level:
root: INFO
@@ -388,7 +405,9 @@
- name: Störungsauskunft.de
exportQueue: sit_stoerungsauskunft_export_queue
exportKey: sit_stoerungsauskunft_export_key
-
+ - name: Störinfotool-eigene-Web-Komponenten
+ exportQueue: sit_own_export_queue
+ exportKey: sit_own_export_key
logging:
level:
root: INFO
@@ -413,8 +432,8 @@
services:
authNAuth:
name: authNAuthService
- technical-username: admin_technical_portal
- technical-userpassword: admin_technical_portal
+ technical-username: ${GFI_AUTHNAUTH_USERNAME}
+ technical-userpassword: ${GFI_AUTHNAUTH_PASSWORD}
contacts:
name: contactService
communicationType:
diff --git a/gfsBackendService/src/main/resources/application_localdev.yml b/gfsBackendService/src/main/resources/application_localdev.yml
index d2bd903..9840c9a 100644
--- a/gfsBackendService/src/main/resources/application_localdev.yml
+++ b/gfsBackendService/src/main/resources/application_localdev.yml
@@ -13,8 +13,8 @@
backend-version: 0.0.1
spring:
datasource:
- url: jdbc:postgresql://entopticadirx:5432/GridFailureInfoDevelop
- #url: jdbc:postgresql://entopticadirx:5432/GridFailureInfoDevServer
+ #url: jdbc:postgresql://entopticadirx:5432/GridFailureInfoDevelop
+ url: jdbc:postgresql://entopticadirx:5432/GridFailureInfoDevServer
username: ${GFI_DB_USERNAME}
password: ${GFI_DB_PASSWORD}
max-active: 5
@@ -49,6 +49,7 @@
overviewMapInitialLatitude: 49.656634
overviewMapInitialLongitude: 8.423207
daysInPastToShowClosedInfos: 365
+ dataExternInitialVisibility: hide
# Initial emailsubject and content
emailSubjectPublishInit: "Die Störung (Sparte: $Sparte$) mit Beginn: $Störungsbeginn_gemeldet$ wurde in den Status veröffentlicht geändert."
emailContentPublishInit: "Veröffentlicht [TEST]\n
@@ -90,28 +91,28 @@
visibilityConfiguration:
fieldVisibility:
- failureClassification: hide
- responsibility: hide
- description: hide
- internalRemark: hide
+ failureClassification: show
+ responsibility: show
+ description: show
+ internalRemark: show
tableInternColumnVisibility:
- failureClassification: hide
+ failureClassification: show
responsibility: show
description: show
statusIntern: show
statusExtern: show
publicationStatus: show
branch: show
- voltageLevel: hide
+ voltageLevel: show
pressureLevel: show
failureBegin: show
failureEndPlanned: show
failureEndResupplied: show
- expectedReasonText: hide
+ expectedReasonText: show
internalRemark: show
postcode: show
city: show
- district: hide
+ district: show
street: show
housenumber: show
radius: show
@@ -119,14 +120,14 @@
tableExternColumnVisibility:
branch: show
failureBegin: show
- failureEndPlanned: hide
+ failureEndPlanned: show
expectedReasonText: show
description: show
- postcode: hide
+ postcode: show
city: show
- district: hide
+ district: show
street: show
- failureClassification: hide
+ failureClassification: show
mapExternTooltipVisibility:
failureBegin: show
failureEndPlanned: show
diff --git a/gfsBackendService/src/main/resources/db/migration/V0_58__faultLocationArea.sql b/gfsBackendService/src/main/resources/db/migration/V0_58__faultLocationArea.sql
new file mode 100644
index 0000000..a781624
--- /dev/null
+++ b/gfsBackendService/src/main/resources/db/migration/V0_58__faultLocationArea.sql
@@ -0,0 +1,154 @@
+-----------------------------------------------------------------------------------
+-- ******************************************************************************
+-- * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+-- * http://www.eclipse.org/legal/epl-2.0.
+-- *
+-- * SPDX-License-Identifier: EPL-2.0
+-- *******************************************************************************
+-----------------------------------------------------------------------------------
+ALTER TABLE public.TBL_FAILURE_INFORMATION ADD COLUMN fault_location_area varchar(20);
+ALTER TABLE public.HTBL_FAILURE_INFORMATION ADD COLUMN fault_location_area varchar(20);
+
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+-- TRIGGER
+-- ----------------------------------------------------------------------------
+-- ----------------------------------------------------------------------------
+
+
+-- PUBLIC.TBL_FAILURE_INFORMATION INSERT TRIGGER --
+-- <GENERATED CODE!>
+CREATE OR REPLACE FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG()
+ RETURNS trigger AS
+$BODY$
+ BEGIN
+ INSERT INTO HTBL_FAILURE_INFORMATION (
+ ID,UUID,VERSION_NUMBER,FK_REF_FAILURE_CLASSIFICATION,TITLE,DESCRIPTION,RESPONSIBILITY,FK_REF_STATUS_INTERN, FK_REF_BRANCH,VOLTAGE_LEVEL,PRESSURE_LEVEL,FAILURE_BEGIN,FAILURE_END_PLANNED,FAILURE_END_RESUPPLIED,INTERNAL_REMARK,POSTCODE,CITY,DISTRICT,STREET,HOUSENUMBER,STATION_ID,STATION_DESCRIPTION,STATION_COORDS,FK_REF_RADIUS,LONGITUDE,LATITUDE,FK_TBL_FAILURE_INFORMATION_CONDENSED,CONDENSED,CONDENSED_COUNT,OBJECT_REFERENCE_EXTERNAL_SYSTEM,PUBLICATION_STATUS,PUBLICATION_FREETEXT,FK_REF_EXPECTED_REASON, ADDRESS_TYPE, FAULT_LOCATION_AREA, CREATE_DATE,CREATE_USER,MOD_DATE,MOD_USER,
+
+ HACTION,
+ HDATE,
+ HUSER
+ )
+ VALUES (
+
+ NEW.ID,NEW.UUID,NEW.VERSION_NUMBER,NEW.FK_REF_FAILURE_CLASSIFICATION,NEW.TITLE,NEW.DESCRIPTION,NEW.RESPONSIBILITY,NEW.FK_REF_STATUS_INTERN, NEW.FK_REF_BRANCH,NEW.VOLTAGE_LEVEL,NEW.PRESSURE_LEVEL,NEW.FAILURE_BEGIN,NEW.FAILURE_END_PLANNED,NEW.FAILURE_END_RESUPPLIED,NEW.INTERNAL_REMARK,NEW.POSTCODE,NEW.CITY,NEW.DISTRICT,NEW.STREET,NEW.HOUSENUMBER,NEW.STATION_ID,NEW.STATION_DESCRIPTION,NEW.STATION_COORDS,NEW.FK_REF_RADIUS,NEW.LONGITUDE,NEW.LATITUDE,NEW.FK_TBL_FAILURE_INFORMATION_CONDENSED,NEW.CONDENSED,NEW.CONDENSED_COUNT,NEW.OBJECT_REFERENCE_EXTERNAL_SYSTEM,NEW.PUBLICATION_STATUS,NEW.PUBLICATION_FREETEXT,NEW.FK_REF_EXPECTED_REASON, NEW.ADDRESS_TYPE, NEW.FAULT_LOCATION_AREA, NEW.CREATE_DATE,NEW.CREATE_USER,NEW.MOD_DATE,NEW.MOD_USER,
+
+ 1,
+ current_timestamp,
+ NEW.CREATE_USER );
+
+ RETURN NEW;
+ END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE
+ COST 100;
+ALTER FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG()
+ OWNER TO gfi_service;
+
+
+DROP TRIGGER IF EXISTS TBL_FAILURE_INFORMATION_INSERT_TRG ON PUBLIC.TBL_FAILURE_INFORMATION;
+
+CREATE TRIGGER TBL_FAILURE_INFORMATION_INSERT_TRG
+ BEFORE INSERT
+ ON PUBLIC.TBL_FAILURE_INFORMATION
+ FOR EACH ROW
+ EXECUTE PROCEDURE PUBLIC.TBL_FAILURE_INFORMATION_INSERT_TRG();
+
+
+
+-- PUBLIC.TBL_FAILURE_INFORMATION UPDATE TRIGGER --
+-- <GENERATED CODE!>
+
+CREATE OR REPLACE FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_UPDATE_TRG()
+ RETURNS trigger AS
+$BODY$
+ BEGIN
+ INSERT INTO HTBL_FAILURE_INFORMATION (
+ ID,UUID,VERSION_NUMBER,FK_REF_FAILURE_CLASSIFICATION,TITLE,DESCRIPTION,RESPONSIBILITY,FK_REF_STATUS_INTERN,FK_REF_BRANCH,VOLTAGE_LEVEL,PRESSURE_LEVEL,FAILURE_BEGIN,FAILURE_END_PLANNED,FAILURE_END_RESUPPLIED,INTERNAL_REMARK,POSTCODE,CITY,DISTRICT,STREET,HOUSENUMBER,STATION_ID,STATION_DESCRIPTION,STATION_COORDS,FK_REF_RADIUS,LONGITUDE,LATITUDE,FK_TBL_FAILURE_INFORMATION_CONDENSED,CONDENSED,CONDENSED_COUNT,OBJECT_REFERENCE_EXTERNAL_SYSTEM,PUBLICATION_STATUS,PUBLICATION_FREETEXT,FK_REF_EXPECTED_REASON,ADDRESS_TYPE,FAULT_LOCATION_AREA,CREATE_DATE,CREATE_USER,MOD_DATE,MOD_USER,
+
+ HACTION,
+ HDATE,
+ HUSER
+ )
+ VALUES (
+ NEW.ID,NEW.UUID,NEW.VERSION_NUMBER,NEW.FK_REF_FAILURE_CLASSIFICATION,NEW.TITLE,NEW.DESCRIPTION,NEW.RESPONSIBILITY,NEW.FK_REF_STATUS_INTERN,NEW.FK_REF_BRANCH,NEW.VOLTAGE_LEVEL,NEW.PRESSURE_LEVEL,NEW.FAILURE_BEGIN,NEW.FAILURE_END_PLANNED,NEW.FAILURE_END_RESUPPLIED,NEW.INTERNAL_REMARK,NEW.POSTCODE,NEW.CITY,NEW.DISTRICT,NEW.STREET,NEW.HOUSENUMBER,NEW.STATION_ID,NEW.STATION_DESCRIPTION,NEW.STATION_COORDS,NEW.FK_REF_RADIUS,NEW.LONGITUDE,NEW.LATITUDE,NEW.FK_TBL_FAILURE_INFORMATION_CONDENSED,NEW.CONDENSED,NEW.CONDENSED_COUNT,NEW.OBJECT_REFERENCE_EXTERNAL_SYSTEM,NEW.PUBLICATION_STATUS,NEW.PUBLICATION_FREETEXT,NEW.FK_REF_EXPECTED_REASON,NEW.ADDRESS_TYPE,NEW.FAULT_LOCATION_AREA, NEW.CREATE_DATE,NEW.CREATE_USER,NEW.MOD_DATE,NEW.MOD_USER,
+ 2,
+ current_timestamp,
+ NEW.MOD_USER
+ );
+
+ RETURN NEW;
+ END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE
+ COST 100;
+ALTER FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_UPDATE_TRG()
+ OWNER TO gfi_service;
+
+DROP TRIGGER IF EXISTS TBL_FAILURE_INFORMATION_UPDATE_TRG ON PUBLIC.TBL_FAILURE_INFORMATION;
+
+CREATE TRIGGER TBL_FAILURE_INFORMATION_UPDATE_TRG
+ BEFORE UPDATE
+ ON PUBLIC.TBL_FAILURE_INFORMATION
+ FOR EACH ROW
+ EXECUTE PROCEDURE PUBLIC.TBL_FAILURE_INFORMATION_UPDATE_TRG();
+
+
+
+-- PUBLIC.TBL_FAILURE_INFORMATION DELETE TRIGGER --
+-- <GENERATED CODE!>
+
+CREATE OR REPLACE FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_DELETE_TRG()
+ RETURNS trigger AS
+$BODY$
+ BEGIN
+ IF TG_OP = 'DELETE' THEN
+ INSERT INTO HTBL_FAILURE_INFORMATION (
+
+ ID,UUID,VERSION_NUMBER,FK_REF_FAILURE_CLASSIFICATION,TITLE,DESCRIPTION,RESPONSIBILITY,FK_REF_STATUS_INTERN,FK_REF_BRANCH,VOLTAGE_LEVEL,PRESSURE_LEVEL,FAILURE_BEGIN,FAILURE_END_PLANNED,FAILURE_END_RESUPPLIED,INTERNAL_REMARK,POSTCODE,CITY,DISTRICT,STREET,HOUSENUMBER,STATION_ID,STATION_DESCRIPTION,STATION_COORDS,FK_REF_RADIUS,LONGITUDE,LATITUDE,FK_TBL_FAILURE_INFORMATION_CONDENSED,CONDENSED,CONDENSED_COUNT,OBJECT_REFERENCE_EXTERNAL_SYSTEM,PUBLICATION_STATUS,PUBLICATION_FREETEXT,FK_REF_EXPECTED_REASON,ADDRESS_TYPE,FAULT_LOCATION_AREA,CREATE_DATE,CREATE_USER,MOD_DATE,MOD_USER,
+
+ HACTION,
+ HDATE,
+ HUSER
+ )
+ VALUES (
+ OLD.ID,OLD.UUID,OLD.VERSION_NUMBER,OLD.FK_REF_FAILURE_CLASSIFICATION,OLD.TITLE,OLD.DESCRIPTION,OLD.RESPONSIBILITY,OLD.FK_REF_STATUS_INTERN,OLD.FK_REF_BRANCH,OLD.VOLTAGE_LEVEL,OLD.PRESSURE_LEVEL,OLD.FAILURE_BEGIN,OLD.FAILURE_END_PLANNED,OLD.FAILURE_END_RESUPPLIED,OLD.INTERNAL_REMARK,OLD.POSTCODE,OLD.CITY,OLD.DISTRICT,OLD.STREET,OLD.HOUSENUMBER,OLD.STATION_ID,OLD.STATION_DESCRIPTION,OLD.STATION_COORDS,OLD.FK_REF_RADIUS,OLD.LONGITUDE,OLD.LATITUDE,OLD.FK_TBL_FAILURE_INFORMATION_CONDENSED,OLD.CONDENSED,OLD.CONDENSED_COUNT,OLD.OBJECT_REFERENCE_EXTERNAL_SYSTEM,OLD.PUBLICATION_STATUS,OLD.PUBLICATION_FREETEXT,OLD.FK_REF_EXPECTED_REASON,OLD.ADDRESS_TYPE,OLD.FAULT_LOCATION_AREA, OLD.CREATE_DATE,OLD.CREATE_USER,OLD.MOD_DATE,OLD.MOD_USER,
+
+ 3,
+ current_timestamp,
+ OLD.MOD_USER );
+ END IF;
+
+ RETURN OLD;
+ END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE
+ COST 100;
+ALTER FUNCTION PUBLIC.TBL_FAILURE_INFORMATION_DELETE_TRG()
+ OWNER TO gfi_service;
+
+DROP TRIGGER IF EXISTS TBL_FAILURE_INFORMATION_DELETE_TRG ON PUBLIC.TBL_FAILURE_INFORMATION;
+
+CREATE TRIGGER TBL_FAILURE_INFORMATION_DELETE_TRG
+ BEFORE DELETE
+ ON PUBLIC.TBL_FAILURE_INFORMATION
+ FOR EACH ROW
+ EXECUTE PROCEDURE PUBLIC.TBL_FAILURE_INFORMATION_DELETE_TRG();
+
+
+
+update tbl_failure_information set version_number = version_number+1, fault_location_area = 'address';
+update tbl_failure_information set version_number = version_number+1, fault_location_area = 'map' where address_type = 'freetext';
+update tbl_failure_information set version_number = version_number+1, fault_location_area = 'station' where station_id IS NOT NULL;
+update tbl_failure_information set version_number = version_number+1, fault_location_area = 'station' where id in (SELECT DISTINCT fk_tbl_failure_information FROM tbl_failure_information_station);
+
+
+
+
+
diff --git a/gfsBackendService/src/main/resources/logback-spring.xml b/gfsBackendService/src/main/resources/logback-spring.xml
index 47f0fb9..dbe018b 100644
--- a/gfsBackendService/src/main/resources/logback-spring.xml
+++ b/gfsBackendService/src/main/resources/logback-spring.xml
@@ -1,4 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<configuration>
<property name="LOGS" value="./logs"/>
@@ -32,7 +46,7 @@
</root>
<!-- LOG "com.baeldungorg.eclipse.openk.contactbasedata*" at INFO level -->
- <logger name="org.eclipse.openk.gridfailureinformation" level="info" additivity="false">
+ <logger name="org.eclipse.openk.gridfailureinformation" additivity="false">
<appender-ref ref="RollingFile"/>
<appender-ref ref="Console"/>
</logger>
diff --git a/gfsBackendService/src/main/resources/messages.properties b/gfsBackendService/src/main/resources/messages.properties
index 2c82171..4e6ca77 100644
--- a/gfsBackendService/src/main/resources/messages.properties
+++ b/gfsBackendService/src/main/resources/messages.properties
@@ -1,3 +1,16 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+
#Fehlermeldungen
invalid.uuid.path.object=Die UUID entspricht nicht der UUID des \u00fcbergebenen Datensatzes.
branch.uuid.not.existing=Die \u00fcbergebene UUID einer Branche existiert nicht.
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/api/CustomPageImplTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/api/CustomPageImplTest.java
index a6320b6..2a58dac 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/api/CustomPageImplTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/api/CustomPageImplTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.api;
import org.eclipse.openk.gridfailureinformation.api.impl.CustomPageImpl;
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoCanceledTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoCanceledTest.java
index 1b6102b..140268b 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoCanceledTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoCanceledTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import org.eclipse.openk.gridfailureinformation.bpmn.impl.tasks.ProcessHelper;
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoHasSubordinatedInfosTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoHasSubordinatedInfosTest.java
index dd095a2..c293a55 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoHasSubordinatedInfosTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoHasSubordinatedInfosTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import org.eclipse.openk.gridfailureinformation.bpmn.base.ProcessException;
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPlannedTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPlannedTest.java
index 534c826..b23d384 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPlannedTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPlannedTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import org.eclipse.openk.gridfailureinformation.bpmn.base.ProcessException;
@@ -30,7 +44,10 @@
import static org.eclipse.openk.gridfailureinformation.bpmn.base.tasks.DecisionTask.OutputPort.YES;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.anyString;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
@DataJpaTest
@ContextConfiguration(classes = {TestConfiguration.class})
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPublishedTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPublishedTest.java
index 3fe3eb5..97996a1 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPublishedTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoPublishedTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import org.eclipse.openk.gridfailureinformation.bpmn.base.ProcessException;
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoUpdatedTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoUpdatedTest.java
index 38b8945..3bdd7f7 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoUpdatedTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/DecideFailureInfoUpdatedTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import org.eclipse.openk.gridfailureinformation.bpmn.impl.tasks.ProcessHelper;
@@ -26,7 +40,9 @@
import java.util.UUID;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.mockito.ArgumentMatchers.*;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.when;
@DataJpaTest
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusOfParentToChildrenTaskTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusOfParentToChildrenTaskTest.java
index 54d42fb..dfbd202 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusOfParentToChildrenTaskTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusOfParentToChildrenTaskTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import org.eclipse.openk.gridfailureinformation.bpmn.base.ProcessException;
@@ -12,7 +26,11 @@
import java.util.UUID;
import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
class StoreEditStatusOfParentToChildrenTaskTest {
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusTaskTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusTaskTest.java
index 9500ef4..10967ec 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusTaskTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/bpmn/impl/StoreEditStatusTaskTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.bpmn.impl;
import org.eclipse.openk.gridfailureinformation.bpmn.base.ProcessException;
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/CorsConfigTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/CorsConfigTest.java
index 57a4aeb..394cfd5 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/CorsConfigTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/CorsConfigTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.config;
import org.eclipse.openk.gridfailureinformation.GridFailureInformationApplication;
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java
index 29078bc..d51a329 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureInformationServiceTest.java
@@ -759,8 +759,8 @@
assertNull(savedCondensedFailureInfoDto.getFreetextCity());
assertNull(savedCondensedFailureInfoDto.getFreetextDistrict());
assertNull(savedCondensedFailureInfoDto.getFreetextPostcode());
- assertNull(savedCondensedFailureInfoDto.getLatitude());
- assertNull(savedCondensedFailureInfoDto.getLongitude());
+ assertNotNull(savedCondensedFailureInfoDto.getLatitude());
+ assertNotNull(savedCondensedFailureInfoDto.getLongitude());
assertEquals(tblFailureInformation1.getRefExpectedReason().getUuid(), savedCondensedFailureInfoDto.getExpectedReasonId());
assertEquals(tblFailureInformation1.getFailureEndPlanned(), savedCondensedFailureInfoDto.getFailureEndPlanned());
assertEquals(tblFailureInformation1.getFailureBegin(), savedCondensedFailureInfoDto.getFailureBegin());
@@ -822,7 +822,6 @@
assertNull(savedCondensedFailureInfoDto.getDistrict());
assertNull(savedCondensedFailureInfoDto.getCity());
assertNull(savedCondensedFailureInfoDto.getPostcode());
- assertNull(savedCondensedFailureInfoDto.getCity());
assertNull(savedCondensedFailureInfoDto.getFreetextCity());
assertNull(savedCondensedFailureInfoDto.getFreetextDistrict());
assertNull(savedCondensedFailureInfoDto.getFreetextPostcode());
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ImportServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ImportServiceTest.java
index a4bf125..aab6a28 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ImportServiceTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/ImportServiceTest.java
@@ -246,7 +246,7 @@
BranchDto branchStromDto = MockDataHelper.mockBranchDto();
branchStromDto.setName("S");
when( branchService.findByName(eq("S"))).thenReturn(branchStromDto);
- when( statusService.getStatusFromId( anyLong()) ).thenReturn(MockDataHelper.mockStatusDto());
+ when( statusService.getStatusFromId( anyLong()) ).thenReturn(MockDataHelper.mockStatusDto("neu", UUID.randomUUID()));
when( radiusService.getRadii() ).thenReturn(getRadiusDtoList());
FailureInformationDto dtoFromDB = MockDataHelper.mockFailureInformationDto();
@@ -321,10 +321,15 @@
BranchDto branchStromDto = MockDataHelper.mockBranchDto();
branchStromDto.setName("S");
when( branchService.findByName(eq("S"))).thenReturn(branchStromDto);
- StatusDto qualifiedStatusDto = MockDataHelper.mockStatusDto();
- qualifiedStatusDto.setStatus("qualified");
+ StatusDto qualifiedStatusDto = MockDataHelper.mockStatusDto("qualified", UUID.randomUUID());
+ StatusDto canceledStatusDto = MockDataHelper.mockStatusDto("canceled", UUID.randomUUID());
+ StatusDto completedStatusDto = MockDataHelper.mockStatusDto("completed", UUID.randomUUID());
+ StatusDto udpatedStatusDto = MockDataHelper.mockStatusDto("updated", UUID.randomUUID());
- when( statusService.getStatusFromId( anyLong()) ).thenReturn(qualifiedStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.QUALIFIED.getStatusValue()) ).thenReturn(qualifiedStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.COMPLETED.getStatusValue()) ).thenReturn(completedStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.CANCELED.getStatusValue()) ).thenReturn(canceledStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.UPDATED.getStatusValue()) ).thenReturn(udpatedStatusDto);
when( radiusService.getRadii() ).thenReturn(getRadiusDtoList());
FailureInformationDto existingDto = MockDataHelper.mockFailureInformationDto();
@@ -337,4 +342,96 @@
.updateFailureInfo(any( FailureInformationDto.class));
}
+ @Test
+ public void shouldNotImportUpdateMessageOnComplete() {
+ ImportDataDto dto = MockDataHelper.mockImportDataDto();
+ dto.setMessageContent("{\n" +
+ " \"branch\": \"S\",\n" + // invalid branch
+ " \"city\": \"Belfast\",\n" +
+ " \"description\": \"Schlimmer Fehler im System\",\n" +
+ " \"district\": \"\",\n" +
+ " \"failureBegin\": \"2020-11-19T14:13:15.666Z\",\n" +
+ " \"housenumber\": \"10b\",\n" +
+ " \"latitude\": 12.345,\n" +
+ " \"longitude\": 0,\n" +
+ " \"planned\": false,\n" +
+ " \"postcode\": \"3456\",\n" +
+ " \"pressureLevel\": null,\n" +
+ " \"radiusInMeters\": 678,\n" +
+ " \"stationDescription\": null,\n" +
+ " \"stationId\": null,\n" +
+ " \"street\": \"Oxfordstreet\",\n" +
+ " \"voltageLevel\": \"HS\"\n" +
+ " }");
+
+ BranchDto branchStromDto = MockDataHelper.mockBranchDto();
+ branchStromDto.setName("S");
+ when( branchService.findByName(eq("S"))).thenReturn(branchStromDto);
+ StatusDto qualifiedStatusDto = MockDataHelper.mockStatusDto("qualified", UUID.randomUUID());
+ StatusDto canceledStatusDto = MockDataHelper.mockStatusDto("canceled", UUID.randomUUID());
+ StatusDto completedStatusDto = MockDataHelper.mockStatusDto("completed", UUID.randomUUID());
+ StatusDto udpatedStatusDto = MockDataHelper.mockStatusDto("updated", UUID.randomUUID());
+
+ when( statusService.getStatusFromId( GfiProcessState.QUALIFIED.getStatusValue()) ).thenReturn(qualifiedStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.COMPLETED.getStatusValue()) ).thenReturn(completedStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.CANCELED.getStatusValue()) ).thenReturn(canceledStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.UPDATED.getStatusValue()) ).thenReturn(udpatedStatusDto);
+ when( radiusService.getRadii() ).thenReturn(getRadiusDtoList());
+
+ FailureInformationDto existingDto = MockDataHelper.mockFailureInformationDto();
+ existingDto.setStatusInternId(completedStatusDto.getUuid());
+ when( failureInformationService.findByObjectReferenceExternalSystem(anyString())).thenReturn(existingDto);
+
+ importService.validateAndImport(dto);
+
+ verify(failureInformationService, times(0))
+ .updateFailureInfo(any( FailureInformationDto.class));
+ }
+
+ @Test
+ public void shouldNotImportUpdateMessageOnCanceled() {
+ ImportDataDto dto = MockDataHelper.mockImportDataDto();
+ dto.setMessageContent("{\n" +
+ " \"branch\": \"S\",\n" + // invalid branch
+ " \"city\": \"Belfast\",\n" +
+ " \"description\": \"Schlimmer Fehler im System\",\n" +
+ " \"district\": \"\",\n" +
+ " \"failureBegin\": \"2020-11-19T14:13:15.666Z\",\n" +
+ " \"housenumber\": \"10b\",\n" +
+ " \"latitude\": 12.345,\n" +
+ " \"longitude\": 0,\n" +
+ " \"planned\": false,\n" +
+ " \"postcode\": \"3456\",\n" +
+ " \"pressureLevel\": null,\n" +
+ " \"radiusInMeters\": 678,\n" +
+ " \"stationDescription\": null,\n" +
+ " \"stationId\": null,\n" +
+ " \"street\": \"Oxfordstreet\",\n" +
+ " \"voltageLevel\": \"HS\"\n" +
+ " }");
+
+ BranchDto branchStromDto = MockDataHelper.mockBranchDto();
+ branchStromDto.setName("S");
+ when( branchService.findByName(eq("S"))).thenReturn(branchStromDto);
+ StatusDto qualifiedStatusDto = MockDataHelper.mockStatusDto("qualified", UUID.randomUUID());
+ StatusDto canceledStatusDto = MockDataHelper.mockStatusDto("canceled", UUID.randomUUID());
+ StatusDto completedStatusDto = MockDataHelper.mockStatusDto("completed", UUID.randomUUID());
+ StatusDto udpatedStatusDto = MockDataHelper.mockStatusDto("updated", UUID.randomUUID());
+
+ when( statusService.getStatusFromId( GfiProcessState.QUALIFIED.getStatusValue()) ).thenReturn(qualifiedStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.COMPLETED.getStatusValue()) ).thenReturn(completedStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.CANCELED.getStatusValue()) ).thenReturn(canceledStatusDto);
+ when( statusService.getStatusFromId( GfiProcessState.UPDATED.getStatusValue()) ).thenReturn(udpatedStatusDto);
+ when( radiusService.getRadii() ).thenReturn(getRadiusDtoList());
+
+ FailureInformationDto existingDto = MockDataHelper.mockFailureInformationDto();
+ existingDto.setStatusInternId(canceledStatusDto.getUuid());
+ when( failureInformationService.findByObjectReferenceExternalSystem(anyString())).thenReturn(existingDto);
+
+ importService.validateAndImport(dto);
+
+ verify(failureInformationService, times(0))
+ .updateFailureInfo(any( FailureInformationDto.class));
+ }
+
}
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/SettingsServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/SettingsServiceTest.java
index be872bc..ef385c3 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/SettingsServiceTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/SettingsServiceTest.java
@@ -50,6 +50,8 @@
assertFalse(feSettingsDto.getExportChannels() == null);
assertFalse(feSettingsDto.getOverviewMapInitialLatitude() == null);
assertFalse(feSettingsDto.getOverviewMapInitialLongitude() == null);
+ assertFalse(feSettingsDto.getDataExternInitialVisibility() == null);
+
}
@Test
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java
index a857ff3..27c274f 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/support/MockDataHelper.java
@@ -507,10 +507,10 @@
return refFailureClassificationList;
}
- public static StatusDto mockStatusDto() {
+ public static StatusDto mockStatusDto(String status, UUID uuid) {
StatusDto statusDto = new StatusDto();
- statusDto.setUuid(UUID.fromString("51d4327c-594b-11ea-82b4-0242ac130003"));
- statusDto.setStatus("neu");
+ statusDto.setUuid(uuid);
+ statusDto.setStatus(status);
return statusDto;
}
@@ -518,7 +518,7 @@
public static List<StatusDto> mockStatusDtoList() {
List<StatusDto> statusDtoList = new ArrayList<>();
- StatusDto statusDto1 = mockStatusDto();
+ StatusDto statusDto1 = mockStatusDto("neu" , UUID.randomUUID());
StatusDto statusDto2 = new StatusDto();
statusDto2.setUuid(UUID.fromString("51d3c6d4-594b-11ea-8e2d-0242ac130003"));
statusDto2.setStatus("aktiv");
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilterTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilterTest.java
index d44cb03..b00260c 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilterTest.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/util/GroupMemberPlzFilterTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.util;
import org.assertj.core.util.Lists;
diff --git a/mailExport/Dockerfile_DevServer b/mailExport/Dockerfile_DevServer
index 9a3ce2b..1caa91b 100644
--- a/mailExport/Dockerfile_DevServer
+++ b/mailExport/Dockerfile_DevServer
@@ -1,8 +1,19 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/mailExport/Dockerfile_DevServerUnsecure b/mailExport/Dockerfile_DevServerUnsecure
index c370e16..f1fe38f 100644
--- a/mailExport/Dockerfile_DevServerUnsecure
+++ b/mailExport/Dockerfile_DevServerUnsecure
@@ -1,8 +1,19 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/mailExport/pom.xml b/mailExport/pom.xml
index 636b87d..332fa6b 100644
--- a/mailExport/pom.xml
+++ b/mailExport/pom.xml
@@ -1,11 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.2.4.RELEASE</version>
+ <version>2.2.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.eclipse.openk</groupId>
@@ -50,6 +64,10 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-security</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
@@ -95,6 +113,11 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
<version>${powerMockReflect.version}</version>
diff --git a/mailExport/sonar-project.properties b/mailExport/sonar-project.properties
index 4ddd028..e63c677 100644
--- a/mailExport/sonar-project.properties
+++ b/mailExport/sonar-project.properties
@@ -1,3 +1,16 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+#
# must be unique in a given SonarQube instance
sonar.projectKey=openk.pta.de:mailexport
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplication.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplication.java
index 78e1156..2f3047e 100644
--- a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplication.java
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplication.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mailexport;
import org.springframework.boot.SpringApplication;
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/EmailConfig.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/EmailConfig.java
index 9903a2e..752926f 100644
--- a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/EmailConfig.java
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/EmailConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mailexport.config;
import lombok.Data;
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/RabbitMqConfig.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/RabbitMqConfig.java
index a607eff..ac2aaf3 100644
--- a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/RabbitMqConfig.java
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/RabbitMqConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mailexport.config;
import lombok.extern.log4j.Log4j2;
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/SecurityConfig.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/SecurityConfig.java
new file mode 100644
index 0000000..30e63b4
--- /dev/null
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/SecurityConfig.java
@@ -0,0 +1,68 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
+package org.eclipse.openk.gridfailureinformation.mailexport.config;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.crypto.factory.PasswordEncoderFactories;
+import org.springframework.security.crypto.password.PasswordEncoder;
+
+
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(
+ prePostEnabled = true,
+ securedEnabled = true,
+ jsr250Enabled = true)
+public class SecurityConfig extends WebSecurityConfigurerAdapter {
+
+ @Value("${security.endpoint.user}")
+ private String user;
+ @Value("${security.endpoint.password}")
+ private String password;
+
+ @Override
+ protected void configure(HttpSecurity http ) throws Exception {
+ http
+ .csrf().disable()
+ .authorizeRequests().anyRequest().authenticated()
+ .and()
+ .httpBasic();
+ }
+
+ @Bean
+ public PasswordEncoder passwordEncoder() {
+ return PasswordEncoderFactories.createDelegatingPasswordEncoder();
+ }
+
+ @Autowired
+ public void configureGlobal(AuthenticationManagerBuilder auth)
+ throws Exception
+ {
+ auth.inMemoryAuthentication()
+ .withUser(user)
+ .password(passwordEncoder().encode(password))
+ .roles("USER");
+ }
+
+
+}
+
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/SwaggerConfig.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/SwaggerConfig.java
index 959c830..affb4c1 100644
--- a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/SwaggerConfig.java
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/config/SwaggerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mailexport.config;
import lombok.extern.log4j.Log4j2;
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumer.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumer.java
index d95c551..c16c273 100644
--- a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumer.java
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumer.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mailexport.controller;
import com.fasterxml.jackson.core.JsonProcessingException;
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/Email.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/Email.java
index b585fda..b168cdd 100644
--- a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/Email.java
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/Email.java
@@ -12,8 +12,6 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
-
-
package org.eclipse.openk.gridfailureinformation.mailexport.email;
import lombok.extern.log4j.Log4j2;
diff --git a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/GfiEmail.java b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/GfiEmail.java
index 868dc7b..4424432 100644
--- a/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/GfiEmail.java
+++ b/mailExport/src/main/java/org/eclipse/openk/gridfailureinformation/mailexport/email/GfiEmail.java
@@ -12,8 +12,6 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
-
-
package org.eclipse.openk.gridfailureinformation.mailexport.email;
import lombok.extern.log4j.Log4j2;
diff --git a/mailExport/src/main/resources/application.yml b/mailExport/src/main/resources/application.yml
index 6f12a30..a54a58a 100644
--- a/mailExport/src/main/resources/application.yml
+++ b/mailExport/src/main/resources/application.yml
@@ -23,76 +23,40 @@
server:
max-http-header-size: 262144
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: x
-
-gridFailureInformation:
- maxListSize: 2000
-
-
-feign:
- client:
- config:
- default:
- connectTimeout: 60000
- readTimeout: 60000
-cors:
- corsEnabled: false
-
email:
sender: sender@test.tester
smtpHost: entdockergss
port: 1025
-
-swagger:
- baseUrl:
- proxyUrl:
+
+security.endpoint:
+ user: ${GFI_MANUAL_ENDPOINTS_USERNAME}
+ password: ${GFI_MANUAL_ENDPOINTS_PASSWORD}
---
spring:
profiles: test
-jwt:
- tokenHeader: Authorization
- useStaticJwt: true
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
+security.endpoint:
+ user: mockuser
+ password: mockuser
+
---
spring:
profiles: devserver
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
server:
port: 9205
-cors:
- corsEnabled: true
-
-
---
spring:
profiles: devserver-unsecure
-jwt:
- tokenHeader: Authorization
- useStaticJwt: true
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
server:
port: 9206
-cors:
- corsEnabled: true
-
---
spring:
@@ -113,27 +77,10 @@
session:
tracking-modes: cookie
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
-services:
- authNAuth:
- name: authNAuthService
-
-authNAuthService:
- ribbon:
- listOfServers: http://localhost:8080
-
-cors:
- corsEnabled: true
-
email:
sender: sender@test.tester
smtpHost: localhost
port: 1025
swagger:
- baseUrl: /testmail
- proxyUrl:
\ No newline at end of file
+ baseUrl: /testmail
\ No newline at end of file
diff --git a/mailExport/src/main/resources/application_localdev.yml b/mailExport/src/main/resources/application_localdev.yml
index 0f45ee4..c635529 100644
--- a/mailExport/src/main/resources/application_localdev.yml
+++ b/mailExport/src/main/resources/application_localdev.yml
@@ -20,13 +20,6 @@
mail_export_queue: sit_mail_export_queue_localdev
mail_export_routingkey: sit_mail_export_key_localdev
-eureka:
- client:
- service-url:
- defaulZone: http://localhost:8761/
- instance:
- prefer-ip-address: true
-
index-channel:
enabled: true
@@ -40,28 +33,16 @@
gridFailureInformation:
maxListSize: 2000
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
-feign:
- client:
- config:
- default:
- connectTimeout: 5000
- readTimeout: 5000
- loggerLevel: FULL
-
logging.level.org.eclipse.openk.gridfailureinformation.jobs.stoerauskunftinterface.api.StoerauskunftApi: DEBUG
-cors:
- corsEnabled: true
-
email:
sender: sender@olaf.senderson
smtpHost: entdockergss
port: 1025
+
+security.endpoint:
+ user: ${GFI_MANUAL_ENDPOINTS_USERNAME}
+ password: ${GFI_MANUAL_ENDPOINTS_PASSWORD}
---
diff --git a/mailExport/src/main/resources/logback-spring.xml b/mailExport/src/main/resources/logback-spring.xml
index 9e35184..77f2805 100644
--- a/mailExport/src/main/resources/logback-spring.xml
+++ b/mailExport/src/main/resources/logback-spring.xml
@@ -31,7 +31,7 @@
</root>
<!-- LOG "com.baeldungorg.eclipse.openk.contactbasedata*" at INFO level -->
- <logger name="org.eclipse.openk.gridfailureinformation.jobs.stoerauskunftinterface" level="info" additivity="false">
+ <logger name="org.eclipse.openk.gridfailureinformation.mailexport" level="info" additivity="false">
<appender-ref ref="RollingFileStd"/>
<appender-ref ref="Console"/>
</logger>
diff --git a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplicationTest.java b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplicationTest.java
index b1bf15a..f34e1b3 100644
--- a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplicationTest.java
+++ b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/MailExportApplicationTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mailexport;
import org.junit.jupiter.api.Test;
diff --git a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/EmailControllerTest.java b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/EmailControllerTest.java
index e4a17d2..bdeb9e9 100644
--- a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/EmailControllerTest.java
+++ b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/EmailControllerTest.java
@@ -22,6 +22,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
+import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
@@ -44,6 +45,7 @@
private MockMvc mockMvc;
@Test
+ @WithMockUser(value = "mockedUser")
public void shouldReturnOkonSend() throws Exception {
mockMvc.perform(post("/mail")
.contentType(MediaType.APPLICATION_JSON)
@@ -52,6 +54,7 @@
}
@Test
+ @WithMockUser(value = "mockedUser")
public void shouldReturnStatus() throws Exception {
doThrow(new MessagingException()).when(emailService).sendTestMail(any());
mockMvc.perform(post("/mail")
@@ -60,4 +63,14 @@
).andExpect(status().is5xxServerError());
}
+ @Test
+ public void shouldReturnUnauthorized() throws Exception {
+ mockMvc.perform(post("/mail")
+ .contentType(MediaType.APPLICATION_JSON)
+ .content("test@test.de"))
+ .andExpect(status().isUnauthorized());
+ }
+
+
+
}
\ No newline at end of file
diff --git a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumerTest.java b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumerTest.java
index 4e2ee6f..1bae94f 100644
--- a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumerTest.java
+++ b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/controller/MessageConsumerTest.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.mailexport.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/service/EmailServiceTest.java b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/service/EmailServiceTest.java
index 94e56d0..87551f4 100644
--- a/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/service/EmailServiceTest.java
+++ b/mailExport/src/test/java/org/eclipse/openk/gridfailureinformation/mailexport/service/EmailServiceTest.java
@@ -12,7 +12,6 @@
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************
*/
-
package org.eclipse.openk.gridfailureinformation.mailexport.service;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/mailExport/src/test/resources/application.yml b/mailExport/src/test/resources/application.yml
index 5661ab6..0beb9f1 100644
--- a/mailExport/src/test/resources/application.yml
+++ b/mailExport/src/test/resources/application.yml
@@ -46,9 +46,9 @@
smtpHost: localhost
port: 3025
-swagger:
- baseUrl:
- proxyUrl:
+security.endpoint:
+ user: mockuser
+ password: mockuser
---
spring:
diff --git a/scripts/setUserPassAsEnvVariablesLinux.sh b/scripts/setUserPassAsEnvVariablesLinux.sh
index e91a6f6..dc88932 100644
--- a/scripts/setUserPassAsEnvVariablesLinux.sh
+++ b/scripts/setUserPassAsEnvVariablesLinux.sh
@@ -11,4 +11,8 @@
# STOERUNGSAUSKUNFT
export GFI_STOERUNGSAUSKUNFT_USERNAME=mock_user
-export GFI_STOERUNGSAUSKUNFT_PASSWORD=mock_password
\ No newline at end of file
+export GFI_STOERUNGSAUSKUNFT_PASSWORD=mock_password
+
+# AUTH&AUTH CLIENT
+export GFI_AUTHNAUTH_USERNAME=mock_user
+export GFI_AUTHNAUTH_PASSWORD=mock_password
\ No newline at end of file
diff --git a/scripts/setUserPassAsEnvVariablesWindows.bat b/scripts/setUserPassAsEnvVariablesWindows.bat
index 0726240..e6e7bde 100644
--- a/scripts/setUserPassAsEnvVariablesWindows.bat
+++ b/scripts/setUserPassAsEnvVariablesWindows.bat
@@ -10,4 +10,8 @@
REM STOERUNGSAUSKUNFT
setx GFI_STOERUNGSAUSKUNFT_USERNAME "mock_user" /M
-setx GFI_STOERUNGSAUSKUNFT_PASSWORD "mock_password" /M
\ No newline at end of file
+setx GFI_STOERUNGSAUSKUNFT_PASSWORD "mock_password" /M
+
+REM AUTH&AUTH CLIENT
+setx GFI_AUTHNAUTH_USERNAME "mock_user" /M
+setx GFI_AUTHNAUTH_PASSWORD "mock_password" /M
diff --git a/stoerungsauskunftInterface/Dockerfile_DevServer b/stoerungsauskunftInterface/Dockerfile_DevServer
index 66c3eaa..6da6a14 100644
--- a/stoerungsauskunftInterface/Dockerfile_DevServer
+++ b/stoerungsauskunftInterface/Dockerfile_DevServer
@@ -1,8 +1,19 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/stoerungsauskunftInterface/Dockerfile_DevServerUnsecure b/stoerungsauskunftInterface/Dockerfile_DevServerUnsecure
index dc10133..7df61ab 100644
--- a/stoerungsauskunftInterface/Dockerfile_DevServerUnsecure
+++ b/stoerungsauskunftInterface/Dockerfile_DevServerUnsecure
@@ -1,8 +1,19 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+
FROM openjdk:8-jre-alpine
ENV JAVA_TOOL_OPTIONS -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/stoerungsauskunftInterface/pom.xml b/stoerungsauskunftInterface/pom.xml
index a29835f..6ed459b 100644
--- a/stoerungsauskunftInterface/pom.xml
+++ b/stoerungsauskunftInterface/pom.xml
@@ -1,11 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.2.4.RELEASE</version>
+ <!--<version>2.2.4.RELEASE</version>-->
+ <version>2.2.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.eclipse.openk</groupId>
@@ -47,7 +62,7 @@
<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit-test</artifactId>
- <version>2.2.7.RELEASE</version>
+ <version>2.2.10.RELEASE</version>
<scope>test</scope>
</dependency>
@@ -57,12 +72,15 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-security</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
- <version>2.2.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
@@ -98,6 +116,11 @@
</exclusions>
</dependency>
<dependency>
+ <groupId>org.springframework.security</groupId>
+ <artifactId>spring-security-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
<version>${powerMockReflect.version}</version>
diff --git a/stoerungsauskunftInterface/sonar-project.properties b/stoerungsauskunftInterface/sonar-project.properties
index 542718f..7c3687b 100644
--- a/stoerungsauskunftInterface/sonar-project.properties
+++ b/stoerungsauskunftInterface/sonar-project.properties
@@ -1,3 +1,15 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
# must be unique in a given SonarQube instance
sonar.projectKey=openk.pta.de:stoerungsauskunftinterface
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/StoerungsauskunftInterfaceApplication.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/StoerungsauskunftInterfaceApplication.java
index 0a95ee3..f207e1d 100644
--- a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/StoerungsauskunftInterfaceApplication.java
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/StoerungsauskunftInterfaceApplication.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface;
import org.springframework.boot.SpringApplication;
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/api/StoerungsauskunftApi.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/api/StoerungsauskunftApi.java
index 9b7c384..8fc8b14 100644
--- a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/api/StoerungsauskunftApi.java
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/api/StoerungsauskunftApi.java
@@ -17,6 +17,7 @@
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.dtos.StoerungsauskunftOutage;
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.dtos.StoerungsauskunftUserNotification;
import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.context.annotation.Profile;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -24,7 +25,7 @@
import java.util.List;
-
+@Profile({"!test"})
@FeignClient(name="Stoerauskunft.de", url= "${stoerungsauskunft.apiUrl}")
public interface StoerungsauskunftApi {
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/FeignClientConfig.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/FeignClientConfig.java
index c14210f..a06a565 100644
--- a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/FeignClientConfig.java
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/FeignClientConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.config;
import feign.RequestInterceptor;
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfig.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfig.java
index e8c42c9..8532b07 100644
--- a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfig.java
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.config;
import lombok.extern.log4j.Log4j2;
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/SecurityConfig.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/SecurityConfig.java
new file mode 100644
index 0000000..8edc1ac
--- /dev/null
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/SecurityConfig.java
@@ -0,0 +1,69 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
+package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.config;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.factory.PasswordEncoderFactories;
+import org.springframework.security.crypto.password.PasswordEncoder;
+
+
+@Configuration
+@EnableWebSecurity
+@EnableGlobalMethodSecurity(
+ prePostEnabled = true,
+ securedEnabled = true,
+ jsr250Enabled = true)
+public class SecurityConfig extends WebSecurityConfigurerAdapter {
+
+ @Value("${security.endpoint.user}")
+ private String user;
+ @Value("${security.endpoint.password}")
+ private String password;
+
+ @Override
+ protected void configure(HttpSecurity http ) throws Exception {
+ http
+ .csrf().disable()
+ .authorizeRequests().anyRequest().authenticated()
+ .and()
+ .httpBasic();
+ }
+
+ @Bean
+ public PasswordEncoder passwordEncoder() {
+ return PasswordEncoderFactories.createDelegatingPasswordEncoder();
+ }
+
+ @Autowired
+ public void configureGlobal(AuthenticationManagerBuilder auth)
+ throws Exception
+ {
+ auth.inMemoryAuthentication()
+ .withUser(user)
+ .password(passwordEncoder().encode(password))
+ .roles("USER");
+ }
+
+
+}
+
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/SwaggerConfig.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/SwaggerConfig.java
index 7792780..43d1e6f 100644
--- a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/SwaggerConfig.java
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/SwaggerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.config;
import lombok.extern.log4j.Log4j2;
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftOutage.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftOutage.java
index 2be5bde..f2c521a 100644
--- a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftOutage.java
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftOutage.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.dtos;
import lombok.Data;
diff --git a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftUserNotification.java b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftUserNotification.java
index c9cf7fb..11294c5 100644
--- a/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftUserNotification.java
+++ b/stoerungsauskunftInterface/src/main/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/dtos/StoerungsauskunftUserNotification.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.dtos;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
diff --git a/stoerungsauskunftInterface/src/main/resources/application.yml b/stoerungsauskunftInterface/src/main/resources/application.yml
index 3c09778..3bdd438 100644
--- a/stoerungsauskunftInterface/src/main/resources/application.yml
+++ b/stoerungsauskunftInterface/src/main/resources/application.yml
@@ -42,14 +42,6 @@
server:
max-http-header-size: 262144
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: x
-
-gridFailureInformation:
- maxListSize: 2000
-
feign:
client:
@@ -57,8 +49,6 @@
default:
connectTimeout: 60000
readTimeout: 60000
-cors:
- corsEnabled: false
stoerungsauskunft:
apiUrl: https://stage-api-operator.stoerungsauskunft.de/api/v1.0/
@@ -68,16 +58,14 @@
enabled: false
cron: 0 */15 * ? * *
+security.endpoint:
+ user: ${GFI_MANUAL_ENDPOINTS_USERNAME}
+ password: ${GFI_MANUAL_ENDPOINTS_PASSWORD}
---
spring:
profiles: test
-jwt:
- tokenHeader: Authorization
- useStaticJwt: true
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
stoerungsauskunft:
apiUrl: https://stage-api-operator.stoerungsauskunft.de/api/v1.0/
user: userName
@@ -96,17 +84,9 @@
org.eclipse.openk: DEBUG
org.springframework.web: ERROR
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
server:
port: 9195
-cors:
- corsEnabled: true
-
---
spring:
@@ -118,17 +98,9 @@
org.eclipse.openk: DEBUG
org.springframework.web: ERROR
-jwt:
- tokenHeader: Authorization
- useStaticJwt: true
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
server:
port: 9196
-cors:
- corsEnabled: true
-
---
spring:
@@ -183,13 +155,5 @@
session:
tracking-modes: cookie
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
-cors:
- corsEnabled: true
-
swagger:
baseUrl: /test-stoerungsauskunft-interface
\ No newline at end of file
diff --git a/stoerungsauskunftInterface/src/main/resources/application_localdev.yml b/stoerungsauskunftInterface/src/main/resources/application_localdev.yml
index 1c04bd5..2cac6a3 100644
--- a/stoerungsauskunftInterface/src/main/resources/application_localdev.yml
+++ b/stoerungsauskunftInterface/src/main/resources/application_localdev.yml
@@ -52,14 +52,6 @@
session:
tracking-modes: cookie
-gridFailureInformation:
- maxListSize: 2000
-
-jwt:
- tokenHeader: Authorization
- useStaticJwt: false
- staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
-
feign:
client:
config:
@@ -81,6 +73,10 @@
enabled: false
cron: 0 */15 * ? * *
+security.endpoint:
+ user: ${GFI_MANUAL_ENDPOINTS_USERNAME}
+ password: ${GFI_MANUAL_ENDPOINTS_PASSWORD}
+
---
spring:
diff --git a/stoerungsauskunftInterface/src/main/resources/logback-spring.xml b/stoerungsauskunftInterface/src/main/resources/logback-spring.xml
index 12c5a70..0063624 100644
--- a/stoerungsauskunftInterface/src/main/resources/logback-spring.xml
+++ b/stoerungsauskunftInterface/src/main/resources/logback-spring.xml
@@ -44,7 +44,7 @@
</root>
<!-- LOG "com.baeldungorg.eclipse.openk.contactbasedata*" at INFO level -->
- <logger name="org.eclipse.openk.gridfailureinformation.jobs.stoerauskunftinterface" level="info" additivity="false">
+ <logger name="org.eclipse.openk.gridfailureinformation.jobs.stoerauskunftinterface" additivity="false">
<appender-ref ref="RollingFileStd"/>
<appender-ref ref="Console"/>
</logger>
diff --git a/stoerungsauskunftInterface/src/main/resources/messages.properties b/stoerungsauskunftInterface/src/main/resources/messages.properties
index b8b3b11..7109bdb 100644
--- a/stoerungsauskunftInterface/src/main/resources/messages.properties
+++ b/stoerungsauskunftInterface/src/main/resources/messages.properties
@@ -1,4 +1,16 @@
-#Fehlermeldungen
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+# Fehlermeldungen
could.not.push.message=Das Objekt konnte nicht an RabbitMQ gesendet werden.
diff --git a/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfigTest.java b/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfigTest.java
index 259d866..9728de4 100644
--- a/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfigTest.java
+++ b/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/config/ImportSchedulerConfigTest.java
@@ -1,17 +1,43 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.config;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.StoerungsauskunftInterfaceApplication;
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.api.StoerungsauskunftApi;
+import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.dtos.StoerungsauskunftUserNotification;
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.service.ImportExportService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.mock.mockito.SpyBean;
+import org.springframework.core.io.ClassPathResource;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyList;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
@SpringBootTest(classes = StoerungsauskunftInterfaceApplication.class)
@ContextConfiguration(classes = {TestConfiguration.class})
@@ -27,8 +53,17 @@
@Autowired
private ImportSchedulerConfig importSchedulerConfig;
+ @Autowired
+ ObjectMapper objectMapper;
+
@Test
- public void shoulImportUserNotification() {
+ public void shoulImportUserNotification() throws IOException {
+ InputStream is = new ClassPathResource("UsernotificationJsonResponse.json").getInputStream();
+ List<StoerungsauskunftUserNotification> userNotificationList =
+ objectMapper.readValue(is, new TypeReference<List<StoerungsauskunftUserNotification>>() {
+ });
+ when(stoerungsauskunftApi.getUserNotification(any(Integer.class))).thenReturn(userNotificationList);
+
importSchedulerConfig.scheduleTaskImportUserNotifications();
verify(importExportService, times(1)).importUserNotifications();
}
diff --git a/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/controller/ImportExportControllerTest.java b/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/controller/ImportExportControllerTest.java
index 02b4b52..1ed2179 100644
--- a/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/controller/ImportExportControllerTest.java
+++ b/stoerungsauskunftInterface/src/test/java/org/eclipse/openk/gridfailureinformation/stoerauskunftinterface/controller/ImportExportControllerTest.java
@@ -15,6 +15,7 @@
package org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
+import lombok.With;
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.StoerungsauskunftInterfaceApplication;
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.api.StoerungsauskunftApi;
import org.eclipse.openk.gridfailureinformation.stoerauskunftinterface.dtos.RabbitMqMessageDto;
@@ -26,6 +27,8 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.MediaType;
+import org.springframework.security.test.context.support.WithAnonymousUser;
+import org.springframework.security.test.context.support.WithMockUser;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.web.servlet.MockMvc;
@@ -51,6 +54,7 @@
@Test
+ @WithMockUser(value = "mockedUser")
public void shouldCallImport() throws Exception {
mockMvc.perform(get("/stoerungsauskunft/usernotification-import-test"))
@@ -60,6 +64,16 @@
}
@Test
+ public void shouldCallImportAndReturnUnauthorized() throws Exception {
+
+ mockMvc.perform(get("/stoerungsauskunft/usernotification-import-test"))
+ .andExpect(status().isUnauthorized());
+
+ verify(importExportService, times(0)).importUserNotifications();
+ }
+
+ @Test
+ @WithMockUser(value = "mockedUser")
public void shouldCallExport() throws Exception {
RabbitMqMessageDto rabbitMqMessageDto = MockDataHelper.mockRabbitMqMessageDto();
@@ -71,4 +85,17 @@
verify(importExportService, times(1)).exportStoerungsauskunftOutage(rabbitMqMessageDto);
}
+
+ @Test
+ public void shouldCallExportAndReturnUnauthorized() throws Exception {
+
+ RabbitMqMessageDto rabbitMqMessageDto = MockDataHelper.mockRabbitMqMessageDto();
+
+ mockMvc.perform(post("/stoerungsauskunft/outage-export-test")
+ .contentType(MediaType.APPLICATION_JSON)
+ .content(new ObjectMapper().writeValueAsString(rabbitMqMessageDto)))
+ .andExpect(status().isUnauthorized());
+
+ verify(importExportService, times(0)).exportStoerungsauskunftOutage(rabbitMqMessageDto);
+ }
}
\ No newline at end of file
diff --git a/stoerungsauskunftInterface/src/test/resources/application.yml b/stoerungsauskunftInterface/src/test/resources/application.yml
index 843be83..c2a1253 100644
--- a/stoerungsauskunftInterface/src/test/resources/application.yml
+++ b/stoerungsauskunftInterface/src/test/resources/application.yml
@@ -67,6 +67,10 @@
useStaticJwt: true
staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
+security.endpoint:
+ user: user
+ password: secret
+
stoerungsauskunft:
apiUrl: https://stage-api-operator.stoerungsauskunft.de/api/v1.0/
user: userName
diff --git a/testImportGridFailures/Dockerfile_DevServer b/testImportGridFailures/Dockerfile_DevServer
index 88a7662..d00df54 100644
--- a/testImportGridFailures/Dockerfile_DevServer
+++ b/testImportGridFailures/Dockerfile_DevServer
@@ -1,7 +1,18 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+
FROM openjdk:8-jre-alpine
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/testImportGridFailures/Dockerfile_DevServerUnsecure b/testImportGridFailures/Dockerfile_DevServerUnsecure
index 7af0f68..0f88192 100644
--- a/testImportGridFailures/Dockerfile_DevServerUnsecure
+++ b/testImportGridFailures/Dockerfile_DevServerUnsecure
@@ -1,7 +1,18 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
+
FROM openjdk:8-jre-alpine
-ENV HTTP_PROXY http://webproxy3.pta.de:8080
-ENV HTTPS_PROXY http://webproxy3.pta.de:8080
ENV TZ Europe/Berlin
# install tzdata to set the right timezone
diff --git a/testImportGridFailures/pom.xml b/testImportGridFailures/pom.xml
index aceacc0..5c37235 100644
--- a/testImportGridFailures/pom.xml
+++ b/testImportGridFailures/pom.xml
@@ -1,11 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
- <version>2.2.4.RELEASE</version>
+ <version>2.2.10.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.eclipse.openk</groupId>
diff --git a/testImportGridFailures/sonar-project.properties b/testImportGridFailures/sonar-project.properties
index 2d905d0..aa53eca 100644
--- a/testImportGridFailures/sonar-project.properties
+++ b/testImportGridFailures/sonar-project.properties
@@ -1,3 +1,15 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
# must be unique in a given SonarQube instance
sonar.projectKey=openk.pta.de:testImportGridFailures
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
diff --git a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplication.java b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplication.java
index 5e18d29..e031cbd 100644
--- a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplication.java
+++ b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplication.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures;
import org.springframework.boot.SpringApplication;
diff --git a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/EventProducerConfig.java b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/EventProducerConfig.java
index 88c8f5b..1dab7e1 100644
--- a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/EventProducerConfig.java
+++ b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/EventProducerConfig.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.config;
import lombok.extern.log4j.Log4j2;
diff --git a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/SwaggerConfig.java b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/SwaggerConfig.java
index 66eb015..9b692e4 100644
--- a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/SwaggerConfig.java
+++ b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/config/SwaggerConfig.java
@@ -1,4 +1,17 @@
-
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.config;
import lombok.extern.log4j.Log4j2;
@@ -19,9 +32,9 @@
@Profile({"!test","!prod"})
public class SwaggerConfig {
- @Value("${swagger.baseUrl}")
+ @Value("${swagger.baseUrl:}")
public String baseUrl;
- @Value("${swagger.proxyUrl}")
+ @Value("${swagger.proxyUrl:}")
public String proxyUrl;
@Bean
diff --git a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureDataDto.java b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureDataDto.java
index cb119c3..1c5e998 100644
--- a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureDataDto.java
+++ b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureDataDto.java
@@ -26,11 +26,14 @@
@Data
public class ForeignFailureDataDto implements Serializable {
+ private boolean isAutopublish;
+
@NotNull
private boolean isPlanned;
+ @Size(max=255)
@JsonProperty("description")
- private String internalRemark;
+ private String description;
@NotNull
@Pattern(regexp = "^$|(S|W|F|G|TK|ST|OS)")
@@ -53,31 +56,31 @@
private Date failureEndResupplied;
@Size(max=10)
- @Pattern(regexp="^$|[A-Za-z0-9_/-]+")
+ @Pattern(regexp="^$|[A-Za-z0-9ÄäÖöÜüß_/-]+")
private String postcode;
@Size(max=200)
- @Pattern(regexp="^$|[A-Za-z0-9\\s_/()-]+")
+ @Pattern(regexp="^$|[A-Za-z0-9ÄäÖöÜüß\\s_/()-]+")
private String city;
@Size(max=200)
- @Pattern(regexp="^$|[A-Za-z0-9\\s_/()-]+")
+ @Pattern(regexp="^$|[A-Za-z0-9ÄäÖöÜüß\\s_/()-]+")
private String district;
@Size(max=200)
- @Pattern(regexp="^$|[A-Za-z0-9\\s_/()-]+")
+ @Pattern(regexp="^$|[A-Za-z0-9ÄäÖöÜüß\\s_/()-]+")
private String street;
@Size(max=10)
- @Pattern(regexp="^$|[A-Za-z0-9\\s_/()-]+")
+ @Pattern(regexp="^$|[A-Za-z0-9ÄäÖöÜüß\\s_/()-]+")
private String housenumber;
@Size(max=200)
- @Pattern(regexp="^$|[A-Za-z0-9\\s_/()-]+")
+ @Pattern(regexp="^$|[A-Za-z0-9ÄäÖöÜüß\\s_/()-]+")
private String stationId;
@Size(max=200)
- @Pattern(regexp="^$|[A-Za-z0-9\\s_/(),.;:-]+")
+ @Pattern(regexp="^$|[A-Za-z0-9ÄäÖöÜüß\\s_/(),.;:-]+")
private String stationDescription;
private BigDecimal longitude;
diff --git a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureMessageDto.java b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureMessageDto.java
index e956609..0356e5f 100644
--- a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureMessageDto.java
+++ b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/dtos/ForeignFailureMessageDto.java
@@ -31,12 +31,12 @@
private String metaId;
@Size(max=256)
- @Pattern(regexp="^$|[A-Za-z0-9\\s_/(),.;:-]+")
+ @Pattern(regexp="^$|[A-Za-z0-99ÄäÖöÜüß\\s_/(),.;:-]+")
private String description;
@NotNull
@Size(max=100)
- @Pattern(regexp="[A-Za-z0-9\\s_/(),.;:-]+")
+ @Pattern(regexp="[A-Za-z0-9ÄäÖöÜüß\\s_/(),.;:-]+")
private String source;
@NotNull
diff --git a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/exceptions/UnauthorizedException.java b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/exceptions/UnauthorizedException.java
index b0d1619..dbc6ca3 100644
--- a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/exceptions/UnauthorizedException.java
+++ b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/exceptions/UnauthorizedException.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.exceptions;
import org.springframework.http.HttpStatus;
diff --git a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/service/ImportService.java b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/service/ImportService.java
index 77cbd42..480b468 100644
--- a/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/service/ImportService.java
+++ b/testImportGridFailures/src/main/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/service/ImportService.java
@@ -19,6 +19,7 @@
import org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.dtos.ForeignFailureMessageDto;
import org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.exceptions.InternalServerErrorException;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.messaging.support.MessageBuilder;
@@ -31,6 +32,9 @@
@ConfigurationProperties(prefix = "rabbitmq")
public class ImportService {
+ @Value("${gridFailureInformation.autopublish:false}")
+ private boolean autopublish;
+
@Autowired
private MessageChannel failureImportChannel;
@@ -39,6 +43,8 @@
public void pushForeignFailure(ForeignFailureMessageDto foreignFailureMessageDto) {
+ foreignFailureMessageDto.getPayload().setAutopublish(autopublish);
+
try {
failureImportChannel.send(
MessageBuilder.withPayload(
diff --git a/testImportGridFailures/src/main/resources/application.yml b/testImportGridFailures/src/main/resources/application.yml
index 67cbdee..5bf6544 100644
--- a/testImportGridFailures/src/main/resources/application.yml
+++ b/testImportGridFailures/src/main/resources/application.yml
@@ -36,6 +36,7 @@
gridFailureInformation:
maxListSize: 2000
+ autopublish: true
services:
authNAuth:
@@ -54,10 +55,6 @@
cors:
corsEnabled: false
-swagger:
- baseUrl:
- proxyUrl:
-
---
spring:
@@ -153,5 +150,4 @@
corsEnabled: true
swagger:
- baseUrl: /testImporter
- proxyUrl:
\ No newline at end of file
+ baseUrl: /testImporter
\ No newline at end of file
diff --git a/testImportGridFailures/src/main/resources/application_localdev.yml b/testImportGridFailures/src/main/resources/application_localdev.yml
index 2ed5011..82b5a6f 100644
--- a/testImportGridFailures/src/main/resources/application_localdev.yml
+++ b/testImportGridFailures/src/main/resources/application_localdev.yml
@@ -45,6 +45,7 @@
gridFailureInformation:
maxListSize: 2000
+ autopublish: true
jwt:
tokenHeader: Authorization
@@ -62,10 +63,6 @@
cors:
corsEnabled: true
-swagger:
- baseUrl:
- proxyUrl:
-
---
spring:
diff --git a/testImportGridFailures/src/main/resources/messages.properties b/testImportGridFailures/src/main/resources/messages.properties
index b8b3b11..fc08b29 100644
--- a/testImportGridFailures/src/main/resources/messages.properties
+++ b/testImportGridFailures/src/main/resources/messages.properties
@@ -1,3 +1,15 @@
+# *******************************************************************************
+# * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+# * http://www.eclipse.org/legal/epl-2.0.
+# *
+# * SPDX-License-Identifier: EPL-2.0
+# *******************************************************************************
#Fehlermeldungen
could.not.push.message=Das Objekt konnte nicht an RabbitMQ gesendet werden.
diff --git a/testImportGridFailures/src/test/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplicationTests.java b/testImportGridFailures/src/test/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplicationTests.java
index b5cb63e..d849354 100644
--- a/testImportGridFailures/src/test/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplicationTests.java
+++ b/testImportGridFailures/src/test/java/org/eclipse/openk/gridfailureinformation/jobs/importgridfailures/TestImportGridFailuresApplicationTests.java
@@ -1,3 +1,17 @@
+/*
+ *******************************************************************************
+ * Copyright (c) 2019 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 Eclipse Public License v. 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *******************************************************************************
+ */
package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures;
import org.junit.jupiter.api.Test;