Package com.streamreduce.rest.dto.response

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


                        .build())
                .add("inbound", true)
                .build();

        Response createResponse = connectionResource.createConnection(connectionObject);
        ConnectionResponseDTO createConnectionResponseDTO = (ConnectionResponseDTO) createResponse.getEntity();
        Assert.assertNotNull(createConnectionResponseDTO);
    }
View Full Code Here


                        .array("dataTypes", "INSIGHT")
                        .build())
                .build();

        Response createResponse = connectionResource.createConnection(connectionObject);
        ConnectionResponseDTO createConnectionResponseDTO = (ConnectionResponseDTO) createResponse.getEntity();
        Assert.assertEquals(200, createResponse.getStatus());
        Response updateResponse = connectionResource.updateConnection(createConnectionResponseDTO.getId().toString(),
                updateObject);
        ErrorMessage errorMessage = (ErrorMessage) updateResponse.getEntity();
        Assert.assertEquals(errorMessage.getErrorMessage(), "The destination URL was invalid: no protocol: as/");
    }
View Full Code Here

                .build();

        Response createResponse = connectionResource.createConnection(connectionObject);

        Assert.assertEquals(200, createResponse.getStatus());
        ConnectionResponseDTO updateConnectionResponseDTO = (ConnectionResponseDTO) createResponse.getEntity();
        Assert.assertEquals(1, updateConnectionResponseDTO.getOutboundConfigurations().size());
        OutboundConfigurationResponseDTO outboundConfigurationResponseDTO =
                updateConnectionResponseDTO.getOutboundConfigurations().get(0);
        Assert.assertEquals(testBucketName, outboundConfigurationResponseDTO.getNamespace());
        Assert.assertEquals("us-west-2", outboundConfigurationResponseDTO.getDestination());
    }
View Full Code Here

                        .build())
                .build();


        Response createResponse = connectionResource.createConnection(createConnectionObject);
        ConnectionResponseDTO createConnectionResponseDTO = (ConnectionResponseDTO) createResponse.getEntity();

        Response updateResponse = connectionResource.updateConnection(createConnectionResponseDTO.getId().toString(),
                updateConnectionObject);
        Assert.assertEquals(200, updateResponse.getStatus());
        ConnectionResponseDTO updateConnectionResponseDTO = (ConnectionResponseDTO) updateResponse.getEntity();
        Assert.assertEquals(1, updateConnectionResponseDTO.getOutboundConfigurations().size());
        OutboundConfigurationResponseDTO outboundConfigurationResponseDTO =
                updateConnectionResponseDTO.getOutboundConfigurations().get(0);
        Assert.assertEquals(testBucketName, outboundConfigurationResponseDTO.getNamespace());
        Assert.assertEquals("us-west-2", outboundConfigurationResponseDTO.getDestination());
    }
View Full Code Here

        assertEquals(1, exceptionDTO.getViolations().keySet().size());

        json.put("description", "Valid description.");

        try {
            ConnectionResponseDTO connectionResponseDTO = jsonToObject(makeRequest(connectionsBaseUrl, "POST", json, authnToken),
                    TypeFactory.defaultInstance().constructType(ConnectionResponseDTO.class));
        } catch (Exception e) {
            fail("Should be able to create the feed now: " + e.getMessage());
        }
    }
View Full Code Here

                )
                .build();

        when(testResource.toFullDTO(any(Connection.class))).thenCallRealMethod();
        when(testResource.toOwnerDTO(any(Connection.class),any(ConnectionResponseDTO.class))).thenCallRealMethod();
        ConnectionResponseDTO dto = testResource.toFullDTO(c);

        //Test some fields
        Assert.assertEquals(AuthType.NONE, dto.getAuthType());
        Assert.assertEquals(c.getAlias(), dto.getAlias());
        Assert.assertEquals(c.getUrl(), dto.getUrl());

        List<OutboundConfigurationResponseDTO> outboundDTOs = dto.getOutboundConfigurations();
        Assert.assertEquals(1, outboundDTOs.size());
        Assert.assertEquals("s3", outboundDTOs.get(0).getProtocol());
        Assert.assertEquals("my.bucket.name", outboundDTOs.get(0).getDestination());
        Assert.assertEquals("/key/prefix/here/", outboundDTOs.get(0).getNamespace());
        Assert.assertEquals("PROCESSED", outboundDTOs.get(0).getDataTypes().get(0).toString());
View Full Code Here

        return dto;
    }

    protected ConnectionResponseDTO toFullDTO(Connection connection) {
        ConnectionResponseDTO dto = new ConnectionResponseDTO();

        // set user
        this.toOwnerDTO(connection, dto);

        dto.setType(connection.getType());
        dto.setUrl(connection.getUrl());
        dto.setProviderId(connection.getProviderId());
        dto.setAuthType(connection.getAuthType());
        dto.setOutboundConfigurations(OutboundConfigurationResponseDTO.toDTOs(connection.getOutboundConfigurations()));

        // return the identity for GMG connections only
        // TODO: this is really just to get the Autogenerated key... better way to do this?
        if (connection.getCredentials() != null && GatewayProvider.TYPE.equals(connection.getType()) && dto.isOwner()) {
            dto.setIdentity(connection.getCredentials().getIdentity());
        }
        return dto;
    }
View Full Code Here

TOP

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

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.