Search in sources :

Example 1 with IntegrationTestContext

use of com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext in project sechub by mercedes-benz.

the class IntegrationTestAction method checkIntegrationTestServerRunning.

private boolean checkIntegrationTestServerRunning() {
    IntegrationTestContext integrationTestContext = IntegrationTestContext.get();
    integrationTestContext.setHostname(getContext().getServer());
    integrationTestContext.setPort(getContext().getPort());
    String isAliveURL = integrationTestContext.getUrlBuilder().buildIntegrationTestIsAliveUrl();
    if (!Boolean.TRUE.equals(IntegrationTestSetup.fetchTestServerStatus(isAliveURL))) {
        warn("You are not running an integration test server, so cannot exeucte action!");
        return false;
    }
    return true;
}
Also used : IntegrationTestContext(com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext)

Example 2 with IntegrationTestContext

use of com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext in project sechub by mercedes-benz.

the class DeveloperAdministration method updateTestAPIServerConnection.

/**
 * Will update test API server connection data - makes it possible to use
 * directly test API methods without writing duplicates for developer admin ui
 * (faster development)
 *
 * @param server
 * @param portNumber
 */
public void updateTestAPIServerConnection(String server, int portNumber) {
    IntegrationTestContext integrationTestContext = IntegrationTestContext.get();
    integrationTestContext.setHostname(server);
    integrationTestContext.setPort(portNumber);
    integrationTestContext.rebuild();
}
Also used : IntegrationTestContext(com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext)

Example 3 with IntegrationTestContext

use of com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext in project sechub by mercedes-benz.

the class EventInspectionAPI method fetchMap.

public static Map<String, String> fetchMap() {
    IntegrationTestContext context = IntegrationTestContext.get();
    String url = context.getUrlBuilder().buildIntegrationTestFetchEventInspectionStatus();
    String json = context.getSuperAdminRestHelper().getJSON(url);
    @SuppressWarnings("unchecked") Map<String, String> map = JSONConverter.get().fromJSON(Map.class, json);
    return map;
}
Also used : IntegrationTestContext(com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext)

Example 4 with IntegrationTestContext

use of com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext in project sechub by mercedes-benz.

the class DeveloperAdministration method updateTestAPISuperAdmin.

public void updateTestAPISuperAdmin(String userId, String apiToken) {
    IntegrationTestContext integrationTestContext = IntegrationTestContext.get();
    integrationTestContext.setSuperAdminUser(new FixedTestUser(userId, apiToken));
    integrationTestContext.rebuild();
}
Also used : IntegrationTestContext(com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext) FixedTestUser(com.mercedesbenz.sechub.integrationtest.api.FixedTestUser)

Example 5 with IntegrationTestContext

use of com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext in project sechub by mercedes-benz.

the class PDSServerEncryptionTest method beforeAll.

@BeforeAll
static void beforeAll() throws Exception {
    IntegrationTestContext context = IntegrationTestContext.get();
    String checkAlive = context.getPDSUrlBuilder().buildCheckIsAliveUrl();
    securityTestHelper = new SecurityTestHelper(TestTargetType.PDS_SERVER, new URL(checkAlive));
}
Also used : IntegrationTestContext(com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext) SecurityTestHelper(com.mercedesbenz.sechub.integrationtest.SecurityTestHelper) URL(java.net.URL) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

IntegrationTestContext (com.mercedesbenz.sechub.integrationtest.internal.IntegrationTestContext)6 SecurityTestHelper (com.mercedesbenz.sechub.integrationtest.SecurityTestHelper)2 URL (java.net.URL)2 BeforeAll (org.junit.jupiter.api.BeforeAll)2 FixedTestUser (com.mercedesbenz.sechub.integrationtest.api.FixedTestUser)1