package org.onap.policy.controlloop.actor.appc;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
assertTrue(jsonRequest.contains(KEY2));
assertTrue(jsonRequest.contains(SUBKEY));
assertTrue(jsonRequest.contains(SUBVALUE));
+ assertFalse(jsonRequest.contains(SUBVALUE + ".0"));
Response appcResponse = new Response(appcRequest);
appcResponse.getStatus().setCode(ResponseCode.SUCCESS.getValue());
package org.onap.policy.models.sim.pdp;
import java.util.List;
-import java.util.Properties;
import java.util.Random;
import lombok.Getter;
import lombok.Setter;
* Instantiate the activator for onappf PDP-A.
*
* @param pdpSimulatorParameterGroup the parameters for the onappf PDP-A service
- * @param topicProperties properties used to configure the topics
*/
- public PdpSimulatorActivator(final PdpSimulatorParameterGroup pdpSimulatorParameterGroup,
- final Properties topicProperties) {
+ public PdpSimulatorActivator(final PdpSimulatorParameterGroup pdpSimulatorParameterGroup) {
- topicSinks = TopicEndpointManager.getManager().addTopicSinks(topicProperties);
- topicSources = TopicEndpointManager.getManager().addTopicSources(topicProperties);
+ topicSinks = TopicEndpointManager.getManager()
+ .addTopicSinks(pdpSimulatorParameterGroup.getTopicParameterGroup().getTopicSinks());
+ topicSources = TopicEndpointManager.getManager()
+ .addTopicSources(pdpSimulatorParameterGroup.getTopicParameterGroup().getTopicSources());
final int random = RANDOM.nextInt();
final String instanceId = "pdp_" + random;
package org.onap.policy.models.sim.pdp;
import java.util.Arrays;
-import java.util.Properties;
-import org.onap.policy.common.endpoints.utils.ParameterUtils;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.sim.pdp.exception.PdpSimulatorException;
import org.onap.policy.models.sim.pdp.parameters.PdpSimulatorParameterGroup;
return;
}
- // Read the properties
- Properties topicProperties = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup());
-
// create the activator
- activator = new PdpSimulatorActivator(parameterGroup, topicProperties);
+ activator = new PdpSimulatorActivator(parameterGroup);
Registry.register(PdpSimulatorConstants.REG_PDP_SIMULATOR_ACTIVATOR, activator);
// Start the activator
try {
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
-import java.util.Properties;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
-import org.onap.policy.common.endpoints.utils.ParameterUtils;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.sim.pdp.exception.PdpSimulatorException;
new PdpSimulatorCommandLineArguments(pdpSimulatorConfigParameters);
final PdpSimulatorParameterGroup parGroup = new PdpSimulatorParameterHandler().getParameters(arguments);
- final Properties props = ParameterUtils.getTopicProperties(parGroup.getTopicParameterGroup());
- activator = new PdpSimulatorActivator(parGroup, props);
+ activator = new PdpSimulatorActivator(parGroup);
}
/**
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.utils.ParameterUtils;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStateChange;
import org.onap.policy.models.pdp.concepts.PdpStatus;
// Read the parameters
pdpSimulatorParameterGroup = new PdpSimulatorParameterHandler().getParameters(arguments);
- // Read the properties
- final Properties topicProperties =
- ParameterUtils.getTopicProperties(pdpSimulatorParameterGroup.getTopicParameterGroup());
- activator = new PdpSimulatorActivator(pdpSimulatorParameterGroup, topicProperties);
+ activator = new PdpSimulatorActivator(pdpSimulatorParameterGroup);
Registry.register(PdpSimulatorConstants.REG_PDP_SIMULATOR_ACTIVATOR, activator);
activator.initialize();
}
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure;
-import org.onap.policy.common.endpoints.utils.ParameterUtils;
import org.onap.policy.common.utils.services.Registry;
import org.onap.policy.models.pdp.concepts.PdpStatus;
import org.onap.policy.models.pdp.concepts.PdpUpdate;
// Read the parameters
pdpSimulatorParameterGroup = new PdpSimulatorParameterHandler().getParameters(arguments);
- // Read the properties
- final Properties topicProperties =
- ParameterUtils.getTopicProperties(pdpSimulatorParameterGroup.getTopicParameterGroup());
- activator = new PdpSimulatorActivator(pdpSimulatorParameterGroup, topicProperties);
+ activator = new PdpSimulatorActivator(pdpSimulatorParameterGroup);
Registry.register(PdpSimulatorConstants.REG_PDP_SIMULATOR_ACTIVATOR, activator);
activator.initialize();
pdpUpdateMessageListener = new PdpUpdateListener();