Merge branch 'DEVELOP' of ssh://git.eclipse.org:29418/openk-usermodules/org.eclipse.openk-usermodules.gridFailureInformation.backend into DEVELOP
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 340f022..38dd75c 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
@@ -28,6 +28,11 @@
public class AddressImportService {
public static final String DURATION = "Duration: ";
+
+ protected interface LineConsumer {
+ void accept( String[] line, AddressDto targetDto);
+ }
+
@Autowired
private AddressService addressService;
@@ -146,16 +151,7 @@
}
private void storeAddress(boolean isTableClean, String[] line) {
- AddressDto addressDto = new AddressDto();
- // !!! Parsing BigDecimal anpassen, locale
- addressDto.setSdox1(new BigDecimal(line[0].replace(",", ".")));
- addressDto.setSdoy1(new BigDecimal(line[1].replace(",", ".")));
- addressDto.setG3efid(Long.parseLong(line[2]));
- addressDto.setPostcode(line[3]);
- addressDto.setCommunity(line[4]);
- addressDto.setDistrict(line[5]);
- addressDto.setStreet(line[6]);
- addressDto.setHousenumber(line[7]);
+ AddressDto addressDto = addressFromLine(line);
List<BigDecimal> decimals = converter.convertUTMToDeg(addressDto.getSdox1().doubleValue(), addressDto.getSdoy1().doubleValue());
addressDto.setLongitude(decimals.get(0));
@@ -173,6 +169,16 @@
Instant start = Instant.now();
String csvFile = filePowerConnections;
+ parseFile(csvFile, (line, addressDto) -> {
+ addressDto.setPowerConnection(true);
+ addressDto.setStationId(line[8]);
+ });
+
+ Instant end = Instant.now();
+ log.info(DURATION + Duration.between(start, end));
+ }
+
+ private void parseFile(String csvFile, LineConsumer action) {
CSVReader reader = null;
try {final CSVParser parser = new CSVParserBuilder()
.withSeparator(';')
@@ -184,18 +190,8 @@
.build();
String[]line;
while ((line = reader.readNext()) != null) {
- AddressDto addressDto = new AddressDto();
- // !!! Parsing BigDecimal anpassen, locale???
- addressDto.setSdox1(new BigDecimal(line[0].replace(",", ".")));
- addressDto.setSdoy1(new BigDecimal(line[1].replace(",", ".")));
- addressDto.setG3efid(Long.parseLong(line[2]));
- addressDto.setPostcode(line[3]);
- addressDto.setCommunity(line[4]);
- addressDto.setDistrict(line[5]);
- addressDto.setStreet(line[6]);
- addressDto.setHousenumber(line[7]);
- addressDto.setPowerConnection(true);
- addressDto.setStationId(line[8]);
+ AddressDto addressDto = addressFromLine(line);
+ action.accept(line, addressDto);
List<BigDecimal> decimals = converter.convertUTMToDeg( addressDto.getSdox1().doubleValue(), addressDto.getSdoy1().doubleValue());
addressDto.setLongitude(decimals.get(0));
@@ -206,8 +202,20 @@
} catch (IOException | CsvValidationException | NumberFormatException e) {
log.error(e);
}
- Instant end = Instant.now();
- log.info(DURATION + Duration.between(start, end));
+ }
+
+ private AddressDto addressFromLine(String[] line) {
+ AddressDto addressDto = new AddressDto();
+ // !!! Parsing BigDecimal anpassen, locale???
+ addressDto.setSdox1(new BigDecimal(line[0].replace(",", ".")));
+ addressDto.setSdoy1(new BigDecimal(line[1].replace(",", ".")));
+ addressDto.setG3efid(Long.parseLong(line[2]));
+ addressDto.setPostcode(line[3]);
+ addressDto.setCommunity(line[4]);
+ addressDto.setDistrict(line[5]);
+ addressDto.setStreet(line[6]);
+ addressDto.setHousenumber(line[7]);
+ return addressDto;
}
@@ -215,39 +223,10 @@
Instant start = Instant.now();
String csvFile = fileWaterConnections;
- CSVReader reader = null;
- String[]line;
- try {final CSVParser parser = new CSVParserBuilder()
- .withSeparator(';')
- .withIgnoreQuotations(true)
- .build();
- reader = new CSVReaderBuilder(new FileReader(csvFile))
- .withSkipLines(1)
- .withCSVParser(parser)
- .build();
- while ((line = reader.readNext()) != null) {
- AddressDto addressDto = new AddressDto();
- // !!! Parsing BigDecimal anpassen, locale???
- addressDto.setSdox1(new BigDecimal(line[0].replace(",", ".")));
- addressDto.setSdoy1(new BigDecimal(line[1].replace(",", ".")));
- addressDto.setG3efid(Long.parseLong(line[2]));
- addressDto.setPostcode(line[3]);
- addressDto.setCommunity(line[4]);
- addressDto.setDistrict(line[5]);
- addressDto.setStreet(line[6]);
- addressDto.setHousenumber(line[7]);
- addressDto.setWaterConnection(true);
- addressDto.setWaterGroup(line[8]);
-
- List<BigDecimal> decimals = converter.convertUTMToDeg( addressDto.getSdox1().doubleValue(), addressDto.getSdoy1().doubleValue());
- addressDto.setLongitude(decimals.get(0));
- addressDto.setLatitude(decimals.get(1));
-
- addressService.updateOrInsertAddressByG3efid(addressDto);
- }
- } catch (IOException | CsvValidationException | NumberFormatException e) {
- log.error(e);
- }
+ parseFile(csvFile, (line, addressDto) -> {
+ addressDto.setWaterConnection(true);
+ addressDto.setWaterGroup(line[8]);
+ });
Instant end = Instant.now();
log.info(DURATION + Duration.between(start, end));
}
@@ -256,39 +235,11 @@
Instant start = Instant.now();
String csvFile = fileGasConnections;
- CSVReader reader = null;
- try {final CSVParser parser = new CSVParserBuilder()
- .withSeparator(';')
- .withIgnoreQuotations(true)
- .build();
- reader = new CSVReaderBuilder(new FileReader(csvFile))
- .withSkipLines(1)
- .withCSVParser(parser)
- .build();
- String[]line;
- while ((line = reader.readNext()) != null) {
- AddressDto addressDto = new AddressDto();
- // !!! Parsing BigDecimal anpassen, locale???
- addressDto.setSdox1(new BigDecimal(line[0].replace(",", ".")));
- addressDto.setSdoy1(new BigDecimal(line[1].replace(",", ".")));
- addressDto.setG3efid(Long.parseLong(line[2]));
- addressDto.setPostcode(line[3]);
- addressDto.setCommunity(line[4]);
- addressDto.setDistrict(line[5]);
- addressDto.setStreet(line[6]);
- addressDto.setHousenumber(line[7]);
- addressDto.setGasConnection(true);
- addressDto.setGasGroup(line[8]);
+ parseFile(csvFile, (line, addressDto) -> {
+ addressDto.setGasConnection(true);
+ addressDto.setGasGroup(line[8]);
+ });
- List<BigDecimal> decimals = converter.convertUTMToDeg(addressDto.getSdox1().doubleValue(), addressDto.getSdoy1().doubleValue());
- addressDto.setLongitude(decimals.get(0));
- addressDto.setLatitude(decimals.get(1));
-
- addressService.updateOrInsertAddressByG3efid(addressDto);
- }
- } catch (IOException | CsvValidationException | NumberFormatException e) {
- log.error(e);
- }
Instant end = Instant.now();
log.info(DURATION + Duration.between(start, end));
}
@@ -297,38 +248,8 @@
Instant start = Instant.now();
String csvFile = fileDistrictheatingConnections;
- CSVReader reader = null;
- try {final CSVParser parser = new CSVParserBuilder()
- .withSeparator(';')
- .withIgnoreQuotations(true)
- .build();
- reader = new CSVReaderBuilder(new FileReader(csvFile))
- .withSkipLines(1)
- .withCSVParser(parser)
- .build();
- String[]line;
- while ((line = reader.readNext()) != null) {
- AddressDto addressDto = new AddressDto();
- // !!! Parsing BigDecimal anpassen, locale???
- addressDto.setSdox1(new BigDecimal(line[0].replace(",", ".")));
- addressDto.setSdoy1(new BigDecimal(line[1].replace(",", ".")));
- addressDto.setG3efid(Long.parseLong(line[2]));
- addressDto.setPostcode(line[3]);
- addressDto.setCommunity(line[4]);
- addressDto.setDistrict(line[5]);
- addressDto.setStreet(line[6]);
- addressDto.setHousenumber(line[7]);
- addressDto.setDistrictheatingConnection(true);
+ parseFile(csvFile, (line, addressDto) -> addressDto.setDistrictheatingConnection(true));
- List<BigDecimal> decimals = converter.convertUTMToDeg(addressDto.getSdox1().doubleValue(), addressDto.getSdoy1().doubleValue());
- addressDto.setLongitude(decimals.get(0));
- addressDto.setLatitude(decimals.get(1));
-
- addressService.updateOrInsertAddressByG3efid(addressDto);
- }
- } catch (IOException | CsvValidationException | NumberFormatException e) {
- log.error(e);
- }
Instant end = Instant.now();
log.info(DURATION + Duration.between(start, end));
}
@@ -337,38 +258,8 @@
Instant start = Instant.now();
String csvFile = fileTelecommunicationConnections;
- CSVReader reader = null;
- try {final CSVParser parser = new CSVParserBuilder()
- .withSeparator(';')
- .withIgnoreQuotations(true)
- .build();
- reader = new CSVReaderBuilder(new FileReader(csvFile))
- .withSkipLines(1)
- .withCSVParser(parser)
- .build();
- String[]line;
- while ((line = reader.readNext()) != null) {
- AddressDto addressDto = new AddressDto();
- // !!! Parsing BigDecimal anpassen, locale???
- addressDto.setSdox1(new BigDecimal(line[0].replace(",", ".")));
- addressDto.setSdoy1(new BigDecimal(line[1].replace(",", ".")));
- addressDto.setG3efid(Long.parseLong(line[2]));
- addressDto.setPostcode(line[3]);
- addressDto.setCommunity(line[4]);
- addressDto.setDistrict(line[5]);
- addressDto.setStreet(line[6]);
- addressDto.setHousenumber(line[7]);
- addressDto.setTelecommConnection(true);
+ parseFile(csvFile, (line, addressDto) -> addressDto.setTelecommConnection(true));
- List<BigDecimal> decimals = converter.convertUTMToDeg(addressDto.getSdox1().doubleValue(), addressDto.getSdoy1().doubleValue());
- addressDto.setLongitude(decimals.get(0));
- addressDto.setLatitude(decimals.get(1));
-
- addressService.updateOrInsertAddressByG3efid(addressDto);
- }
- } catch (IOException | CsvValidationException | NumberFormatException e) {
- log.error(e);
- }
Instant end = Instant.now();
log.info(DURATION + Duration.between(start, end));
}
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/api/SitCacheApi.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/api/SitCacheApi.java
new file mode 100644
index 0000000..0dc8d46
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/api/SitCacheApi.java
@@ -0,0 +1,32 @@
+/*
+ *******************************************************************************
+ * 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.viewmodel.FailureInformationDto;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+
+import java.util.List;
+
+@FeignClient(name = "${services.sitCache.name}")
+public interface SitCacheApi {
+
+ @PostMapping("/public-sit")
+ public void postPublicFailureInfos(
+ @RequestBody List<FailureInformationDto> failureInfoToPublish);
+
+}
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
new file mode 100644
index 0000000..a0051a5
--- /dev/null
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/config/DmzExportSchedulerConfig.java
@@ -0,0 +1,38 @@
+package org.eclipse.openk.gridfailureinformation.config;
+
+import lombok.extern.log4j.Log4j2;
+import org.eclipse.openk.gridfailureinformation.service.ExportService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.scheduling.annotation.Scheduled;
+
+@Log4j2
+@Configuration
+@EnableScheduling
+@ConditionalOnProperty(prefix = "export-to-dmz", name = "enabled", havingValue = "true", matchIfMissing = false)
+public class DmzExportSchedulerConfig {
+
+ private static final String SCHEDULER_NAME = "DmzExport-Scheduler";
+
+ @Autowired
+ ExportService exportService;
+
+ @Value("${export-to-dmz.cron}")
+ private String cronExpression;
+
+ @Bean
+ public void logConfigLDmzExport() {
+
+ }
+
+ @Scheduled(cron = "${export-to-dmz.cron}")
+ public void scheduleTaskDmzExport() {
+ log.info("Executing" + SCHEDULER_NAME + " task: Exporting FailureInformations with Status 'published' to DMZ" );
+ exportService.exportFailureInformationsToDMZ();
+ log.info("Finished " + SCHEDULER_NAME + " task: Exporting FailureInformations with Status 'published' to DMZ");
+ }
+}
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 a365849..1d9872b 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
@@ -40,6 +40,7 @@
public static final String W = "W";
public static final String G = "G";
public static final String S = "S";
+ public static final String CHANNEL_NOT_EXISTING = "channel.not.existing";
private Constants() {
// empty Constructor for the sake of SONAR
diff --git a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationRepository.java b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationRepository.java
index a18eede..bfbb4e3 100644
--- a/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationRepository.java
+++ b/gfsBackendService/src/main/java/org/eclipse/openk/gridfailureinformation/repository/FailureInformationRepository.java
@@ -35,6 +35,8 @@
List<TblFailureInformation> findByUuidIn(List<UUID> uuidList);
+ List<TblFailureInformation> findByPublicationStatus(String publicationStatus);
+
Optional<TblFailureInformation> findByObjectReferenceExternalSystem(String extRef );
@Query("select fi from TblFailureInformation fi where fi.tblFailureInformationCondensed.uuid = :uuid")
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 7c68a89..67d965a 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
@@ -2,11 +2,13 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.log4j.Log4j2;
+import org.eclipse.openk.gridfailureinformation.api.SitCacheApi;
import org.eclipse.openk.gridfailureinformation.bpmn.impl.tasks.ProcessHelper;
import org.eclipse.openk.gridfailureinformation.config.ResourceConfig;
import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqChannel;
import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqConfig;
import org.eclipse.openk.gridfailureinformation.config.rabbitMq.RabbitMqProperties;
+import org.eclipse.openk.gridfailureinformation.constants.Constants;
import org.eclipse.openk.gridfailureinformation.exceptions.InternalServerErrorException;
import org.eclipse.openk.gridfailureinformation.exceptions.NotFoundException;
import org.eclipse.openk.gridfailureinformation.mapper.FailureInformationMapper;
@@ -76,7 +78,10 @@
private ResourceConfig resourceConfig;
@Autowired
- AuthNAuthService authNAuthService;
+ private AuthNAuthService authNAuthService;
+
+ @Autowired
+ private SitCacheApi sitCacheApi;
private static final String SUBJECT_DATE_PATTERN_APPLIED = "EEEE', den' dd.MM.yy 'um' HH:mm:ss";
protected Map<String,String> contentReplaceMap;
@@ -92,7 +97,7 @@
RabbitMqChannel rChannel = getAvailableRabbitMqChannel(targetChannel);
if(getAvailableRabbitMqChannel(targetChannel) == null){
- log.warn("channel.not.existing");
+ log.warn(Constants.CHANNEL_NOT_EXISTING);
continue;
}
@@ -116,11 +121,10 @@
return false;
}
- for (TblDistributionGroup distributionGroup : distributionGroups) {
- prepareMessage(existingTblFailureInfo, distributionGroup, rChannel);
- }
+ distributionGroups.forEach( x -> prepareMessage(existingTblFailureInfo, x, rChannel));
- } else {
+ }
+ else {
//Veröffentlichung/Sende nur einmal (Bsp. Störungsauskunft.de)
RabbitMqMessageDto rabbitMqMessageDto = new RabbitMqMessageDto();
FailureInformationDto failureInformationDto = failureInformationService.enrichFailureInfo(failureInformationMapper.toFailureInformationDto(existingTblFailureInfo));
@@ -131,7 +135,6 @@
// mark channel as published
markChannelAsPublished(targetChannel, existingTblFailureInfo);
-
}
}
@@ -146,8 +149,8 @@
RabbitMqChannel rChannel = getAvailableRabbitMqChannel(targetChannel);
if(getAvailableRabbitMqChannel(targetChannel) == null){
- log.warn("channel.not.existing");
- throw new NotFoundException("channel.not.existing");
+ log.warn(Constants.CHANNEL_NOT_EXISTING);
+ throw new NotFoundException(Constants.CHANNEL_NOT_EXISTING);
}
rabbitMqConfig.checkExchangeAndQueueOnRabbitMq(rChannel.getExportQueue(), rChannel.getExportKey());
@@ -169,6 +172,25 @@
return true;
}
+ public void exportFailureInformationsToDMZ(){
+
+ // Holen der in die DMZ zu exportierenden FailureInfos
+ List<TblFailureInformation> tblFailureInfosVeroeffentlicht = failureInformationRepository
+ .findByPublicationStatus(Constants.PUB_STATUS_VEROEFFENTLICHT);
+
+ List<FailureInformationDto> failureInfoDtossVeroeffentlicht = tblFailureInfosVeroeffentlicht.stream()
+ .map( failureInformationMapper::toFailureInformationDto )
+ .collect(Collectors.toList());
+
+ // wohin damit? Frontend-Service, an den die Störungsinformationen geposted werden fehlt noch
+ try{
+ sitCacheApi.postPublicFailureInfos(failureInfoDtossVeroeffentlicht);
+ }
+ catch(Exception e){
+ log.error("error.exporting.published.failure.infos", e);
+ }
+ }
+
private boolean isChannelAlreadyPublished(String targetChannel, TblFailureInformation existingTblFailureInfo) {
List<TblFailureInformationPublicationChannel> publicationChannelList = publicationChannelRepository.findByTblFailureInformation(existingTblFailureInfo);
diff --git a/gfsBackendService/src/main/resources/application.yml b/gfsBackendService/src/main/resources/application.yml
index 43020f3..5ff8f0e 100644
--- a/gfsBackendService/src/main/resources/application.yml
+++ b/gfsBackendService/src/main/resources/application.yml
@@ -77,6 +77,8 @@
mobile: Mobil
useModuleNameForFilter: false
moduleName: Störungsinformationstool
+ sitCache:
+ name: sitCacheService
portalFeLoginURL: http://entopkon:8880/portalFE/#/login
portalFeModulename: SIT DEV
@@ -88,6 +90,10 @@
ribbon:
listOfServers: http://entdockergss:9155
+sitCacheService:
+ ribbon:
+ listOfServers: http://entdockergss:3003
+
feign:
client:
config:
@@ -109,6 +115,10 @@
distribution-group-publisher:
name: Veröffentlicher
distribution-text: Bitte anpassen
+
+export-to-dmz:
+ enabled: true
+ cron: 0 */1 * ? * *
---
spring:
@@ -208,6 +218,10 @@
cors:
corsEnabled: true
+
+export-to-dmz:
+ enabled: false
+
---
spring:
@@ -310,6 +324,8 @@
name: contactService
communicationType:
mobile: Mobil
+ sitCache:
+ name: sitCacheService
authNAuthService:
ribbon:
@@ -319,6 +335,10 @@
ribbon:
listOfServers: http://localhost:9155
+sitCacheService:
+ ribbon:
+ listOfServers: http://localhost:3003
+
cors:
corsEnabled: true
diff --git a/gfsBackendService/src/main/resources/application_localdev.yml b/gfsBackendService/src/main/resources/application_localdev.yml
index 296a749..1cc1a10 100644
--- a/gfsBackendService/src/main/resources/application_localdev.yml
+++ b/gfsBackendService/src/main/resources/application_localdev.yml
@@ -108,6 +108,10 @@
name: Veröffentlicher
distribution-text: Bitte anpassen
+export-to-dmz:
+ enabled: false
+ cron: 0 */1 * ? * *
+
---
spring:
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 14cb60e..b208ff8 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
@@ -18,6 +18,7 @@
import org.eclipse.openk.gridfailureinformation.GridFailureInformationApplication;
import org.eclipse.openk.gridfailureinformation.api.AuthNAuthApi;
import org.eclipse.openk.gridfailureinformation.api.ContactApi;
+import org.eclipse.openk.gridfailureinformation.api.SitCacheApi;
import org.eclipse.openk.gridfailureinformation.bpmn.base.ProcessException;
import org.eclipse.openk.gridfailureinformation.bpmn.impl.GfiGrid;
import org.eclipse.openk.gridfailureinformation.bpmn.impl.GfiProcessEnvironment;
@@ -30,7 +31,6 @@
import org.eclipse.openk.gridfailureinformation.util.ImportDataValidator;
import org.mockito.Mockito;
import org.springframework.amqp.core.DirectExchange;
-import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
@@ -39,7 +39,6 @@
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.test.context.ConfigFileApplicationContextInitializer;
import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestPropertySource;
@@ -119,6 +118,9 @@
ContactApi contactApi() { return Mockito.mock(ContactApi.class); }
@Bean
+ SitCacheApi sitCacheApi() { return Mockito.mock(SitCacheApi.class); }
+
+ @Bean
VersionMapper versionMapper() { return new VersionMapperImpl(); }
@Bean