Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add unit tests for SdnrOnapA1Client
[nonrtric.git]
/
policy-agent
/
src
/
test
/
java
/
org
/
oransc
/
policyagent
/
tasks
/
RepositorySupervisionTest.java
diff --git
a/policy-agent/src/test/java/org/oransc/policyagent/tasks/RepositorySupervisionTest.java
b/policy-agent/src/test/java/org/oransc/policyagent/tasks/RepositorySupervisionTest.java
index
92f48de
..
fb8d46f
100644
(file)
--- a/
policy-agent/src/test/java/org/oransc/policyagent/tasks/RepositorySupervisionTest.java
+++ b/
policy-agent/src/test/java/org/oransc/policyagent/tasks/RepositorySupervisionTest.java
@@
-35,9
+35,7
@@
import java.util.Vector;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
-import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.junit.jupiter.MockitoExtension;
import org.oransc.policyagent.clients.A1Client;
import org.oransc.policyagent.clients.A1ClientFactory;
import org.mockito.junit.jupiter.MockitoExtension;
import org.oransc.policyagent.clients.A1Client;
import org.oransc.policyagent.clients.A1ClientFactory;
@@
-57,7
+55,6
@@
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@ExtendWith(MockitoExtension.class)
import reactor.core.publisher.Mono;
@ExtendWith(MockitoExtension.class)
-@RunWith(MockitoJUnitRunner.class)
public class RepositorySupervisionTest {
@Mock
A1Client a1ClientMock;
public class RepositorySupervisionTest {
@Mock
A1Client a1ClientMock;
@@
-111,9
+108,6
@@
public class RepositorySupervisionTest {
PolicyTypes types = new PolicyTypes();
Services services = new Services();
PolicyTypes types = new PolicyTypes();
Services services = new Services();
- RepositorySupervision supervisorUnderTest =
- new RepositorySupervision(rics, policies, a1ClientFactory, types, services);
-
Mono<List<String>> policyIds = Mono.just(Arrays.asList("policyId1", "policyId2"));
doReturn(policyIds).when(a1ClientMock).getPolicyTypeIdentities();
Mono<List<String>> policyIds = Mono.just(Arrays.asList("policyId1", "policyId2"));
doReturn(policyIds).when(a1ClientMock).getPolicyTypeIdentities();
@@
-122,6
+116,9
@@
public class RepositorySupervisionTest {
doReturn(Mono.just("OK")).when(a1ClientMock).putPolicy(any());
doReturn(Flux.empty()).when(a1ClientMock).deleteAllPolicies();
doReturn(Mono.just("OK")).when(a1ClientMock).putPolicy(any());
doReturn(Flux.empty()).when(a1ClientMock).deleteAllPolicies();
+ RepositorySupervision supervisorUnderTest =
+ new RepositorySupervision(rics, policies, a1ClientFactory, types, services);
+
supervisorUnderTest.checkAllRics();
await().untilAsserted(() -> RicState.IDLE.equals(ric1.getState()));
supervisorUnderTest.checkAllRics();
await().untilAsserted(() -> RicState.IDLE.equals(ric1.getState()));