Merge branch 'SI-65_REF-Tables_HR' of ssh://git.eclipse.org:29418/openk-usermodules/org.eclipse.openk-usermodules.gridFailureInformation.backend into DEVELOP
diff --git a/gfsBackendService/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc b/gfsBackendService/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc
index 313b619..9d11362 100644
--- a/gfsBackendService/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc
+++ b/gfsBackendService/src/main/asciidoc/architectureDocumentation/architectureDocumentation.adoc
@@ -23,6 +23,9 @@
:source-highlighter: highlightjs
:highlightjs-theme: solarized_dark
+:imagesdir: ../img
+:iconsdir: ../img/icons
+
This documentation is based on the ARC42-Template (v7.0):
== Introduction and Goals
@@ -478,44 +481,46 @@
=== Solution Strategy
-The module 'Contact Base Data' bases on a three-tier architecture:
-
-. *Frontend* - The GUI is implemented as a web-frontend with rich-client functionalities.
-. *Backend* - The business functionalities are implemented in the backend tier. It provides the business functions via RESTful Webservices.
-. *Database* - The database stores all module specific data.
+The module 'Grid Failure Information' bases on a small microservice architecture, including
+an asynchronous messaging system.
== Building Block View
=== Whitebox Overall System
-The module 'Contact Base Data' contains two components (see figure 2):
+The module 'grid failure information' contains several components:
-. *UI* - Represents the graphical user interface and consumes the services from the business logic component via RESTful webservices.
-. *Business Logic* - Realizes the business functionality and the data storage of the module. The
-module itself is split up in several components due to the requirement to use
-microservices.
+. *SIT-Web-FE* - This component (SPA with Angular) provides two HTML pages: a table and a map
+with failure information. This component is in the DMZ and can be called up from the Internet.
+. *SIT-Web-Guard* - The SIT-Web-Guard (Java Spring Cloud) is a Zuul proxy
+(API gateway) that only forwards explicitly configured services. For the failure information
+tool, only certain services are available on the Internet that do not require authentication.
+Since the SIT-BE is protected by Spring Security, the SIT-Web-Guard procures guest authentication for forwarding.
+. *SIT-FE* -
+This component (SPA with Angular) provides the user interface for the failure information application. The SIT-FE
+receives its authentication when it is called from the PortalFE in the form of a JWT.
+. *SIT_BE* - The SIT-BE (Java Spring Boot Microservice) provides all CRUD services in the form of
+ReST services that the two frontends require. The SIT-BE is the only component that has
+access to the database. Every call is authorized against the PortalBE. This microservice also includes
+the JobManager subcomponent.
+. *JobManager* - The various imports and exports are controlled via the JobManager. The JobManager
+knows all available import and export jobs and can control them via the internal message bus
+(RabbitMQ internal). Because the communication between the JobManager and the jobs takes place
+via the message bus, the JM does not need to know their configuration and URLs. For this, the JM must
+ensure synchronization (incl. timeout behavior) for asynchronous message communication.
+. *Import- and export jobs* - All jobs provide a uniform (MessageBus) interface to start a job,
+return the result of a job, or to provide information about the respective job (name, version, timeout, status, etc.).
+The job manager cyclically requests all configured jobs to send current status information to it.
+The interfaces of the individual jobs "outside" can be very different (file system, Internet, message queue, etc.)
-.Module components
+
+.Architecture of the grid failure information tool
[options="header,footer"]
-[plantuml]
-----
-node Module {
- rectangle UI
- rectangle BusinessLogic
-
- interface REST
-
- UI -> REST
- REST -- BusinessLogic
-}
-----
+image::architectureSIT.png[]
-The communication between WebBrowser and Apache Tomcat is established via HTTP/HTTPS.
-ApacheTomcat is connected to the data source (PostgresDBMS) via TCP/IP.
-
==== contactBaseDataFE
This component implements the presentation logic for the *contact-base-data*-module using the *Angular*-TypeScript
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureClassificationController.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureClassificationController.java
new file mode 100644
index 0000000..62eb519
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureClassificationController.java
@@ -0,0 +1,44 @@
+/*
+ *******************************************************************************
+ * 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;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.log4j.Log4j2;
+import org.eclipse.openk.gridfailureinformation.service.FailureClassificationService;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureClassificationDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Log4j2
+@RestController
+@RequestMapping("/failure-classifications")
+public class FailureClassificationController {
+
+ @Autowired
+ private FailureClassificationService failureClassificationService;
+
+ @ApiOperation(value = "Anzeigen aller Störungsmeldungsklassen")
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "Erfolgreich durchgeführt")})
+ @GetMapping
+ public List<FailureClassificationDto> findBranches() {
+ return failureClassificationService.getFailureClassifications();
+ }
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeController.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeController.java
new file mode 100644
index 0000000..c1d73a5
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeController.java
@@ -0,0 +1,44 @@
+/*
+ *******************************************************************************
+ * 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;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.log4j.Log4j2;
+import org.eclipse.openk.gridfailureinformation.service.FailureTypeService;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Log4j2
+@RestController
+@RequestMapping("/failure-types")
+public class FailureTypeController {
+
+ @Autowired
+ private FailureTypeService failureTypeService;
+
+ @ApiOperation(value = "Anzeigen aller Störungsmeldungstypen")
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "Erfolgreich durchgeführt")})
+ @GetMapping
+ public List<FailureTypeDto> findBranches() {
+ return failureTypeService.getFailureTypes();
+ }
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/StatusController.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/StatusController.java
new file mode 100644
index 0000000..c337bca
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/controller/StatusController.java
@@ -0,0 +1,45 @@
+/*
+ *******************************************************************************
+ * 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;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import lombok.extern.log4j.Log4j2;
+import org.eclipse.openk.gridfailureinformation.service.StatusService;
+import org.eclipse.openk.gridfailureinformation.viewmodel.StatusDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@Log4j2
+@RestController
+@RequestMapping("/status")
+public class StatusController {
+
+ @Autowired
+ private StatusService statusService;
+
+ @ApiOperation(value = "Anzeigen aller Status")
+ @ApiResponses(value = {@ApiResponse(code = 200, message = "Erfolgreich durchgeführt")})
+ @GetMapping
+ public List<StatusDto> findStatus() {
+ return statusService.getStatus();
+ }
+
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureClassificationMapper.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureClassificationMapper.java
new file mode 100644
index 0000000..dabcea2
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureClassificationMapper.java
@@ -0,0 +1,28 @@
+/*
+ *******************************************************************************
+ * 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;
+
+import org.eclipse.openk.gridfailureinformation.model.RefFailureClassification;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureClassificationDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface FailureClassificationMapper {
+
+ FailureClassificationDto toFailureClassificationDto(RefFailureClassification refFailureClassification);
+
+ RefFailureClassification toRefFailureClassification(FailureClassificationDto failureClassificationDto);
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureTypeMapper.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureTypeMapper.java
new file mode 100644
index 0000000..fc8b412
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/FailureTypeMapper.java
@@ -0,0 +1,28 @@
+/*
+ *******************************************************************************
+ * 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;
+
+import org.eclipse.openk.gridfailureinformation.model.RefFailureType;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface FailureTypeMapper {
+
+ FailureTypeDto toFailureTypeDto(RefFailureType refFailureType);
+
+ RefFailureType toRefFailureType(FailureTypeDto failureTypeDto);
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/StatusMapper.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/StatusMapper.java
new file mode 100644
index 0000000..6d6dfff
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/mapper/StatusMapper.java
@@ -0,0 +1,27 @@
+/*
+ *******************************************************************************
+ * 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;
+
+import org.eclipse.openk.gridfailureinformation.model.RefStatus;
+import org.eclipse.openk.gridfailureinformation.viewmodel.StatusDto;
+import org.mapstruct.Mapper;
+import org.mapstruct.ReportingPolicy;
+
+@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
+public interface StatusMapper {
+ StatusDto toStatusDto(RefStatus refStatus);
+
+ RefStatus toRefStatus(StatusDto statusDto);
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureClassificationService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureClassificationService.java
new file mode 100644
index 0000000..d08d7d0
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureClassificationService.java
@@ -0,0 +1,45 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.mapper.FailureClassificationMapper;
+import org.eclipse.openk.gridfailureinformation.repository.FailureClassificationRepository;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureClassificationDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@Service
+public class FailureClassificationService {
+
+ @Autowired
+ private FailureClassificationRepository failureClassificationRepository;
+
+ @Autowired
+ private FailureClassificationMapper failureClassificationMapper;
+
+
+ public List<FailureClassificationDto> getFailureClassifications() {
+
+ return failureClassificationRepository.findAll().stream()
+ .map( failureClassificationMapper::toFailureClassificationDto )
+ .collect(Collectors.toList());
+ }
+
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeService.java
new file mode 100644
index 0000000..6c0c4bf
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeService.java
@@ -0,0 +1,45 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.mapper.FailureTypeMapper;
+import org.eclipse.openk.gridfailureinformation.repository.FailureTypeRepository;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@Service
+public class FailureTypeService {
+
+ @Autowired
+ private FailureTypeRepository failureTypeRepository;
+
+ @Autowired
+ private FailureTypeMapper failureTypeMapper;
+
+
+ public List<FailureTypeDto> getFailureTypes() {
+
+ return failureTypeRepository.findAll().stream()
+ .map( failureTypeMapper::toFailureTypeDto )
+ .collect(Collectors.toList());
+ }
+
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/StatusService.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/StatusService.java
new file mode 100644
index 0000000..af10f1d
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/service/StatusService.java
@@ -0,0 +1,45 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.mapper.StatusMapper;
+import org.eclipse.openk.gridfailureinformation.repository.StatusRepository;
+import org.eclipse.openk.gridfailureinformation.viewmodel.StatusDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+
+@Service
+public class StatusService {
+
+ @Autowired
+ private StatusRepository statusRepository;
+
+ @Autowired
+ private StatusMapper statusMapper;
+
+
+ public List<StatusDto> getStatus() {
+
+ return statusRepository.findAll().stream()
+ .map( statusMapper::toStatusDto )
+ .collect(Collectors.toList());
+ }
+
+}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureClassificationDto.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureClassificationDto.java
index 1c4ba58..5d66b0e 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureClassificationDto.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/viewmodel/FailureClassificationDto.java
@@ -27,3 +27,4 @@
private String classification;
private String description;
}
+
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java
index e2d500e..2640599 100644
--- a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/config/TestConfiguration.java
@@ -20,9 +20,7 @@
import org.eclipse.openk.gridfailureinformation.mapper.VersionMapper;
import org.eclipse.openk.gridfailureinformation.mapper.VersionMapperImpl;
import org.eclipse.openk.gridfailureinformation.mapper.*;
-import org.eclipse.openk.gridfailureinformation.service.BranchService;
-import org.eclipse.openk.gridfailureinformation.service.FailureInformationService;
-import org.eclipse.openk.gridfailureinformation.service.VersionService;
+import org.eclipse.openk.gridfailureinformation.service.*;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
import org.springframework.context.annotation.Bean;
@@ -39,18 +37,33 @@
VersionMapper versionMapper() { return new VersionMapperImpl(); }
@Bean
- FailureInformationMapper gridFailureInformationMapper() { return new FailureInformationMapperImpl(); }
+ FailureInformationMapper failureInformationMapper() { return new FailureInformationMapperImpl(); }
@Bean
BranchMapper branchMapper() { return new BranchMapperImpl(); }
@Bean
+ FailureClassificationMapper failureClassificationMapper() {
+ return new FailureClassificationMapperImpl();
+ }
+
+ @Bean
+ FailureTypeMapper failureTypeMapper() {
+ return new FailureTypeMapperImpl();
+ }
+
+ @Bean
+ StatusMapper statusMapper() {
+ return new StatusMapperImpl();
+ }
+
+ @Bean
public VersionService myVersionService() {
return new VersionService();
}
@Bean
- public FailureInformationService myGridFailureInformationService() {
+ public FailureInformationService myFailureInformationService() {
return new FailureInformationService();
}
@@ -59,4 +72,18 @@
return new BranchService();
}
+ @Bean
+ public FailureClassificationService myFailureClassificationService() {
+ return new FailureClassificationService();
+ }
+
+ @Bean
+ public FailureTypeService myFailureTypeService() {
+ return new FailureTypeService();
+ }
+
+ @Bean
+ public StatusService myStatusService() {
+ return new StatusService();
+ }
}
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureClassificationControllerTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureClassificationControllerTest.java
new file mode 100644
index 0000000..d3efe42
--- /dev/null
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureClassificationControllerTest.java
@@ -0,0 +1,56 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.GridFailureInformationApplication;
+import org.eclipse.openk.gridfailureinformation.service.FailureClassificationService;
+import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureClassificationDto;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+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.http.MediaType;
+import org.springframework.test.web.servlet.MockMvc;
+
+import java.util.List;
+
+import static org.mockito.Mockito.when;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+@SpringBootTest(classes = GridFailureInformationApplication.class)
+@AutoConfigureMockMvc
+public class FailureClassificationControllerTest {
+
+ @MockBean
+ private FailureClassificationService failureClassificationService;
+
+ @Autowired
+ private MockMvc mockMvc;
+
+ @Test
+ public void shouldReturnFailureClassifications() throws Exception {
+ List<FailureClassificationDto> failureClassificationDtoList = MockDataHelper.mockFailureClassificationDtoList();
+ when(failureClassificationService.getFailureClassifications()).thenReturn(failureClassificationDtoList);
+
+ mockMvc.perform(get("/failure-classifications"))
+ .andExpect(status().is2xxSuccessful())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON));
+ }
+
+}
\ No newline at end of file
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeControllerTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeControllerTest.java
new file mode 100644
index 0000000..8d6fa2d
--- /dev/null
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/FailureTypeControllerTest.java
@@ -0,0 +1,56 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.GridFailureInformationApplication;
+import org.eclipse.openk.gridfailureinformation.service.FailureTypeService;
+import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+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.http.MediaType;
+import org.springframework.test.web.servlet.MockMvc;
+
+import java.util.List;
+
+import static org.mockito.Mockito.when;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+@SpringBootTest(classes = GridFailureInformationApplication.class)
+@AutoConfigureMockMvc
+public class FailureTypeControllerTest {
+
+ @MockBean
+ private FailureTypeService failureTypeService;
+
+ @Autowired
+ private MockMvc mockMvc;
+
+ @Test
+ public void shouldReturnFailureTypes() throws Exception {
+ List<FailureTypeDto> failureTypeDtoList = MockDataHelper.mockFailureTypeDtoList();
+ when(failureTypeService.getFailureTypes()).thenReturn(failureTypeDtoList);
+
+ mockMvc.perform(get("/failure-types"))
+ .andExpect(status().is2xxSuccessful())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON));
+ }
+
+}
\ No newline at end of file
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/StatusControllerTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/StatusControllerTest.java
new file mode 100644
index 0000000..05b8828
--- /dev/null
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/controller/StatusControllerTest.java
@@ -0,0 +1,57 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.GridFailureInformationApplication;
+import org.eclipse.openk.gridfailureinformation.service.StatusService;
+import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
+import org.eclipse.openk.gridfailureinformation.viewmodel.StatusDto;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+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.http.MediaType;
+import org.springframework.test.web.servlet.MockMvc;
+
+import java.util.List;
+
+import static org.mockito.Mockito.when;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
+@SpringBootTest(classes = GridFailureInformationApplication.class)
+@AutoConfigureMockMvc
+public class StatusControllerTest {
+
+ @MockBean
+ private StatusService statusService;
+
+ @Autowired
+ private MockMvc mockMvc;
+
+
+ @Test
+ public void shouldReturnStatus() throws Exception {
+ List<StatusDto> statusDtoList = MockDataHelper.mockStatusDtoList();
+ when(statusService.getStatus()).thenReturn(statusDtoList);
+
+ mockMvc.perform(get("/status"))
+ .andExpect(status().is2xxSuccessful())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON));
+ }
+
+}
\ No newline at end of file
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureClassificationServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureClassificationServiceTest.java
new file mode 100644
index 0000000..b9cf14f
--- /dev/null
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureClassificationServiceTest.java
@@ -0,0 +1,58 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.config.TestConfiguration;
+import org.eclipse.openk.gridfailureinformation.model.RefFailureClassification;
+import org.eclipse.openk.gridfailureinformation.repository.FailureClassificationRepository;
+import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureClassificationDto;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.Mockito.when;
+
+//@RunWith(SpringRunner.class)
+@DataJpaTest
+@ContextConfiguration(classes = {TestConfiguration.class})
+
+public class FailureClassificationServiceTest {
+ @Qualifier("myFailureClassificationService")
+ @Autowired
+ private FailureClassificationService failureClassificationService;
+
+ @MockBean
+ private FailureClassificationRepository failureClassificationRepository;
+
+ @Test
+ public void shouldGetFailureClassificationsProperly() {
+ List<RefFailureClassification> mockRefFailureClassificationList = MockDataHelper.mockRefFailureClassificationList();
+ when(failureClassificationRepository.findAll()).thenReturn(mockRefFailureClassificationList);
+ List<FailureClassificationDto> listRefFailureClassification = failureClassificationService.getFailureClassifications();
+
+ assertEquals(listRefFailureClassification.size(), mockRefFailureClassificationList.size());
+ assertEquals(listRefFailureClassification.size(), 2);
+ assertEquals(listRefFailureClassification.get(1).getUuid(), mockRefFailureClassificationList.get(1).getUuid());
+ }
+}
+
+
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 afcee44..52044db 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
@@ -41,7 +41,7 @@
@ContextConfiguration(classes = {TestConfiguration.class})
public class FailureInformationServiceTest {
- @Qualifier("myGridFailureInformationService")
+ @Qualifier("myFailureInformationService")
@Autowired
private FailureInformationService failureInformationService;
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeServiceTest.java
new file mode 100644
index 0000000..5c15462
--- /dev/null
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/FailureTypeServiceTest.java
@@ -0,0 +1,57 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.config.TestConfiguration;
+import org.eclipse.openk.gridfailureinformation.model.RefFailureType;
+import org.eclipse.openk.gridfailureinformation.repository.FailureTypeRepository;
+import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
+import org.eclipse.openk.gridfailureinformation.viewmodel.FailureTypeDto;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+
+import java.util.List;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.Mockito.when;
+
+//@RunWith(SpringRunner.class)
+@DataJpaTest
+@ContextConfiguration(classes = {TestConfiguration.class})
+
+public class FailureTypeServiceTest {
+ @Qualifier("myFailureTypeService")
+ @Autowired
+ private FailureTypeService failureTypeService;
+
+ @MockBean
+ private FailureTypeRepository failureTypeRepository;
+
+ @Test
+ public void shouldGetFailureTypesProperly() {
+ List<RefFailureType> mockRefFailureTypeList = MockDataHelper.mockRefFailureTypeList();
+ when(failureTypeRepository.findAll()).thenReturn(mockRefFailureTypeList);
+ List<FailureTypeDto> listRefFailureType = failureTypeService.getFailureTypes();
+
+ assertEquals(listRefFailureType.size(), mockRefFailureTypeList.size());
+ assertEquals(listRefFailureType.size(), 2);
+ assertEquals(listRefFailureType.get(1).getUuid(), mockRefFailureTypeList.get(1).getUuid());
+ }
+}
+
diff --git a/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/StatusServiceTest.java b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/StatusServiceTest.java
new file mode 100644
index 0000000..da228fd
--- /dev/null
+++ b/gfsBackendService/src/test/java/org/eclipse/openk/gridfailureinformation/service/StatusServiceTest.java
@@ -0,0 +1,61 @@
+/*
+ *******************************************************************************
+ * 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 org.eclipse.openk.gridfailureinformation.config.TestConfiguration;
+import org.eclipse.openk.gridfailureinformation.constants.Constants;
+import org.eclipse.openk.gridfailureinformation.model.RefStatus;
+import org.eclipse.openk.gridfailureinformation.model.RefStatus;
+import org.eclipse.openk.gridfailureinformation.repository.StatusRepository;
+import org.eclipse.openk.gridfailureinformation.support.MockDataHelper;
+import org.eclipse.openk.gridfailureinformation.viewmodel.StatusDto;
+import org.eclipse.openk.gridfailureinformation.viewmodel.StatusDto;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
+import org.springframework.boot.test.mock.mockito.MockBean;
+import org.springframework.test.context.ContextConfiguration;
+
+import java.util.List;
+import java.util.Optional;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.when;
+
+//@RunWith(SpringRunner.class)
+@DataJpaTest
+@ContextConfiguration(classes = {TestConfiguration.class})
+
+public class StatusServiceTest {
+ @Qualifier("myStatusService")
+ @Autowired
+ private StatusService statusService;
+
+ @MockBean
+ private StatusRepository statusRepository;
+
+ @Test
+ public void shouldGetStatusProperly() {
+ List<RefStatus> mockRefStatusList = MockDataHelper.mockRefStatusList();
+ when(statusRepository.findAll()).thenReturn(mockRefStatusList);
+ List<StatusDto> listRefStatus = statusService.getStatus();
+
+ assertEquals(listRefStatus.size(), mockRefStatusList.size());
+ assertEquals(listRefStatus.size(), 2);
+ assertEquals(listRefStatus.get(1).getUuid(), mockRefStatusList.get(1).getUuid());
+ }
+}
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 7e95545..bd78cde 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
@@ -171,7 +171,179 @@
return refBranchList;
}
+ public static FailureTypeDto failureTypeDto() {
+ FailureTypeDto failureTypeDto1 = new FailureTypeDto();
+ failureTypeDto1.setUuid(UUID.fromString("44a2aaed-8910-4116-b0c4-0855f8d3c28d"));
+ failureTypeDto1.setType("Information");
+ failureTypeDto1.setDescription(null);
+
+ return failureTypeDto1;
+ }
+ public static FailureTypeDto failureTypeDto2() {
+ FailureTypeDto failureTypeDto2 = new FailureTypeDto();
+
+ failureTypeDto2.setUuid(UUID.fromString("94e880c4-3127-47d5-aaee-5f778462ab0c"));
+ failureTypeDto2.setType("unterlagerte Störung");
+ failureTypeDto2.setDescription("Nicht zu veröffentlichen");
+
+ return failureTypeDto2;
+ }
+
+ public static List<FailureTypeDto> mockFailureTypeDtoList() {
+ FailureTypeDto failureTypeDto1 = failureTypeDto();
+ FailureTypeDto failureTypeDto2 = failureTypeDto2();
+
+ List<FailureTypeDto> failureTypeDtoList = new ArrayList<>();
+ failureTypeDtoList.add(failureTypeDto1);
+ failureTypeDtoList.add(failureTypeDto2);
+
+ return failureTypeDtoList;
+ }
+
+ public static RefFailureType refFailureType() {
+ RefFailureType refFailureType1 = new RefFailureType();
+
+ refFailureType1.setUuid(UUID.fromString("44a2aaed-8910-4116-b0c4-0855f8d3c28d"));
+ refFailureType1.setType("Andere Information");
+ refFailureType1.setDescription(null);
+
+ return refFailureType1;
+ }
+
+ public static RefFailureType refFailureType2() {
+ RefFailureType refFailureType2 = new RefFailureType();
+
+ refFailureType2.setUuid(UUID.fromString("94e880c4-3127-47d5-aaee-5f778462ab0c"));
+ refFailureType2.setType("unterlagerte Störung");
+ refFailureType2.setDescription("Nicht zu veröffentlichen");
+
+ return refFailureType2;
+ }
+/*
+ public static List<RefFailureType> mockRefFailureTypeList() {
+ RefFailureType refFailureType1 = refFailureType();
+ RefFailureType refFailureType2 = refFailureType2();
+
+ List<RefFailureType> refFailureTypeList = new ArrayList<>();
+ refFailureTypeList.add(refFailureType1);
+ refFailureTypeList.add(refFailureType2);
+
+ return refFailureTypeList;
+ }
+*/
+
+ public static FailureClassificationDto failureClassificationDto() {
+ FailureClassificationDto failureClassificationDto1 = new FailureClassificationDto();
+
+ failureClassificationDto1.setUuid(UUID.fromString("9992aaed-8910-4116-b0c4-0855f8d3c28d"));
+ failureClassificationDto1.setClassification("Störung");
+ failureClassificationDto1.setDescription("Störungsbeschreibung");
+
+ return failureClassificationDto1;
+ }
+ public static FailureClassificationDto failureClassificationDto2() {
+ FailureClassificationDto failureClassificationDto2 = new FailureClassificationDto();
+
+ failureClassificationDto2.setUuid(UUID.fromString("999880c4-3127-47d5-aaee-5f778462ab0c"));
+ failureClassificationDto2.setClassification("geplante Maßnahme");
+ failureClassificationDto2.setDescription("Maßnahme, die geplant ist");
+
+ return failureClassificationDto2;
+ }
+/*
+ public static List<FailureClassificationDto> mockFailureClassificationDtoList() {
+ FailureClassificationDto failureClassificationDto1 = failureClassificationDto();
+ FailureClassificationDto failureClassificationDto2 = failureClassificationDto2();
+
+ List<FailureClassificationDto> failureClassificationDtoList = new ArrayList<>();
+ failureClassificationDtoList.add(failureClassificationDto1);
+ failureClassificationDtoList.add(failureClassificationDto2);
+
+ return failureClassificationDtoList;
+ }
+*/
+ public static RefFailureClassification refFailureClassification() {
+ RefFailureClassification refFailureClassification1 = new RefFailureClassification();
+
+ refFailureClassification1.setUuid(UUID.fromString("8882aaed-8910-4116-b0c4-0855f8d3c28d"));
+ refFailureClassification1.setClassification("Störung");
+ refFailureClassification1.setDescription(null);
+
+ return refFailureClassification1;
+ }
+
+ public static RefFailureClassification refFailureClassification2() {
+ RefFailureClassification refFailureClassification2 = new RefFailureClassification();
+
+ refFailureClassification2.setUuid(UUID.fromString("888880c4-3127-47d5-aaee-5f778462ab0c"));
+ refFailureClassification2.setClassification("Ereignis");
+ refFailureClassification2.setDescription("Ereignisbeschreibung");
+
+ return refFailureClassification2;
+ }
+ /*
+ public static List<RefFailureClassification> mockRefFailureClassificationList() {
+ RefFailureClassification refFailureClassification1 = refFailureClassification();
+ RefFailureClassification refFailureClassification2 = refFailureClassification2();
+
+ List<RefFailureClassification> refFailureClassificationList = new ArrayList<>();
+ refFailureClassificationList.add(refFailureClassification1);
+ refFailureClassificationList.add(refFailureClassification2);
+
+ return refFailureClassificationList;
+ }
+
+ public static StatusDto mockStatusDto() {
+ StatusDto statusDto = new StatusDto();
+ statusDto.setUuid(UUID.fromString("51d4327c-594b-11ea-82b4-0242ac130003"));
+ statusDto.setStatus("neu");
+ statusDto.setExternal(true);
+ statusDto.setInternal(true);
+ return statusDto;
+ }
+
+ public static List<StatusDto> mockStatusDtoList() {
+ List<StatusDto> statusDtoList = new ArrayList<>();
+
+ StatusDto statusDto1 = mockStatusDto();
+ StatusDto statusDto2 = new StatusDto();
+ statusDto2.setUuid(UUID.fromString("51d3c6d4-594b-11ea-8e2d-0242ac130003"));
+ statusDto2.setStatus("aktiv");
+ statusDto2.setExternal(false);
+ statusDto2.setInternal(true);
+
+ statusDtoList.add(statusDto1);
+ statusDtoList.add(statusDto2);
+
+ return statusDtoList;
+ }
+
+ public static RefStatus mockRefStatus() {
+ RefStatus refStatus = new RefStatus();
+ refStatus.setUuid(UUID.fromString("119fe7ae-594e-11ea-82b4-0242ac130003"));
+ refStatus.setStatus("bestätigt");
+ refStatus.setExternal(true);
+ refStatus.setInternal(true);
+ return refStatus;
+ }
+
+ public static List<RefStatus> mockRefStatusList() {
+ List<RefStatus> refStatusList = new ArrayList<>();
+
+ RefStatus refStatus1 = mockRefStatus();
+ RefStatus refStatus2 = new RefStatus();
+ refStatus2.setUuid(UUID.fromString("113814c2-594e-11ea-8e2d-0242ac130003"));
+ refStatus2.setStatus("geschlossen");
+ refStatus2.setExternal(true);
+ refStatus2.setInternal(true);
+
+ refStatusList.add(refStatus1);
+ refStatusList.add(refStatus2);
+
+ return refStatusList;
+ }
+*/
public static FailureTypeDto mockFailureTypeDto() {
FailureTypeDto failureTypeDto1 = new FailureTypeDto();
@@ -190,7 +362,7 @@
return failureTypeDto2;
}
-
+/*
public static List<FailureTypeDto> mockFailureTypeDtoList() {
FailureTypeDto failureTypeDto1 = mockFailureTypeDto();
FailureTypeDto failureTypeDto2 = mockFailureTypeDto2();
@@ -201,7 +373,7 @@
return failureTypeDtoList;
}
-
+*/
public static RefFailureType mockRefFailureType() {
RefFailureType refFailureType1 = new RefFailureType();