예제 #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));
 }