@Test public void testFilterByTagNoMatch() throws Throwable { List<Vm> foundVms = vmDcpBackend .filterByTag(vm.projectId, new Tag("tag1"), Optional.<Integer>absent()) .getItems(); assertThat(foundVms, is(notNullValue())); assertThat(foundVms.size(), is(0)); }
@Test public void testFilterByTagPagination() throws Throwable { ResourceList<Vm> foundVms = vmDcpBackend.filterByTag( vm.projectId, new Tag(vm.tags.iterator().next()), Optional.of(1)); assertThat(foundVms.getItems(), is(notNullValue())); assertThat(foundVms.getItems().size(), is(1)); assertThat(foundVms.getItems().get(0).getName(), is(vm.name)); }
@Test public void testFilterByTag() throws Throwable { List<Vm> foundVms = vmDcpBackend .filterByTag( vm.projectId, new Tag(vm.tags.iterator().next()), Optional.<Integer>absent()) .getItems(); assertThat(foundVms, is(notNullValue())); assertThat(foundVms.size(), is(1)); assertThat(foundVms.get(0).getName(), is(vm.name)); }