- Assert.assertEquals(policyTypes, result.get().getResult().getPolicyTypeIdList());
- }
-
- @Test
- public void testDeletePolicyType() throws InterruptedException, ExecutionException {
- DeletePolicyTypeInputBuilder inputBuilder = new DeletePolicyTypeInputBuilder();
- inputBuilder.setPolicyTypeId(policyTypeId);
- Whitebox.setInternalState(nonrtRicApiProvider, "restAdapter", restAdapter);
- String uri =
- nearRicUrlProvider.getPolicyTypeId(String.valueOf(inputBuilder.build().getPolicyTypeId()));
- Optional<Object> deletePolicyTyperesponse = null;
- when(restAdapter.delete(uri)).thenReturn(deletePolicyTyperesponse);
- ListenableFuture<RpcResult<DeletePolicyTypeOutput>> result =
- nonrtRicApiProvider.deletePolicyType(inputBuilder.build());
- }
-
- @Test
- public void testCreatePolicyInstance() throws InterruptedException, ExecutionException {
- CreatePolicyInstanceInputBuilder inputBuilder = new CreatePolicyInstanceInputBuilder();
- inputBuilder.setPolicyTypeId(policyTypeId);
- inputBuilder.setPolicyInstanceId(policyTypeInstanceId);
- Whitebox.setInternalState(nonrtRicApiProvider, "restAdapter", restAdapter);
- String uri = nearRicUrlProvider.getPolicyInstanceId(
- String.valueOf(inputBuilder.build().getPolicyTypeId()), inputBuilder.getPolicyInstanceId());
- Optional<Object> createPolicyInstanceresponse = null;
- when(restAdapter.put(eq(uri), anyObject())).thenReturn(createPolicyInstanceresponse);
- ListenableFuture<RpcResult<CreatePolicyInstanceOutput>> result =
- nonrtRicApiProvider.createPolicyInstance(inputBuilder.build());
- }
-
- @Test
- public void testDeletePolicyInstance() throws InterruptedException, ExecutionException {
- DeletePolicyInstanceInputBuilder inputBuilder = new DeletePolicyInstanceInputBuilder();
- inputBuilder.setPolicyTypeId(policyTypeId);
- inputBuilder.setPolicyInstanceId(policyTypeInstanceId);
- Whitebox.setInternalState(nonrtRicApiProvider, "restAdapter", restAdapter);
- String uri = nearRicUrlProvider.getPolicyInstanceId(
- String.valueOf(inputBuilder.build().getPolicyTypeId()), inputBuilder.getPolicyInstanceId());
- Optional<Object> deletePolicyInstanceresponse = null;
- when(restAdapter.delete(uri)).thenReturn(deletePolicyInstanceresponse);
- ListenableFuture<RpcResult<DeletePolicyInstanceOutput>> result =
- nonrtRicApiProvider.deletePolicyInstance(inputBuilder.build());