Examples of JsonEntity


Examples of com.ibm.sbt.services.client.base.JsonEntity

        registerCustomer();
        String subscriberId = addSubscriber();

        SubscriberManagementService subscriberManagement = getSubscriberManagementService();
       
        JsonEntity jsonEntity = subscriberManagement.getSubscriberById(subscriberId);
      Assert.assertNotNull("Unable to retrieve subscriber: "+subscriberId, jsonEntity);
      Assert.assertEquals(subscriberId, subscriberManagement.getSubscriberId(jsonEntity.getJsonObject()));

      subscriberManagement.deleteSubscriber(subscriberId);
     
      try {
        jsonEntity = subscriberManagement.getSubscriberById(subscriberId);
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

        String storageSubscriptionId = createSubscription(customerId, 3, "D100PLL", 100);
        System.out.println(storageSubscriptionId);
        System.out.println("D100PLL : " + getSubscriptionById(storageSubscriptionId).toJsonString());
       
        // Step 5. Update the subscription will cause a 400 Bad Request     
        JsonEntity jsonEntity = getSubscriptionById(storageSubscriptionId);
        JsonJavaObject rootObject = jsonEntity.getJsonObject().getAsObject("Subscription");
        rootObject.putInt("PartQuantity", 150);
        getSubscriptionManagementService().updateSubscription(rootObject);

      } catch (Exception e) {
        e.printStackTrace();
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

    @Test
    public void testGetCustomerWorkflows() {
      try {
        EntityList<JsonEntity> customerList = getCustomerManagementService().getCustomers();
        if (!customerList.isEmpty()) {
          JsonEntity customer = customerList.get(0);
          long id = customer.getAsLong("Id");
         
           
            String customerId = "" + id;
          EntityList<JsonEntity> workflowList = getWorkflowService().getWorkflowsByCustomerId(customerId, 1, 50);
          System.out.println("Customer: "+customerId);
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

    @Test
    public void testGetSubscriberWorkflows() {
      try {
        EntityList<JsonEntity> subscriberList = getSubscriberManagementService().getSubscribers();
        if (!subscriberList.isEmpty()) {
          JsonEntity subscriber = subscriberList.get(0);
          long id = subscriber.getAsLong("Id");
         
           
            String subscriberId = "" + id;
          EntityList<JsonEntity> workflowList = getWorkflowService().getWorkflowsBySubscriberId(subscriberId, 1, 50);
          System.out.println("Subscriber: "+subscriberId);
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

        registerCustomer();
        String subscriberId = addSubscriber();

        SubscriberManagementService subscriberManagement = getSubscriberManagementService();
       
        JsonEntity jsonEntity = subscriberManagement.getSubscriberById(subscriberId);
      Assert.assertNotNull("Unable to retrieve subscriber: "+subscriberId, jsonEntity);
      Assert.assertEquals(subscriberId, subscriberManagement.getSubscriberId(jsonEntity.getJsonObject()));

      subscriberManagement.activateSubscriber(subscriberId);
     
      jsonEntity = subscriberManagement.getSubscriberById(subscriberId);
      Assert.assertNotNull("Unable to retrieve activated subscriber: "+subscriberId, jsonEntity);
      Assert.assertEquals(subscriberId, subscriberManagement.getSubscriberId(jsonEntity.getJsonObject()));
       
      JsonJavaObject rootObject = jsonEntity.getJsonObject();
      Assert.assertNotNull("Unable to retrieve subscriber: "+subscriberId, rootObject);
     
      System.out.println(rootObject);
      JsonJavaObject subscriberObject = rootObject.getAsObject("Subscriber");
      System.out.println(subscriberObject);
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

    public void testGetSubscriberById() {
      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();
        Assert.fail("Error retrieving subscriber caused by: "+e.getMessage());       
      }
    }
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

    @Test
    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();
        Assert.fail("Error retrieving customer list caused by: "+e.getMessage());       
      }
    }
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

      try {
        String customerId = registerCustomer();

        CustomerManagementService customerManagement = getCustomerManagementService();
       
        JsonEntity jsonEntity = customerManagement.getCustomerById(customerId);
      Assert.assertNotNull("Unable to retrieve customer: "+customerId, jsonEntity);
      Assert.assertEquals(customerId, customerManagement.getCustomerId(jsonEntity.getJsonObject()));

      customerManagement.suspendCustomer(customerId);
     
      jsonEntity = customerManagement.getCustomerById(customerId);
      Assert.assertNotNull("Unable to retrieve customer: "+customerId, jsonEntity);
      JsonJavaObject rootObject = jsonEntity.getJsonObject();

      JsonJavaObject customerObject = rootObject.getAsObject("Customer");
      System.out.println(customerObject);
      Assert.assertNotNull("No SuspensionDate", customerObject.get("SuspensionDate"));
      Assert.assertEquals("SUSPENDED", customerObject.get("CustomerState"));
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

    @Test
    public void testChangePasswordBadRequest() {
      try {
        String subscriberId = addSubscriber();
        JsonEntity subscriber = getSubscriberById(subscriberId);
        String loginName = subscriber.getAsString("Subscriber/Person/EmailAddress");
        System.out.println(loginName);
       
        UserCredentialJsonBuilder userCredential = new UserCredentialJsonBuilder();
        userCredential.setNewPassword("new_password")
                .setConfirmPassword("new_passw0rd");
View Full Code Here

Examples of com.ibm.sbt.services.client.base.JsonEntity

    @Test
    public void testAssignRole() {
      try {
        String subscriberId = addSubscriber();
        JsonEntity subscriber = getSubscriberById(subscriberId);
        String loginName = subscriber.getAsString("Subscriber/Person/EmailAddress");
        System.out.println(loginName);
       
      AuthorizationService authorizationService = getAuthorizationService();
        String[] roles = authorizationService.getRoles(loginName);
      for (String role : roles) {
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.