+ @Test
+ public void getRic() throws Exception {
+ String cmd = "/ric?managedElementId=kista_1";
+ String rsp = this.restTemplate.getForObject("http://localhost:" + port + cmd, String.class);
+ assertThat(rsp).isEqualTo("ric1");
+ }
+
+ // managedElmentId -> nodeName
+
+ @Test
+ public void putPolicy() throws Exception {
+ // types.putType("type1", ImmutablePolicyType.builder().name("").jsonSchema("").build());
+
+ String url = "http://localhost:" + port + "/policy?type={type}&instance={instance}&ric={ric}&service={service}";
+
+ Map<String, String> uriVariables = new HashMap<String, String>();
+ uriVariables.put("type", "type1");
+ uriVariables.put("instance", "instance1");
+ uriVariables.put("ric", "ric1");
+ uriVariables.put("service", "service");
+ HttpHeaders headers = new HttpHeaders();
+ headers.setContentType(MediaType.APPLICATION_JSON);
+ String json = "{}";
+ HttpEntity<String> entity = new HttpEntity<String>(json);
+
+ addPolicyType(policyTypes, "type1");
+
+ this.restTemplate.put(url, entity, uriVariables);
+ Policy policy = this.policies.get("instance1");
+ assertThat(policy).isNotNull();
+ assertThat(policy.id()).isEqualTo("instance1");
+ assertThat(policy.ownerServiceName()).isEqualTo("service");
+ }
+
+ private void addPolicyType(PolicyTypes policyTypes, String name) {
+ PolicyType type = ImmutablePolicyType.builder() //
+ .jsonSchema("") //
+ .name(name) //
+ .build();
+
+ policyTypes.putType(name, type);
+ }
+