diff options
Diffstat (limited to 'netconfsimulator')
5 files changed, 17 insertions, 15 deletions
diff --git a/netconfsimulator/src/main/java/org/onap/netconfsimulator/Main.java b/netconfsimulator/src/main/java/org/onap/netconfsimulator/Main.java index e2a0ed0..1065e71 100644 --- a/netconfsimulator/src/main/java/org/onap/netconfsimulator/Main.java +++ b/netconfsimulator/src/main/java/org/onap/netconfsimulator/Main.java @@ -25,7 +25,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Main { - public static void main(String[] args) { + // We are excluding this line in Sonar due to fact that + // Spring is handling arguments + public static void main(String[] args) { // NOSONAR SpringApplication.run(Main.class, args); } } diff --git a/netconfsimulator/src/main/java/org/onap/netconfsimulator/kafka/listener/KafkaListenerEntry.java b/netconfsimulator/src/main/java/org/onap/netconfsimulator/kafka/listener/KafkaListenerEntry.java index e3c04c9..501d36b 100644 --- a/netconfsimulator/src/main/java/org/onap/netconfsimulator/kafka/listener/KafkaListenerEntry.java +++ b/netconfsimulator/src/main/java/org/onap/netconfsimulator/kafka/listener/KafkaListenerEntry.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -27,9 +27,9 @@ import org.springframework.kafka.listener.AbstractMessageListenerContainer; public class KafkaListenerEntry { private String clientId; - private AbstractMessageListenerContainer listenerContainer; + private AbstractMessageListenerContainer<String, String> listenerContainer; - public KafkaListenerEntry(String clientId, AbstractMessageListenerContainer listenerContainer) { + public KafkaListenerEntry(String clientId, AbstractMessageListenerContainer<String, String> listenerContainer) { this.clientId = clientId; this.listenerContainer = listenerContainer; } diff --git a/netconfsimulator/src/main/java/org/onap/netconfsimulator/netconfcore/configuration/NetconfConfigurationService.java b/netconfsimulator/src/main/java/org/onap/netconfsimulator/netconfcore/configuration/NetconfConfigurationService.java index 248aec4..8f6f0ba 100644 --- a/netconfsimulator/src/main/java/org/onap/netconfsimulator/netconfcore/configuration/NetconfConfigurationService.java +++ b/netconfsimulator/src/main/java/org/onap/netconfsimulator/netconfcore/configuration/NetconfConfigurationService.java @@ -64,8 +64,8 @@ public class NetconfConfigurationService { public String editCurrentConfiguration(MultipartFile newConfiguration) throws IOException, JNCException { Element configurationElement = convertMultipartToXmlElement(newConfiguration); configurationEditor.editConfig(configurationElement); - - LOGGER.debug("Loading new configuration: \n{}", configurationElement.toXMLString()); + String configurationXmlString = configurationElement.toXMLString(); + LOGGER.debug("Loading new configuration: \n{}", configurationXmlString); return CONFIGURATION_HAS_BEEN_ACTIVATED; } diff --git a/netconfsimulator/src/main/java/org/onap/netconfsimulator/websocket/NetconfEndpoint.java b/netconfsimulator/src/main/java/org/onap/netconfsimulator/websocket/NetconfEndpoint.java index 5870ee1..5719214 100644 --- a/netconfsimulator/src/main/java/org/onap/netconfsimulator/websocket/NetconfEndpoint.java +++ b/netconfsimulator/src/main/java/org/onap/netconfsimulator/websocket/NetconfEndpoint.java @@ -84,11 +84,11 @@ class NetconfEndpoint extends Endpoint { private void addKafkaListener(RemoteEndpoint.Basic remoteEndpoint) { - MessageListener messageListener = new NetconfMessageListener(remoteEndpoint); + MessageListener<String, String> messageListener = new NetconfMessageListener(remoteEndpoint); KafkaListenerEntry kafkaListener = kafkaListenerHandler.createKafkaListener(messageListener, TOPIC_NAME); - AbstractMessageListenerContainer listenerContainer = kafkaListener.getListenerContainer(); + AbstractMessageListenerContainer<String,String> listenerContainer = kafkaListener.getListenerContainer(); listenerContainer.start(); entry = Optional.of(kafkaListener); } diff --git a/netconfsimulator/src/test/java/org/onap/netconfsimulator/websocket/NetconfEndpointTest.java b/netconfsimulator/src/test/java/org/onap/netconfsimulator/websocket/NetconfEndpointTest.java index c1484d4..e0bffc1 100644 --- a/netconfsimulator/src/test/java/org/onap/netconfsimulator/websocket/NetconfEndpointTest.java +++ b/netconfsimulator/src/test/java/org/onap/netconfsimulator/websocket/NetconfEndpointTest.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -74,7 +74,7 @@ class NetconfEndpointTest { @Test void shouldCreateKafkaListenerWhenClientInitializeConnection() { NetconfEndpoint netconfEndpoint = new NetconfEndpoint(kafkaListenerHandler); - AbstractMessageListenerContainer abstractMessageListenerContainer = getListenerContainer(); + AbstractMessageListenerContainer<String, String> abstractMessageListenerContainer = getListenerContainer(); when(session.getBasicRemote()).thenReturn(remoteEndpoint); KafkaListenerEntry kafkaListenerEntry = new KafkaListenerEntry("sampleGroupId", abstractMessageListenerContainer); @@ -93,7 +93,7 @@ class NetconfEndpointTest { @Test void shouldCloseListenerWhenClientDisconnects() { NetconfEndpoint netconfEndpoint = new NetconfEndpoint(kafkaListenerHandler); - AbstractMessageListenerContainer abstractMessageListenerContainer = getListenerContainer(); + AbstractMessageListenerContainer<String, String> abstractMessageListenerContainer = getListenerContainer(); netconfEndpoint.setEntry( Optional.of(new KafkaListenerEntry("sampleGroupId", abstractMessageListenerContainer)) ); netconfEndpoint.onClose(session, mock(CloseReason.class)); @@ -101,7 +101,7 @@ class NetconfEndpointTest { verify(abstractMessageListenerContainer).stop(); } - class TestAbstractMessageListenerContainer extends AbstractMessageListenerContainer { + class TestAbstractMessageListenerContainer extends AbstractMessageListenerContainer<String,String> { TestAbstractMessageListenerContainer(ContainerProperties containerProperties) { @@ -124,7 +124,7 @@ class NetconfEndpointTest { } } - private AbstractMessageListenerContainer getListenerContainer() { + private AbstractMessageListenerContainer<String, String> getListenerContainer() { ContainerProperties containerProperties = new ContainerProperties("config"); containerProperties.setGroupId("sample"); containerProperties.setMessageListener(mock(GenericMessageListener.class)); |