+ @Test
+ public void testRecovery() throws Exception {
+ reset();
+ Policy policy = addPolicy("policyId", "typeName", "service", "ric"); // This should be created in the RIC
+ Policy policy2 = addPolicy("policyId2", "typeName", "service", "ric");
+
+ getA1Client("ric").putPolicy(policy2); // put it in the RIC
+ policies.remove(policy2); // Remove it from the repo -> should be deleted in the RIC
+
+ supervision.checkAllRics(); // The created policy should be put in the RIC
+ Policies ricPolicies = getA1Client("ric").getPolicies();
+ assertThat(ricPolicies.size()).isEqualTo(1);
+ Policy ricPolicy = ricPolicies.get("policyId");
+ assertThat(ricPolicy.json()).isEqualTo(policy.json());
+ }
+
+ MockA1Client getA1Client(String ricName) throws ServiceException {
+ return a1ClientFactory.getOrCreateA1Client(ricName);
+ }
+