Package com.ibm.sbt.services.client.base

Examples of com.ibm.sbt.services.client.base.JsonEntity.toJsonString()


        if (!subscriptionList.isEmpty()) {
          JsonEntity subscription = subscriptionList.get(0);
          long id = subscription.getAsLong("Id");
         
          subscription = subscriptionManagement.getSubscriptionById("" + id);
          System.out.println(subscription.toJsonString(false));
          Assert.assertNotNull("Unable to retrieve subscription: "+id, subscription);
          Assert.assertEquals(""+id, getSubscriptionManagementService().getSubscriptionId(subscription.getJsonObject()));
        }
      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here


       
        SubscriptionManagementService subscriptionManagement = getSubscriptionManagementService();
       
        JsonEntity jsonEntity = subscriptionManagement.getSubscriptionById(subscriptionId);
      Assert.assertNotNull("Unable to retrieve subscription: "+subscriptionId, jsonEntity);
      System.out.println(jsonEntity.toJsonString());
     
      Assert.assertEquals(subscriptionId, subscriptionManagement.getSubscriptionId(jsonEntity.getJsonObject()));

      JsonJavaObject rootObject = jsonEntity.getJsonObject();
      Assert.assertNotNull("Unable to retrieve subscription: "+subscriptionId, rootObject);
View Full Code Here

        setCustomerId(null);

        // Step 2. Add Subscriber
      String subscriberId = addAdministrator(customerId);
        JsonEntity administrator = getSubscriberById(subscriberId);
        System.out.println(administrator.toJsonString());
        String loginName = administrator.getAsString("Subscriber/Person/EmailAddress");
        setPassword(loginName, "onet1me!", "passw0rd");
        System.out.println(loginName);

        // Step 3. Create "IBM SmartCloud Connections" Subscription
View Full Code Here

        }
        long duration = System.currentTimeMillis() - start;
        System.out.println("Wait for seat took: " + duration);

      subscriber = getSubscriberManagementService().getSubscriberById(subscriberId);
      System.out.println(subscriber.toJsonString());
     
      } catch (BssException be) {
        JsonJavaObject jsonObject = be.getResponseJson();
        System.err.println(jsonObject);
        Assert.fail("Error retrieving roles caused by: "+jsonObject);
View Full Code Here

       
        SubscriptionManagementService subscriptionManagement = getSubscriptionManagementService();
       
        JsonEntity jsonEntity = subscriptionManagement.getSubscriptionById(subscriptionId);
      Assert.assertNotNull("Unable to retrieve subscription: "+subscriptionId, jsonEntity);
      System.out.println(jsonEntity.toJsonString());
     
      Assert.assertEquals(subscriptionId, subscriptionManagement.getSubscriptionId(jsonEntity.getJsonObject()));

      JsonJavaObject rootObject = jsonEntity.getJsonObject();
      Assert.assertNotNull("Unable to retrieve subscription: "+subscriptionId, rootObject);
View Full Code Here

         
          EntityList<JsonEntity> subscriptionList = subscriptionManagement.getSubscriptionsById("" + customerId);
          if(!subscriptionList.isEmpty()){
          JsonEntity subscription = subscriptionList.get(0);
          long subscriptionId = subscription.getAsLong("Id");
            System.out.println(subscription.toJsonString(false));
            Assert.assertNotNull("Unable to retrieve subscriptions for customer: "+customerId, subscription);
            Assert.assertEquals(""+subscriptionId, getSubscriptionManagementService().getSubscriptionId(subscription.getJsonObject()));
          }
        }
       
View Full Code Here

          long subscriberId = response.getAsLong("Long");
          Assert.assertNotNull("Invalid subscriber id", subscriberId);
          System.out.println(subscriberId);
         
          JsonEntity subscriberEntity = getSubscriberManagementService().getSubscriberById(String.valueOf(subscriberId));
          System.out.println(subscriberEntity.toJsonString());
         
      } catch (BssException be) {
        JsonJavaObject jsonObject = be.getResponseJson();
        System.err.println(jsonObject);
        Assert.fail("Error registering customer because: "+jsonObject);
View Full Code Here

        // Step 6. Change email
        updateSubscriberEmail(subscriberId, "john.doe@example.com");
       
        // Display provisioned subscriber
        JsonEntity subscriber = getSubscriberById(subscriberId);
        System.out.println(subscriber.toJsonString());
       
      } catch (Exception e) {
        e.printStackTrace();
        Assert.fail("Error provisioning subscriber caused by: "+e.getMessage());       
      }
View Full Code Here

      try {
        registerCustomer();
        String subscriberId = addSubscriber();
       
        JsonEntity jsonEntity = getSubscriberManagementService().getSubscriberById(subscriberId);
      System.out.println(jsonEntity.toJsonString());
      Assert.assertNotNull("Unable to retrieve subscriber: "+subscriberId, jsonEntity);
       
      Assert.assertEquals(subscriberId, getSubscriberManagementService().getSubscriberId(jsonEntity.getJsonObject()));
      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

    public void testGetCustomerById() {
      try {
        String customerId = registerCustomer();

        JsonEntity jsonEntity = getCustomerManagementService().getCustomerById(customerId);
      System.out.println(jsonEntity.toJsonString(false));
      Assert.assertNotNull("Unable to retrieve customer: "+customerId, jsonEntity);
       
      Assert.assertEquals(customerId, getCustomerManagementService().getCustomerId(jsonEntity.getJsonObject()));
      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.