public void testIdStatic() { ListAlertsOptions options = id("6"); assertEquals(ImmutableList.of("6"), options.buildQueryParameters().get("id")); }
public void testKeywordStatic() { ListAlertsOptions options = keyword("fred"); assertEquals(ImmutableList.of("fred"), options.buildQueryParameters().get("keyword")); }
public void testTypeStatic() { ListAlertsOptions options = type("42"); assertEquals(ImmutableList.of("42"), options.buildQueryParameters().get("type")); } }
@Test(groups = "live", enabled = true) public void testListAlerts() throws Exception { skipIfNotGlobalAdmin(); final Set<Alert> response = globalAdminClient.getAlertClient().listAlerts(ListAlertsOptions.Builder.id("20")); assert null != response; assertTrue(response.size() >= 0); int count = 0; for (Alert alert : response) { assertNotNull(alert.getDescription()); assertNotSame(alert.getId(), 0); assertNotNull(alert.getType()); assertNotNull(alert.getSent()); count++; } assertTrue(count > 0, "No alerts were returned, so I couldn't test"); }
public void testListAlertsOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(GlobalAlertAsyncClient.class, "listAlerts", ListAlertsOptions[].class); GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListAlertsOptions.Builder.id("42").keyword("jclouds").type("TEMPLATE"))); assertRequestLineEquals(httpRequest, "GET http://localhost:8080/client/api?response=json&command=listAlerts&listAll=true&id=42&keyword=jclouds&type=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); } }
public void testListAlertsOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(GlobalAlertApi.class, "listAlerts", ListAlertsOptions[].class); GeneratedHttpRequest httpRequest = processor.createRequest(method, ImmutableList.<Object> of(ListAlertsOptions.Builder.id("42").keyword("jclouds").type("TEMPLATE"))); assertRequestLineEquals(httpRequest, "GET http://localhost:8080/client/api?response=json&command=listAlerts&listAll=true&id=42&keyword=jclouds&type=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); } }
public void testKeywordStatic() { ListAlertsOptions options = keyword("fred"); assertEquals(ImmutableList.of("fred"), options.buildQueryParameters().get("keyword")); }
public void testTypeStatic() { ListAlertsOptions options = type("42"); assertEquals(ImmutableList.of("42"), options.buildQueryParameters().get("type")); } }
public void testIdStatic() { ListAlertsOptions options = id("6"); assertEquals(ImmutableList.of("6"), options.buildQueryParameters().get("id")); }