@Test public void testIsCollection__False() { ResourceDefinition resourceDefinition = createNiceMock(ResourceDefinition.class); Map<Resource.Type, String> mapIds = new HashMap<Resource.Type, String>(); mapIds.put(Resource.Type.Cluster, "cluster"); mapIds.put(Resource.Type.Service, "service"); expect(resourceDefinition.getType()).andReturn(Resource.Type.Service).anyTimes(); expect(resourceDefinition.getSubResourceDefinitions()).andReturn(Collections.<SubResourceDefinition>emptySet()).anyTimes(); replay(resourceDefinition); ResourceInstance instance = new TestQuery(mapIds, resourceDefinition); assertFalse(instance.isCollectionResource()); verify(resourceDefinition); }
@Override public boolean isCollectionResource() { return getKeyValueMap().get(getResourceDefinition().getType()) == null; }
QueryImpl implements Query, ResourceInstance { @Override public boolean isCollectionResource() { return getKeyValueMap().get(getResourceDefinition().getType()) == null; } }
QueryImpl implements Query, ResourceInstance { @Override public boolean isCollectionResource() { return getKeyValueMap().get(getResourceDefinition().getType()) == null; } QueryImpl(Map<Resource.Type, String> keyValueMap,
                   ResourceDefinition resourceDefinition,
                   ClusterController clusterController); }
QueryImpl implements Query, ResourceInstance { @Override public boolean isCollectionResource() { return getKeyValueMap().get(getResourceDefinition().getType()) == null; } QueryImpl(Map<Resource.Type, String> keyValueMap,
                   ResourceDefinition resourceDefinition,
                   ClusterController clusterController); @Override void addProperty(String propertyId, TemporalInfo temporalInfo); @Override void addLocalProperty(String property); @Override Result execute(); @Override Predicate getPredicate(); @Override Set<String> getProperties(); @Override void setUserPredicate(Predicate predicate); @Override void setPageRequest(PageRequest pageRequest); @Override void setSortRequest(SortRequest sortRequest); @Override void setRenderer(Renderer renderer); @Override void setRequestInfoProps(Map<String, String> requestInfoProperties); @Override Map<String, String> getRequestInfoProps(); @Override void setKeyValueMap(Map<Resource.Type, String> keyValueMap); @Override Map<Resource.Type, String> getKeyValueMap(); @Override Query getQuery(); @Override ResourceDefinition getResourceDefinition(); @Override boolean isCollectionResource(); @Override Map<String, ResourceInstance> getSubResources(); @Override boolean equals(Object o); @Override int hashCode(); }
QueryImpl implements Query, ResourceInstance { @Override public boolean isCollectionResource() { return getKeyValueMap().get(getResourceDefinition().getType()) == null; } QueryImpl(Map<Resource.Type, String> keyValueMap,
                   ResourceDefinition resourceDefinition,
                   ClusterController clusterController); @Override void addProperty(String propertyId, TemporalInfo temporalInfo); @Override void addLocalProperty(String property); @Override Result execute(); @Override Predicate getPredicate(); @Override Set<String> getProperties(); @Override void setUserPredicate(Predicate predicate); @Override void setPageRequest(PageRequest pageRequest); @Override void setSortRequest(SortRequest sortRequest); @Override void setRenderer(Renderer renderer); @Override void setRequestInfoProps(Map<String, String> requestInfoProperties); @Override Map<String, String> getRequestInfoProps(); @Override void setKeyValueMap(Map<Resource.Type, String> keyValueMap); @Override Map<Resource.Type, String> getKeyValueMap(); @Override Query getQuery(); @Override ResourceDefinition getResourceDefinition(); @Override boolean isCollectionResource(); @Override Map<String, ResourceInstance> getSubResources(); @Override boolean equals(Object o); @Override int hashCode();  }