Package org.jclouds.digitalocean.features

Examples of org.jclouds.digitalocean.features.EventApi


*/
@Test(groups = "unit", testName = "EventDonePredicateTest")
public class EventDonePredicateTest {

   public void testEventProgress() {
      EventApi eventApi = EasyMock.createMock(EventApi.class);
      DigitalOceanApi api = EasyMock.createMock(DigitalOceanApi.class);

      expect(eventApi.get(1)).andReturn(event(Status.DONE));
      expect(eventApi.get(2)).andReturn(event(Status.PENDING));
      expect(api.getEventApi()).andReturn(eventApi).times(2);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);
      assertTrue(predicate.apply(1));
View Full Code Here


      assertTrue(predicate.apply(1));
      assertFalse(predicate.apply(2));
   }

   public void testEventFailed() {
      EventApi eventApi = EasyMock.createMock(EventApi.class);
      DigitalOceanApi api = EasyMock.createMock(DigitalOceanApi.class);

      expect(eventApi.get(anyInt())).andReturn(event(Status.ERROR));
      expect(api.getEventApi()).andReturn(eventApi);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);
View Full Code Here

*/
@Test(groups = "unit", testName = "EventDonePredicateTest")
public class EventDonePredicateTest {

   public void testEventProgress() {
      EventApi eventApi = EasyMock.createMock(EventApi.class);
      DigitalOceanApi api = EasyMock.createMock(DigitalOceanApi.class);

      expect(eventApi.get(1)).andReturn(event(Status.DONE));
      expect(eventApi.get(2)).andReturn(event(Status.PENDING));
      expect(api.getEventApi()).andReturn(eventApi).times(2);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);
      assertTrue(predicate.apply(1));
View Full Code Here

      assertTrue(predicate.apply(1));
      assertFalse(predicate.apply(2));
   }

   public void testEventFailed() {
      EventApi eventApi = EasyMock.createMock(EventApi.class);
      DigitalOceanApi api = EasyMock.createMock(DigitalOceanApi.class);

      expect(eventApi.get(anyInt())).andReturn(event(Status.ERROR));
      expect(api.getEventApi()).andReturn(eventApi);
      replay(eventApi, api);

      EventDonePredicate predicate = new EventDonePredicate(api);
View Full Code Here

TOP

Related Classes of org.jclouds.digitalocean.features.EventApi

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.