Examples of ThreadFixRestClient


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

Examples of com.denimgroup.threadfix.remote.ThreadFixRestClient

        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

Examples of com.denimgroup.threadfix.remote.ThreadFixRestClient

        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

Examples of com.denimgroup.threadfix.remote.ThreadFixRestClient

        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

Examples of com.denimgroup.threadfix.remote.ThreadFixRestClient

    }

    // 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

Examples of com.denimgroup.threadfix.remote.ThreadFixRestClient

    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

Examples of com.denimgroup.threadfix.remote.ThreadFixRestClient

        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
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.