jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <notificati...@github.com>
Subject Re: [jclouds-labs] Profitbricks Drives API (#146)
Date Tue, 03 Mar 2015 21:48:51 GMT
> +import org.jclouds.profitbricks.domain.Server;
> +import static org.testng.Assert.assertNotNull;
> +import org.testng.annotations.Test;
> +
> +@Test(groups = "live", testName = "DrivesApiLiveTest", singleThreaded = true)
> +public class DrivesApiLiveTest extends BaseProfitBricksLiveTest {
> +
> +   public String serverId;
> +   public String imageId;
> +
> +   @Override
> +   protected void initialize() {
> +      super.initialize();
> +
> +      List<Server> servers = api.serverApi().getAllServers();
> +      assertNotNull(servers, "At least one server is required to run drives test.");

Remove this assertion, as the server api never returns null. That's why it uses the fallback
to an empty list. In jclouds we try to avoid returning null lists, so this is a pattern you
can apply to the rest of the code.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/146/files#r25730295
Mime
View raw message