use of org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable in project camel-quarkus by apache.
the class NatsTest method tlsAuthProduceConsumeRoundTripShouldSucceed.
@Test
@EnabledIfEnvironmentVariable(named = "ENABLE_TLS_TESTS", matches = "true")
void tlsAuthProduceConsumeRoundTripShouldSucceed() {
Header header = new Header("sendToEndpointUri", "natsTlsAuth:test?sslContextParameters=#ssl&secure=true");
given().when().header(header).body("tls-auth-msg").post("/nats/send").then().statusCode(204);
await().atMost(10L, TimeUnit.SECONDS).until(() -> {
return given().get("/nats/messages/tls-auth").path("size()").equals(1);
});
String[] messages = given().get("/nats/messages/tls-auth").then().statusCode(200).extract().as(String[].class);
assertEquals(1, messages.length);
assertEquals("tls-auth-msg", messages[0]);
}
use of org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable in project nfdiv-case-api by hmcts.
the class SystemNotifyApplicantDisputeFormOverdueFT method shouldSearchForDisputeFormOverdueCases.
@Test
@EnabledIfEnvironmentVariable(named = "ELASTIC_SEARCH_ENABLED", matches = "true")
public void shouldSearchForDisputeFormOverdueCases() {
final BoolQueryBuilder query = boolQuery().must(matchQuery(STATE, Holding)).must(matchQuery(AOS_RESPONSE, DISPUTE_DIVORCE.getType())).filter(rangeQuery(ISSUE_DATE).lte(LocalDate.now().minusDays(disputeDueDateOffsetDays))).mustNot(matchQuery(String.format(DATA, NOTIFICATION_SENT_FLAG), YesOrNo.YES));
searchForCasesWithQuery(query).forEach(caseDetails -> {
assertThat(caseDetails.getState().equals(Holding));
CaseData caseData = getCaseData(caseDetails.getData());
assertThat(DISPUTE_DIVORCE.getType().equals(caseData.getAcknowledgementOfService().getHowToRespondApplication()));
assertThat(caseData.getApplication().getIssueDate().plusDays(10)).isBeforeOrEqualTo(LocalDate.now());
assertThat(caseData.getAcknowledgementOfService().getApplicantNotifiedDisputeFormOverdue()).isNotEqualTo(YesOrNo.YES);
});
}
use of org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable in project nfdiv-case-api by hmcts.
the class SystemProgressHeldCasesFT method shouldSearchForCasesWhereHoldingPeriodHasEnded.
@Test
@EnabledIfEnvironmentVariable(named = "ELASTIC_SEARCH_ENABLED", matches = "true")
public void shouldSearchForCasesWhereHoldingPeriodHasEnded() {
final BoolQueryBuilder query = boolQuery().must(matchQuery(STATE, Holding)).filter(rangeQuery(CcdSearchService.DUE_DATE).lte(LocalDate.now()));
searchForCasesWithQuery(query).forEach(caseDetails -> {
CaseData caseData = getCaseData(caseDetails.getData());
assertThat(caseDetails.getState().equals(Holding));
assertThat(caseData.getDueDate()).isBeforeOrEqualTo(LocalDate.now());
});
}
use of org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable in project blackduck-alert by blackducksoftware.
the class LargeNotificationTest method largePolicyNotificationTest.
@Test
@EnabledIfEnvironmentVariable(named = "ALERT_RUN_PERFORMANCE", matches = "true")
void largePolicyNotificationTest() throws IntegrationException, InterruptedException {
LocalDateTime startingTime = LocalDateTime.now();
logger.info(String.format("Starting time: %s", dateTimeFormatter.format(startingTime)));
JiraServerGlobalConfigModel jiraServerGlobalConfigModel = jiraServerPerformanceUtility.createGlobalConfigModel(testProperties);
// Create Black Duck Global Provider configuration
LocalDateTime startingProviderCreateTime = LocalDateTime.now();
String blackDuckProviderID = blackDuckProviderService.setupBlackDuck();
logTimeElapsedWithMessage("Setting up the Black Duck provider took %s", startingProviderCreateTime, LocalDateTime.now());
// Create Jira Server global config
LocalDateTime startingCreateGlobalConfigTime = LocalDateTime.now();
JiraServerGlobalConfigModel globalConfiguration = jiraServerPerformanceUtility.createJiraGlobalConfiguration(jiraServerGlobalConfigModel);
logTimeElapsedWithMessage("Installing the jira server plugin and creating global configuration took %s", startingCreateGlobalConfigTime, LocalDateTime.now());
// Create distribution job fields
Map<String, FieldValueModel> channelFieldsMap = jiraServerPerformanceUtility.createChannelFieldsMap(testProperties, DEFAULT_JOB_NAME, globalConfiguration.getId());
// Clear existing policies
PolicyRuleView policyRuleView = blackDuckProviderService.createBlackDuckPolicyRuleView(PERFORMANCE_POLICY_NAME, BlackDuckProviderService.getDefaultExternalIdSupplier());
blackDuckProviderService.deleteExistingBlackDuckPolicy(policyRuleView);
// Create N number of Blackduck projects and add a vulnerable component to each
// Note: Setup for this test can take anywhere from 5-20 minutes depending on the instance of Blackduck. By pre-populating the server
// with projects and components using 'createProjectsAndNotificationsTest' the code below can be skipped.
/*
LocalDateTime startingProjectCreationTime = LocalDateTime.now();
for (int index = 1; index <= NUMBER_OF_PROJECTS_TO_CREATE; index++) {
ProjectVersionWrapper projectVersionWrapper = createBlackDuckProject(index);
triggerBlackDuckNotification(projectVersionWrapper.getProjectVersionView());
}
String createProjectsLogMessage = String.format("Creating %s projects took", NUMBER_OF_PROJECTS_TO_CREATE);
logTimeElapsedWithMessage(String.format("%s %s", createProjectsLogMessage, "%s"), startingProjectCreationTime, LocalDateTime.now());
*/
LocalDateTime executionStartTime = LocalDateTime.now();
testRunner.runPolicyNotificationTest(channelFieldsMap, "performanceJob", blackDuckProviderID, PERFORMANCE_POLICY_NAME, numberOfProjectsToCreate, true);
logTimeElapsedWithMessage("Execution and processing test time: %s", executionStartTime, LocalDateTime.now());
logTimeElapsedWithMessage("Total test time: %s", startingTime, LocalDateTime.now());
}
use of org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable in project blackduck-alert by blackducksoftware.
the class LargeNotificationTest method deleteProjectsAndVersionsTest.
@Test
@EnabledIfEnvironmentVariable(named = "ALERT_RUN_PERFORMANCE", matches = "true")
void deleteProjectsAndVersionsTest() throws IntegrationException {
LocalDateTime startingTime = LocalDateTime.now();
logger.info(String.format("Starting time: %s", dateTimeFormatter.format(startingTime)));
// Create Black Duck Global Provider configuration
LocalDateTime startingProviderCreateTime = LocalDateTime.now();
blackDuckProviderService.setupBlackDuck();
logTimeElapsedWithMessage("Setting up the Black Duck provider took %s", startingProviderCreateTime, LocalDateTime.now());
// create blackduck projects
deleteBlackDuckProjects(numberOfProjectsToCreate);
logTimeElapsedWithMessage("Total test time: %s", startingTime, LocalDateTime.now());
}
Aggregations