diff options
author | liamfallon <liam.fallon@ericsson.com> | 2018-01-28 22:24:23 +0000 |
---|---|---|
committer | liamfallon <liam.fallon@ericsson.com> | 2018-01-30 17:10:41 +0000 |
commit | d896f94cecc28b5a91cd423ba62ee096dc0fac60 (patch) | |
tree | 9ca95d120d45959d1913a3c5bf179b4e71b1f46c /controlloop/common/actors/actorServiceProvider | |
parent | e285764b0eddab0d4195128f55a9f524beee3f05 (diff) |
Fix technical debt/JUnit on actor service provider
Unit test for actor service provider added and technical debt removed.
Change-Id: I9573f1c3ff0252b166e06caaa88eb679a1fc7347
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Issue-ID: POLICY-455
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
Diffstat (limited to 'controlloop/common/actors/actorServiceProvider')
3 files changed, 20 insertions, 10 deletions
diff --git a/controlloop/common/actors/actorServiceProvider/pom.xml b/controlloop/common/actors/actorServiceProvider/pom.xml index 494254bc9..05f486e0d 100644 --- a/controlloop/common/actors/actorServiceProvider/pom.xml +++ b/controlloop/common/actors/actorServiceProvider/pom.xml @@ -1,12 +1,20 @@ <?xml version="1.0"?> -<project - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" - xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> - <groupId>org.onap.policy.drools-applications</groupId> + <groupId>org.onap.policy.drools-applications</groupId> <artifactId>actors</artifactId> <version>1.2.0-SNAPSHOT</version> </parent> <artifactId>actorServiceProvider</artifactId> + + <dependencies> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>4.12</version> + <scope>test</scope> + </dependency> + </dependencies> </project> diff --git a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java index 330b1f97c..45bb9f265 100644 --- a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java +++ b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/ActorService.java @@ -18,12 +18,12 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.controlloop.actorServiceProvider; +package org.onap.policy.controlloop.actorserviceprovider; import java.util.Iterator; import java.util.ServiceLoader; -import org.onap.policy.controlloop.actorServiceProvider.spi.Actor; +import org.onap.policy.controlloop.actorserviceprovider.spi.Actor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableList; @@ -32,7 +32,8 @@ public class ActorService { private static final Logger logger = LoggerFactory.getLogger(ActorService.class); private static ActorService service; - + + // USed to load actors private ServiceLoader<Actor> loader; private ActorService() { @@ -50,10 +51,11 @@ public class ActorService { Iterator<Actor> iter = loader.iterator(); logger.debug("returning actors"); while (iter.hasNext()) { - logger.debug("Got {}", iter.next().actor()); + if (logger.isDebugEnabled()) { + logger.debug("Got {}", iter.next().actor()); + } } return ImmutableList.copyOf(loader.iterator()); } - } diff --git a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/spi/Actor.java b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/spi/Actor.java index 2492063c8..b8e310d61 100644 --- a/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/spi/Actor.java +++ b/controlloop/common/actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorServiceProvider/spi/Actor.java @@ -18,7 +18,7 @@ * ============LICENSE_END========================================================= */ -package org.onap.policy.controlloop.actorServiceProvider.spi; +package org.onap.policy.controlloop.actorserviceprovider.spi; import java.util.List; |