Package com.denimgroup.threadfix.remote

Examples of com.denimgroup.threadfix.remote.ThreadFixRestClient


    @Ignore
    @Test
    public void testTask() {
        String scannerList = "OWASP Zed Attack Proxy";
        ThreadFixRestClient client = new ThreadFixRestClientImpl(new TestPropertiesManager());

        RestResponse<Task> response = client.requestTask(scannerList, "");

        assertTrue(response != null && response.object != null);
    }
View Full Code Here


        JsonTestUtils.assertHasFields(response, teamFields);
    }

    @Test
    public void testFindTeamIdFormat() {
        ThreadFixRestClient client = TestUtils.getConfiguredClient();

        RestResponse<Organization> response = client.createTeam(TestUtils.getRandomName());

        response = client.searchForTeamById(JsonTestUtils.getId(response));

        JsonTestUtils.assertHasFields(response, teamFields);
    }
View Full Code Here

        JsonTestUtils.assertHasFields(response, teamFields);
    }

    @Test
    public void testFindTeamNameFormat() {
        ThreadFixRestClient client = TestUtils.getConfiguredClient();

        RestResponse<Organization> response = client.createTeam(TestUtils.getRandomName());

        response = client.searchForTeamByName(String.valueOf(response.object.getName()));

        JsonTestUtils.assertHasFields(response, teamFields);
    }
View Full Code Here

        JsonTestUtils.assertHasFields(response, teamFields);
    }

    @Test
    public void testAllTeams() {
        ThreadFixRestClient client = TestUtils.getConfiguredClient();

        RestResponse<Organization> response = client.createTeam(TestUtils.getRandomName());

        assert response.getOriginalJson() != null : "Json was null.";
        assert response.success : "Failed to create a team. Check the configured credentials. Json was " + response.getOriginalJson();

        RestResponse<Organization[]> teamsResponse = client.getAllTeams();

        JsonTestUtils.assertIsArrayWithFields(teamsResponse, teamFields);
    }
View Full Code Here

    }

    // assert that applications in activeApplications get just name and id fields
    @Test
    public void testTeamApplicationList() {
        ThreadFixRestClient client = TestUtils.getConfiguredClient();

        RestResponse<Organization> response = client.createTeam(TestUtils.getRandomName());

        client.createApplication(JsonTestUtils.getId(response),
                TestUtils.getRandomName(),
                "http://test");

        response = client.searchForTeamById(JsonTestUtils.getId(response));

        JsonTestUtils.assertHasArrayOfObjectsWithFields(response, "applications", "name", "id");
    }
View Full Code Here

    public static String getRandomName() {
        return RandomStringUtils.random(10, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
    }

    public static RestResponse<Application> createApplication() {
        ThreadFixRestClient client = getConfiguredClient();

        String teamId = JsonTestUtils.getId(client.createTeam(TestUtils.getRandomName()));

        RestResponse<Application> appNoScanResponse =
                getConfiguredClient().createApplication(teamId, getRandomName(), "http://test");

        assert appNoScanResponse != null;
View Full Code Here

        return scanFileUrl.getFile();
    }

    public static RestResponse<Application> createApplicationWithScan() {
        ThreadFixRestClient client = getConfiguredClient();

        String teamName = TestUtils.getRandomName();

        String teamId = JsonTestUtils.getId(client.createTeam(teamName));

        RestResponse<Application> appNoScanResponse =
                getConfiguredClient().createApplication(teamId, getRandomName(), "http://test");

        assert appNoScanResponse != null;
View Full Code Here

TOP

Related Classes of com.denimgroup.threadfix.remote.ThreadFixRestClient

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.