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
/
RicSynchronizationTaskTest.java
diff --git
a/policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSynchronizationTaskTest.java
b/policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSynchronizationTaskTest.java
index
eae00ea
..
f6d2ade
100644
(file)
--- a/
policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSynchronizationTaskTest.java
+++ b/
policy-agent/src/test/java/org/oransc/policyagent/tasks/RicSynchronizationTaskTest.java
@@
-77,6
+77,7
@@
public class RicSynchronizationTaskTest {
.name(RIC_1_NAME) //
.baseUrl("baseUrl1") //
.managedElementIds(Collections.emptyList()) //
.name(RIC_1_NAME) //
.baseUrl("baseUrl1") //
.managedElementIds(Collections.emptyList()) //
+ .controllerName("controllerName") //
.build());
private static final Policy POLICY_1 = ImmutablePolicy.builder() //
.build());
private static final Policy POLICY_1 = ImmutablePolicy.builder() //
@@
-107,7
+108,7
@@
public class RicSynchronizationTaskTest {
policyTypes = new PolicyTypes();
policies = new Policies();
services = new Services();
policyTypes = new PolicyTypes();
policies = new Policies();
services = new Services();
- RIC_1.setState(RicState.UN
DEFINED
);
+ RIC_1.setState(RicState.UN
AVAILABLE
);
RIC_1.clearSupportedPolicyTypes();
}
RIC_1.clearSupportedPolicyTypes();
}
@@
-134,7
+135,7
@@
public class RicSynchronizationTaskTest {
@Test
public void ricIdlePolicyTypeInRepo_thenSynchronizationWithReuseOfTypeFromRepoAndCorrectServiceNotified() {
@Test
public void ricIdlePolicyTypeInRepo_thenSynchronizationWithReuseOfTypeFromRepoAndCorrectServiceNotified() {
- RIC_1.setState(RicState.
ID
LE);
+ RIC_1.setState(RicState.
AVAILAB
LE);
policyTypes.put(POLICY_TYPE_1);
policyTypes.put(POLICY_TYPE_1);
@@
-165,12
+166,12
@@
public class RicSynchronizationTaskTest {
assertThat(policyTypes.size()).isEqualTo(1);
assertThat(policies.size()).isEqualTo(0);
assertThat(policyTypes.size()).isEqualTo(1);
assertThat(policies.size()).isEqualTo(0);
- assertThat(RIC_1.getState()).isEqualTo(RicState.
ID
LE);
+ assertThat(RIC_1.getState()).isEqualTo(RicState.
AVAILAB
LE);
}
@Test
public void ricIdlePolicyTypeNotInRepo_thenSynchronizationWithTypeFromRic() throws Exception {
}
@Test
public void ricIdlePolicyTypeNotInRepo_thenSynchronizationWithTypeFromRic() throws Exception {
- RIC_1.setState(RicState.
ID
LE);
+ RIC_1.setState(RicState.
AVAILAB
LE);
setUpCreationOfA1Client();
simulateRicWithOnePolicyType();
setUpCreationOfA1Client();
simulateRicWithOnePolicyType();
@@
-188,12
+189,12
@@
public class RicSynchronizationTaskTest {
assertThat(policyTypes.size()).isEqualTo(1);
assertThat(policyTypes.getType(POLICY_TYPE_1_NAME).schema()).isEqualTo(typeSchema);
assertThat(policies.size()).isEqualTo(0);
assertThat(policyTypes.size()).isEqualTo(1);
assertThat(policyTypes.getType(POLICY_TYPE_1_NAME).schema()).isEqualTo(typeSchema);
assertThat(policies.size()).isEqualTo(0);
- assertThat(RIC_1.getState()).isEqualTo(RicState.
ID
LE);
+ assertThat(RIC_1.getState()).isEqualTo(RicState.
AVAILAB
LE);
}
@Test
public void ricIdleAndHavePolicies_thenSynchronizationWithRecreationOfPolicies() {
}
@Test
public void ricIdleAndHavePolicies_thenSynchronizationWithRecreationOfPolicies() {
- RIC_1.setState(RicState.
ID
LE);
+ RIC_1.setState(RicState.
AVAILAB
LE);
policies.put(POLICY_1);
policies.put(POLICY_1);
@@
-214,12
+215,12
@@
public class RicSynchronizationTaskTest {
assertThat(policyTypes.size()).isEqualTo(0);
assertThat(policies.size()).isEqualTo(1);
assertThat(policyTypes.size()).isEqualTo(0);
assertThat(policies.size()).isEqualTo(1);
- assertThat(RIC_1.getState()).isEqualTo(RicState.
ID
LE);
+ assertThat(RIC_1.getState()).isEqualTo(RicState.
AVAILAB
LE);
}
@Test
public void ricIdleAndErrorDeletingPoliciesFirstTime_thenSynchronizationWithDeletionOfPolicies() {
}
@Test
public void ricIdleAndErrorDeletingPoliciesFirstTime_thenSynchronizationWithDeletionOfPolicies() {
- RIC_1.setState(RicState.
ID
LE);
+ RIC_1.setState(RicState.
AVAILAB
LE);
policies.put(POLICY_1);
policies.put(POLICY_1);
@@
-240,12
+241,12
@@
public class RicSynchronizationTaskTest {
assertThat(policyTypes.size()).isEqualTo(0);
assertThat(policies.size()).isEqualTo(0);
assertThat(policyTypes.size()).isEqualTo(0);
assertThat(policies.size()).isEqualTo(0);
- assertThat(RIC_1.getState()).isEqualTo(RicState.
ID
LE);
+ assertThat(RIC_1.getState()).isEqualTo(RicState.
AVAILAB
LE);
}
@Test
public void ricIdleAndErrorDeletingPoliciesAllTheTime_thenSynchronizationWithFailedRecovery() {
}
@Test
public void ricIdleAndErrorDeletingPoliciesAllTheTime_thenSynchronizationWithFailedRecovery() {
- RIC_1.setState(RicState.
ID
LE);
+ RIC_1.setState(RicState.
AVAILAB
LE);
policies.put(POLICY_1);
policies.put(POLICY_1);
@@
-264,21
+265,19
@@
public class RicSynchronizationTaskTest {
synchronizerUnderTest.run(RIC_1);
verifyCorrectLogMessage(0, logAppender,
synchronizerUnderTest.run(RIC_1);
verifyCorrectLogMessage(0, logAppender,
- "Synchronization failed for ric: " + RIC_1_NAME + ", reason: " + originalErrorMessage);
- verifyCorrectLogMessage(1, logAppender,
- "Synchronization failure recovery failed for ric: " + RIC_1_NAME + ", reason: " + originalErrorMessage);
+ "Synchronization failure for ric: " + RIC_1_NAME + ", reason: " + originalErrorMessage);
verify(a1ClientMock, times(2)).deleteAllPolicies();
verifyNoMoreInteractions(a1ClientMock);
assertThat(policyTypes.size()).isEqualTo(0);
assertThat(policies.size()).isEqualTo(0);
verify(a1ClientMock, times(2)).deleteAllPolicies();
verifyNoMoreInteractions(a1ClientMock);
assertThat(policyTypes.size()).isEqualTo(0);
assertThat(policies.size()).isEqualTo(0);
- assertThat(RIC_1.getState()).isEqualTo(RicState.UN
DEFINED
);
+ assertThat(RIC_1.getState()).isEqualTo(RicState.UN
AVAILABLE
);
}
@Test
public void ricIdlePolicyTypeInRepo_thenSynchronizationWithErrorOnServiceNotificationErrorLogged() {
}
@Test
public void ricIdlePolicyTypeInRepo_thenSynchronizationWithErrorOnServiceNotificationErrorLogged() {
- RIC_1.setState(RicState.
ID
LE);
+ RIC_1.setState(RicState.
AVAILAB
LE);
policyTypes.put(POLICY_TYPE_1);
policyTypes.put(POLICY_TYPE_1);
@@
-300,7
+299,7
@@
public class RicSynchronizationTaskTest {
synchronizerUnderTest.run(RIC_1);
ILoggingEvent loggingEvent = logAppender.list.get(0);
synchronizerUnderTest.run(RIC_1);
ILoggingEvent loggingEvent = logAppender.list.get(0);
- assertThat(loggingEvent.get
ThrowableProxy().getMessage()).isEqualTo(originalErrorMessage
);
+ assertThat(loggingEvent.get
Level()).isEqualTo(WARN
);
verifyCorrectLogMessage(0, logAppender, "Service notification failed for service: " + SERVICE_1_NAME);
}
verifyCorrectLogMessage(0, logAppender, "Service notification failed for service: " + SERVICE_1_NAME);
}