use of com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest method testWithValidEngDestination.
@Test
void testWithValidEngDestination() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.ENG);
StackV4Response stackV4Response = new StackV4Response();
stackV4Response.setCrn(DATALAKE_CRN);
TelemetryResponse telemetry = new TelemetryResponse();
FeaturesResponse features = new FeaturesResponse();
FeatureSetting featureSetting = new FeatureSetting();
featureSetting.setEnabled(true);
features.setClusterLogsCollection(featureSetting);
telemetry.setFeatures(features);
stackV4Response.setTelemetry(telemetry);
underTest.validate(request, stackV4Response);
}
use of com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest method testWithCloudStorageWithDisabledLogging.
@Test
void testWithCloudStorageWithDisabledLogging() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.CLOUD_STORAGE);
StackV4Response stackV4Response = new StackV4Response();
stackV4Response.setCrn(DATALAKE_CRN);
TelemetryResponse telemetry = new TelemetryResponse();
stackV4Response.setTelemetry(telemetry);
BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, stackV4Response));
assertTrue(thrown.getMessage().contains("Cloud storage logging is disabled for Data Lake"));
}
use of com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest method testWithEngDestinationAndDisabledLogCollection.
@Test
void testWithEngDestinationAndDisabledLogCollection() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.ENG);
StackV4Response stackV4Response = new StackV4Response();
stackV4Response.setCrn(DATALAKE_CRN);
TelemetryResponse telemetry = new TelemetryResponse();
stackV4Response.setTelemetry(telemetry);
BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, stackV4Response));
assertTrue(thrown.getMessage().contains("Cluster log collection is not enabled for Data Lake"));
}
use of com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest method testValidateWithValidCloudStorage.
@Test
void testValidateWithValidCloudStorage() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.CLOUD_STORAGE);
Telemetry telemetry = new Telemetry();
Logging logging = new Logging();
logging.setS3(new S3CloudStorageV1Parameters());
telemetry.setLogging(logging);
underTest.validate(request, createStack(), telemetry);
}
use of com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest in project cloudbreak by hortonworks.
the class DiagnosticsCollectionValidatorTest method testValidateWithCloudStorageWithEmptyTelemetry.
@Test
void testValidateWithCloudStorageWithEmptyTelemetry() {
BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
request.setDestination(DiagnosticsDestination.CLOUD_STORAGE);
Telemetry telemetry = new Telemetry();
BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStack(), telemetry));
assertTrue(thrown.getMessage().contains("Cloud storage logging is disabled for Data Hub"));
}
Aggregations