Package com.streamreduce.rest.dto.response

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


    @Ignore
    public void testProjectHostingProvidersList() throws Exception {
        String projectHostingProvidersUrl = connectionsBaseUrl + "/providers/projecthosting";
        String authnToken = login(testUsername, testUsername);
        String response = makeRequest(projectHostingProvidersUrl, "GET", null, authnToken);
        ConnectionProvidersResponseDTO responseDTO = new ObjectMapper().readValue(response,
                ConnectionProvidersResponseDTO.class);
        List<String> expectedIds = new ArrayList<>(Arrays.asList("github","jira"));


        for (ConnectionProviderResponseDTO cprd : responseDTO.getProviders()) {
            if (cprd != null) {
                if (!expectedIds.contains(cprd.getId())) {
                    fail("Unexpected project hosting provider: " + cprd.getId());
                }
            }
View Full Code Here



    @Test
    @Ignore
    public void testAllProviders() throws Exception {
        ConnectionProvidersResponseDTO responseDTO = jsonToObject(makeRequest(connectionsBaseUrl + "/providers",
                "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(
                        ConnectionProvidersResponseDTO.class));
        //AWS, Github, Jira, RSS Feed, Generic Gateway, Pingdom and Twitter
        assertEquals(7, responseDTO.getProviders().size());
    }
View Full Code Here

    @Test
    @Ignore
    public void testAllProvidersNoShowAuthTypeParam() throws Exception {
        //Test that verifies authType information is left out of ConnectionProviderResponseDTO unless specified
        ConnectionProvidersResponseDTO responseDTO = jsonToObject(makeRequest(connectionsBaseUrl + "/providers",
                "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(
                        ConnectionProvidersResponseDTO.class));
        for (ConnectionProviderResponseDTO provider : responseDTO.getProviders()) {
            assertTrue(provider.getAuthTypes() == null);
        }
    }
View Full Code Here

    @Ignore
    public void testAllProvidersShowAuthTypeParam() throws Exception {
        //Test that verifies authType information is included in ConnectionProviderResponseDTO when showAuthTypes
        //is set to true
        String rawResponse = makeRequest(connectionsBaseUrl + "/providers?showAuthTypes=true", "GET", null, authnToken);
        ConnectionProvidersResponseDTO responseDTO = jsonToObject(rawResponse,
                                                                  TypeFactory.defaultInstance().constructType(
                                                                          ConnectionProvidersResponseDTO.class));
        for (ConnectionProviderResponseDTO provider : responseDTO.getProviders()) {
            assertTrue(provider.getAuthTypes() != null);
            assertTrue(provider.getAuthTypes().getAuthTypes().size() != 0);
        }
    }
View Full Code Here

    @Test
    @Ignore
    public void testCloudAwsProviderWithAuthTypeParam() throws Exception {
        //Test that a proper response is returned for /api/connections/providers/cloud
        //
        ConnectionProvidersResponseDTO responseDTO = jsonToObject(makeRequest(connectionsBaseUrl + "/providers/cloud?showAuthTypes=true",
                "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(
                        ConnectionProvidersResponseDTO.class));
        assertTrue(responseDTO.getProviders().size() == 1);

        ConnectionProviderResponseDTO awsProvider = responseDTO.getProviders().get(0);
        assertEquals("aws", awsProvider.getId());

        List<AuthTypeResponseDTO> authTypes = awsProvider.getAuthTypes().getAuthTypes();
        assertEquals(1, authTypes.size());
        assertEquals(AuthType.USERNAME_PASSWORD.toString(), authTypes.get(0).getType());
View Full Code Here

    @Test
    @Ignore
    public void testFeedRssProviderWithAuthTypeParam() throws Exception {
        //Test that a proper response is returned for /api/connections/providers/cloud
        ConnectionProvidersResponseDTO responseDTO = jsonToObject(makeRequest(connectionsBaseUrl + "/providers/feed?showAuthTypes=true",
                "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(
                        ConnectionProvidersResponseDTO.class));
        assertTrue(responseDTO.getProviders().size() == 1);

        ConnectionProviderResponseDTO feedProviders = responseDTO.getProviders().get(0);
        assertEquals("rss", feedProviders.getId());

        List<AuthTypeResponseDTO> authTypes = feedProviders.getAuthTypes().getAuthTypes();

        //These will fail with NoSuchElementExceptions if the criteria aren't met
View Full Code Here

    @Test
    @Ignore
    public void testGithubProviderWithAuthTypeParam() throws Exception {
        //Test that a proper response is returned for /api/connections/providers/projecthosting for the the github id
        ConnectionProvidersResponseDTO responseDTO = jsonToObject(makeRequest(connectionsBaseUrl + "/providers/projecthosting?showAuthTypes=true",
                "GET", null, authnToken),
                TypeFactory.defaultInstance().constructType(
                        ConnectionProvidersResponseDTO.class));
        assertTrue(responseDTO.getProviders().size() == 2);

        ConnectionProviderResponseDTO githubProviderDTO = Iterables.find(responseDTO.getProviders(), new Predicate<ConnectionProviderResponseDTO>() {
            @Override
            public boolean apply(@Nullable ConnectionProviderResponseDTO input) {
                return input != null && input.getId().equals("github");
            }
        });
View Full Code Here

TOP

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

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.