Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix Sonar and CheckStyle warnings
[nonrtric.git]
/
policy-agent
/
src
/
test
/
java
/
org
/
oransc
/
policyagent
/
tasks
/
RicSupervisionTest.java
diff --git
a/policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSupervisionTest.java
b/policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSupervisionTest.java
index
0a5b27b
..
73ca351
100644
(file)
--- a/
policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSupervisionTest.java
+++ b/
policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSupervisionTest.java
@@
-104,7
+104,6
@@
public class RicSupervisionTest {
@BeforeEach
public void init() {
@BeforeEach
public void init() {
- doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
types.clear();
policies.clear();
rics.clear();
types.clear();
policies.clear();
rics.clear();
@@
-123,6
+122,7
@@
public class RicSupervisionTest {
@Test
public void whenRicIdleAndNoChangedPoliciesOrPolicyTypes_thenNoSynchronization() {
@Test
public void whenRicIdleAndNoChangedPoliciesOrPolicyTypes_thenNoSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
@@
-144,6
+144,7
@@
public class RicSupervisionTest {
@Test
public void whenRicUndefined_thenSynchronization() {
@Test
public void whenRicUndefined_thenSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.UNAVAILABLE);
rics.put(RIC_1);
RIC_1.setState(RicState.UNAVAILABLE);
rics.put(RIC_1);
@@
-161,6
+162,7
@@
public class RicSupervisionTest {
@Test
public void whenRicSynchronizing_thenNoSynchronization() {
@Test
public void whenRicSynchronizing_thenNoSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.SYNCHRONIZING);
rics.put(RIC_1);
RIC_1.setState(RicState.SYNCHRONIZING);
rics.put(RIC_1);
@@
-174,6
+176,7
@@
public class RicSupervisionTest {
@Test
public void whenRicIdleAndErrorGettingPolicyIdentities_thenNoSynchronization() {
@Test
public void whenRicIdleAndErrorGettingPolicyIdentities_thenNoSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
@@
-185,10
+188,12
@@
public class RicSupervisionTest {
verify(supervisorUnderTest).checkAllRics();
verifyNoMoreInteractions(supervisorUnderTest);
verify(supervisorUnderTest).checkAllRics();
verifyNoMoreInteractions(supervisorUnderTest);
+ assertThat(RIC_1.getState()).isEqualTo(RicState.UNAVAILABLE);
}
@Test
public void whenRicIdleAndNotSameAmountOfPolicies_thenSynchronization() {
}
@Test
public void whenRicIdleAndNotSameAmountOfPolicies_thenSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.AVAILABLE);
rics.put(RIC_1);
RIC_1.setState(RicState.AVAILABLE);
rics.put(RIC_1);
@@
-211,6
+216,7
@@
public class RicSupervisionTest {
@Test
public void whenRicIdleAndSameAmountOfPoliciesButNotSamePolicies_thenSynchronization() {
@Test
public void whenRicIdleAndSameAmountOfPoliciesButNotSamePolicies_thenSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.AVAILABLE);
rics.put(RIC_1);
RIC_1.setState(RicState.AVAILABLE);
rics.put(RIC_1);
@@
-233,6
+239,7
@@
public class RicSupervisionTest {
@Test
public void whenRicIdleAndErrorGettingPolicyTypes_thenNoSynchronization() {
@Test
public void whenRicIdleAndErrorGettingPolicyTypes_thenNoSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
@@
-249,6
+256,7
@@
public class RicSupervisionTest {
@Test
public void whenRicIdleAndNotSameAmountOfPolicyTypes_thenSynchronization() {
@Test
public void whenRicIdleAndNotSameAmountOfPolicyTypes_thenSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
RIC_1.setState(RicState.AVAILABLE);
RIC_1.addSupportedPolicyType(POLICY_TYPE_1);
rics.put(RIC_1);
@@
-272,6
+280,7
@@
public class RicSupervisionTest {
@Test
public void whenRicIdleAndSameAmountOfPolicyTypesButNotSameTypes_thenSynchronization() {
@Test
public void whenRicIdleAndSameAmountOfPolicyTypesButNotSameTypes_thenSynchronization() {
+ doReturn(Mono.just(a1ClientMock)).when(a1ClientFactory).createA1Client(any(Ric.class));
PolicyType policyType2 = ImmutablePolicyType.builder() //
.name("policyType2") //
.schema("") //
PolicyType policyType2 = ImmutablePolicyType.builder() //
.name("policyType2") //
.schema("") //