Search in sources :

Example 21 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry 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"));
}
Also used : BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Example 22 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class DiagnosticsCollectionValidatorTest method testValidateWithSupportDestination.

@Test
void testValidateWithSupportDestination() {
    BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
    request.setDestination(DiagnosticsDestination.SUPPORT);
    Telemetry telemetry = new Telemetry();
    BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStack(), telemetry));
    assertTrue(thrown.getMessage().contains("Destination SUPPORT is not supported yet."));
}
Also used : BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Example 23 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class DiagnosticsCollectionValidatorTest method testValidateWithInvalidEngDestination.

@Test
void testValidateWithInvalidEngDestination() {
    BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
    request.setDestination(DiagnosticsDestination.ENG);
    Telemetry telemetry = new Telemetry();
    BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStack(), telemetry));
    assertTrue(thrown.getMessage().contains("Cluster log collection is not enabled for Data Hub"));
}
Also used : BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Example 24 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class DiiagnosticsCollectionValidatorTest 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, createStackWithTelemetry(telemetry));
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Example 25 with Telemetry

use of com.sequenceiq.common.api.telemetry.model.Telemetry in project cloudbreak by hortonworks.

the class DiiagnosticsCollectionValidatorTest method testValidateWithInvalidEngDestination.

@Test
void testValidateWithInvalidEngDestination() {
    BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
    request.setDestination(DiagnosticsDestination.ENG);
    Telemetry telemetry = new Telemetry();
    BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStackWithTelemetry(telemetry)));
    assertTrue(thrown.getMessage().contains("Cluster log collection is not enabled for FreeIPA"));
}
Also used : BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Aggregations

Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)109 Test (org.junit.Test)55 Test (org.junit.jupiter.api.Test)31 Logging (com.sequenceiq.common.api.telemetry.model.Logging)30 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)20 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)16 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)15 BaseDiagnosticsCollectionRequest (com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest)13 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)12 Backup (com.sequenceiq.freeipa.api.model.Backup)12 HashMap (java.util.HashMap)12 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)11 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)10 Features (com.sequenceiq.common.api.telemetry.model.Features)10 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)8 SaltPillarProperties (com.sequenceiq.cloudbreak.orchestrator.model.SaltPillarProperties)8 ApiClient (com.cloudera.api.swagger.client.ApiClient)7 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)7 WorkloadAnalytics (com.sequenceiq.common.api.telemetry.model.WorkloadAnalytics)6 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)6