@Test public void testCreateResources() throws Exception { IvoryService service = createMock(IvoryService.class); Set<Map<String, Object>> propertySet = new HashSet<Map<String, Object>>(); Map<String, Object> properties = new HashMap<String, Object>(); replay(service); propertySet.add(properties); Request request = PropertyHelper.getCreateRequest(propertySet, Collections.<String,String>emptyMap()); InstanceResourceProvider provider = new InstanceResourceProvider(service, PropertyHelper.getPropertyIds(Resource.Type.DRInstance), PropertyHelper.getKeyPropertyIds(Resource.Type.DRInstance)); try { provider.createResources(request); Assert.fail("Expected UnsupportedOperationException"); } catch (UnsupportedOperationException e) { } verify(service); }
@Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { throw new UnsupportedOperationException("Not supported."); }
InstanceResourceProvider extends AbstractDRResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { throw new UnsupportedOperationException("Not supported."); } }
InstanceResourceProvider extends AbstractDRResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { throw new UnsupportedOperationException("Not supported."); } InstanceResourceProvider(IvoryService ivoryService,
                                  Set<String> propertyIds,
                                  Map<Resource.Type, String> keyPropertyIds); }
InstanceResourceProvider extends AbstractDRResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { throw new UnsupportedOperationException("Not supported."); } InstanceResourceProvider(IvoryService ivoryService,
                                  Set<String> propertyIds,
                                  Map<Resource.Type, String> keyPropertyIds); @Override RequestStatus createResources(Request request); @Override Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus updateResources(Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate); }
InstanceResourceProvider extends AbstractDRResourceProvider { @Override public RequestStatus createResources(Request request) throws SystemException, UnsupportedPropertyException, ResourceAlreadyExistsException, NoSuchParentResourceException { throw new UnsupportedOperationException("Not supported."); } InstanceResourceProvider(IvoryService ivoryService,
                                  Set<String> propertyIds,
                                  Map<Resource.Type, String> keyPropertyIds); @Override RequestStatus createResources(Request request); @Override Set<Resource> getResources(Request request, Predicate predicate); @Override RequestStatus updateResources(Request request, Predicate predicate); @Override RequestStatus deleteResources(Request request, Predicate predicate);  }