Пример #1
0
 public void testThawWhenResponseIs2xx() {
   DynECTApi success =
       requestsSendResponses(createSession, createSessionResponse, thaw, deleteResponse);
   assertEquals(
       success.getZoneApi().thaw("jclouds.org").toString(),
       new DeleteZoneResponseTest().expected().toString());
 }
Пример #2
0
 public void testCreateWithContactWhenResponseIs2xx() {
   DynECTApi success =
       requestsSendResponses(createSession, createSessionResponse, create, createResponse);
   assertEquals(
       success.getZoneApi().scheduleCreateWithContact("jclouds.org", "*****@*****.**"),
       Job.success(285351593L));
 }
Пример #3
0
 public void testGetWhenResponseIs2xx() {
   DynECTApi success =
       requestsSendResponses(createSession, createSessionResponse, get, getResponse);
   assertEquals(
       success.getZoneApi().get("jclouds.org").toString(),
       new GetZoneResponseTest().expected().toString());
 }
Пример #4
0
 public void testCreateWhenResponseIs2xx() {
   DynECTApi success =
       requestsSendResponses(createSession, createSessionResponse, create, createResponse);
   assertEquals(
       success
           .getZoneApi()
           .scheduleCreate(
               CreatePrimaryZone.builder()
                   .fqdn("jclouds.org")
                   .contact("*****@*****.**")
                   .build()),
       Job.success(285351593L));
 }
Пример #5
0
 public void testCreateWhenResponseIs2xx() {
   DynECTApi apiCreatesSession = requestSendsResponse(createSession, createSessionResponse);
   assertEquals(
       apiCreatesSession
           .getSessionApi()
           .login(
               SessionCredentials.builder()
                   .customerName("jclouds")
                   .userName("joe")
                   .password("letmein")
                   .build())
           .toString(),
       new CreateSessionResponseTest().expected().toString());
 }
Пример #6
0
 public void testDeleteWhenResponseIs404() {
   DynECTApi fail = requestsSendResponses(createSession, createSessionResponse, delete, notFound);
   assertNull(fail.getZoneApi().delete("jclouds.org"));
 }
Пример #7
0
 public void testListWhenResponseIs2xx() {
   DynECTApi success =
       requestsSendResponses(createSession, createSessionResponse, list, listResponse);
   assertEquals(
       success.getZoneApi().list().toString(), new ListZonesResponseTest().expected().toString());
 }
Пример #8
0
 public void testLogout() {
   DynECTApi apiWhenLogoutSuccess = requestSendsResponse(logout, logoutResponse);
   apiWhenLogoutSuccess.getSessionApi().logout(authToken);
 }
Пример #9
0
 public void testSessionInvalid() {
   DynECTApi apiWhenInvalid = requestSendsResponse(isValid, invalidResponse);
   assertFalse(apiWhenInvalid.getSessionApi().isValid(authToken));
 }