/** * @see org.jclouds.cloudstack.options.ListTagsOptions#resourceType(String) */ public static ListTagsOptions resourceType(String resourceType) { ListTagsOptions options = new ListTagsOptions(); return options.resourceType(resourceType); }
/** * @see org.jclouds.cloudstack.options.ListTagsOptions#resourceType(org.jclouds.cloudstack.domain.Tag.ResourceType) */ public static ListTagsOptions resourceType(Tag.ResourceType resourceType) { ListTagsOptions options = new ListTagsOptions(); return options.resourceType(resourceType); }
public void testResourceTypeAsString() { ListTagsOptions options = new ListTagsOptions().resourceType("Template"); assertEquals(ImmutableList.of("Template"), options.buildQueryParameters().get("resourcetype")); }
public void testResourceType() { ListTagsOptions options = new ListTagsOptions().resourceType(Tag.ResourceType.TEMPLATE); assertEquals(ImmutableList.of("Template"), options.buildQueryParameters().get("resourcetype")); }
public void testListTagsOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(TagApi.class, "listTags", ListTagsOptions[].class); GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of( ListTagsOptions.Builder.accountInDomain("adrian", "6").resourceType(Tag.ResourceType.TEMPLATE))); assertRequestLineEquals( httpRequest, "GET http://localhost:8080/client/api?response=json&command=listTags&listAll=true&account=adrian&domainid=6&resourcetype=Template HTTP/1.1"); assertNonPayloadHeadersEqual(httpRequest, "Accept: application/json\n"); assertPayloadEquals(httpRequest, null, null, false); assertResponseParserClassEquals(method, httpRequest, ParseFirstJsonValueNamed.class); assertSaxResponseParserClassEquals(method, null); assertFallbackClassEquals(method, EmptySetOnNotFoundOr404.class); checkFilters(httpRequest); }