diff options
author | jhh <jorge.hernandez-herrero@att.com> | 2020-01-07 12:09:47 -0600 |
---|---|---|
committer | jhh <jorge.hernandez-herrero@att.com> | 2020-01-07 15:22:50 -0600 |
commit | 38919c45aafa99d950eddf879b2bc25e95529378 (patch) | |
tree | f83af51e2c90cefeae5358e3cadc6171430a16e7 /feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java | |
parent | 4112fecf3d65f1d5dd1eb99334061b2b17c6ad43 (diff) |
Remove supported policy types from status message
Issue-ID: POLICY-2233
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I2168b9616d35ee3b9aa491aaa5d363b8609adb84
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java')
-rw-r--r-- | feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java index bb8e4940..2a258305 100644 --- a/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java +++ b/feature-lifecycle/src/test/java/org/onap/policy/drools/lifecycle/LifecycleStateActiveTest.java @@ -1,6 +1,6 @@ /* * ============LICENSE_START======================================================= - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; import org.junit.Before; import org.junit.Test; @@ -44,7 +43,6 @@ import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.models.pdp.concepts.PdpStateChange; import org.onap.policy.models.pdp.concepts.PdpStatus; import org.onap.policy.models.pdp.concepts.PdpUpdate; -import org.onap.policy.models.pdp.enums.PdpMessageType; import org.onap.policy.models.pdp.enums.PdpState; import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy; @@ -127,28 +125,19 @@ public class LifecycleStateActiveTest extends LifecycleStateRunningTest { assertTrue(fsm.statusTask.isDone()); } - private Callable<Boolean> isStatus(PdpState state) { - return () -> { - if (fsm.client.getSink().getRecentEvents().length == 0) { - return false; - } - - List<String> events = Arrays.asList(fsm.client.getSink().getRecentEvents()); - PdpStatus status = - new StandardCoder().decode(events.get(events.size() - 1), PdpStatus.class); - - return status.getMessageName() == PdpMessageType.PDP_STATUS && state == status.getState(); - }; - } - @Test public void status() { waitUntil(fsm.getStatusTimerSeconds() + 1, TimeUnit.SECONDS, isStatus(PdpState.ACTIVE)); int preCount = fsm.client.getSink().getRecentEvents().length; assertTrue(fsm.status()); + assertEquals(preCount, fsm.client.getSink().getRecentEvents().length); + + fsm.start(controllerSupport.getController()); + assertTrue(fsm.status()); assertEquals(preCount + 1, fsm.client.getSink().getRecentEvents().length); + fsm.stop(controllerSupport.getController()); fsm.shutdown(); } |