Package com.streamreduce.rest.dto.response

Examples of com.streamreduce.rest.dto.response.ConnectionInventoryResponseDTO


                }

                // Make sure public inventory items do not have anything sensitive in them
                String rawResponse = makeRequest(connectionsBaseUrl + "/" + connection.getId() + "/inventory", "GET",
                        null, authnToken);
                ConnectionInventoryResponseDTO responseDTO =
                        jsonToObject(rawResponse,
                                TypeFactory.defaultInstance().constructType(ConnectionInventoryResponseDTO.class));

                for (InventoryItemResponseDTO inventoryItem : responseDTO.getInventoryItems()) {
                    BasicDBObject payload = inventoryItem.getPayload();

                    Assert.assertFalse(JSONObject.fromObject(payload).toString().contains(awsAccessKeyId));
                    Assert.assertFalse(JSONObject.fromObject(payload).toString().contains(awsSecretKey));
                    Assert.assertFalse(payload.containsField("adminPassword"));
View Full Code Here


        NodeMetadata newNode = createDummyAWSEC2Node(cloud, testJcloudsInstanceGroup);

        refreshCloudInventoryItemCache(connectionService.getConnection(cloud.getId()), authnToken);

        String cloudInventoryUrl = connectionsBaseUrl + "/" + cloud.getId() + "/inventory";
        ConnectionInventoryResponseDTO cloudInventory =
                jsonToObject(makeRequest(cloudInventoryUrl, "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(ConnectionInventoryResponseDTO.class));

        InventoryItemResponseDTO originalDTO = null;

        for (InventoryItemResponseDTO inventoryItem : cloudInventory.getInventoryItems()) {
            if (inventoryItem.getExternalId().equals(newNode.getProviderId())) {
                originalDTO = inventoryItem;
                // Default name for nodes without name is the node id
                assertEquals(inventoryItem.getExternalId(), inventoryItem.getAlias());
                break;
View Full Code Here

        NodeMetadata newNode = createDummyAWSEC2Node(cloud, testJcloudsInstanceGroup);

        refreshCloudInventoryItemCache(connectionService.getConnection(cloud.getId()), authnToken);

        String cloudInventoryUrl = connectionsBaseUrl + "/" + cloud.getId() + "/inventory";
        ConnectionInventoryResponseDTO cloudInventory =
                jsonToObject(makeRequest(cloudInventoryUrl, "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(ConnectionInventoryResponseDTO.class));

        InventoryItemResponseDTO iiDTO = null;

        for (InventoryItemResponseDTO inventoryItem : cloudInventory.getInventoryItems()) {
            if (inventoryItem.getExternalId().equals(newNode.getProviderId())) {
                iiDTO = inventoryItem;
                break;
            }
        }

        assertNotNull(iiDTO);

        String currentState =  iiDTO.getPayload().getString("state");

        assertEquals(NodeState.RUNNING.toString(), currentState);

        assertEquals("200",
                makeRequest(inventoryItemBaseUrl + "/" +  iiDTO.getId() + "/reboot", "PUT", null, authnToken));

        cloudInventory = jsonToObject(makeRequest(cloudInventoryUrl, "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(InventoryItemResponseDTO.class));


        for (InventoryItemResponseDTO inventoryItem : cloudInventory.getInventoryItems()) {
            if (inventoryItem.getExternalId().equals(newNode.getProviderId())) {
                iiDTO = inventoryItem;
                break;
            }
        }

        // There is no good way to test a reboot since it seems that these node reboots are too fast to see a state
        // change so just ensure they are running after reboot.
        currentState =  iiDTO.getPayload().getString("state");

        assertEquals(NodeState.RUNNING.toString(), currentState);

        // Destroy the node
        makeRequest(inventoryItemBaseUrl + "/" +  iiDTO.getId(), "DELETE", null, authnToken);

        cloudInventory = jsonToObject(makeRequest(cloudInventoryUrl, "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(ConnectionInventoryResponseDTO.class));


        for (InventoryItemResponseDTO inventoryItem : cloudInventory.getInventoryItems()) {
            if (inventoryItem.getExternalId().equals(newNode.getProviderId())) {
                assertEquals(NodeState.TERMINATED.toString(), inventoryItem.getPayload().getString("state"));
                break;
            }
        }
View Full Code Here

        NodeMetadata newNode = createDummyAWSEC2Node(cloud, testJcloudsInstanceGroup);

        refreshCloudInventoryItemCache(connectionService.getConnection(cloud.getId()), authnToken);

        String cloudInventoryUrl = connectionsBaseUrl + "/" + cloud.getId() + "/inventory";
        ConnectionInventoryResponseDTO cloudInventory =
                jsonToObject(makeRequest(cloudInventoryUrl, "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(ConnectionInventoryResponseDTO.class));

        InventoryItemResponseDTO inventoryItemDTO = null;

        for (InventoryItemResponseDTO inventoryItem : cloudInventory.getInventoryItems()) {
            if (inventoryItem.getExternalId().equals(newNode.getProviderId())) {
                inventoryItemDTO = inventoryItem;
                break;
            }
        }
View Full Code Here

TOP

Related Classes of com.streamreduce.rest.dto.response.ConnectionInventoryResponseDTO

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.