Search in sources :

Example 1 with SmartSenseSubscription

use of com.sequenceiq.cloudbreak.domain.SmartSenseSubscription in project cloudbreak by hortonworks.

the class SmartsenseConfigurationLocatorTest method before.

@Before
public void before() {
    SmartSenseSubscription smartSenseSubscription = new SmartSenseSubscription();
    smartSenseSubscription.setSubscriptionId(smartsenseId);
    defaultSmartsenseSubscription = Optional.of(smartSenseSubscription);
}
Also used : SmartSenseSubscription(com.sequenceiq.cloudbreak.domain.SmartSenseSubscription) Before(org.junit.Before)

Example 2 with SmartSenseSubscription

use of com.sequenceiq.cloudbreak.domain.SmartSenseSubscription in project cloudbreak by hortonworks.

the class TestUtil method smartSenseSubscription.

public static SmartSenseSubscription smartSenseSubscription() {
    SmartSenseSubscription smartSenseSubscription = new SmartSenseSubscription();
    smartSenseSubscription.setSubscriptionId("1234-1234-1234-1244");
    smartSenseSubscription.setAccount("hortonworks");
    smartSenseSubscription.setOwner("hwx-user");
    smartSenseSubscription.setPublicInAccount(false);
    smartSenseSubscription.setId(1L);
    return smartSenseSubscription;
}
Also used : SmartSenseSubscription(com.sequenceiq.cloudbreak.domain.SmartSenseSubscription)

Example 3 with SmartSenseSubscription

use of com.sequenceiq.cloudbreak.domain.SmartSenseSubscription in project cloudbreak by hortonworks.

the class FlexSubscriptionRequestToFlexSubscriptionConverter method convert.

@Override
public FlexSubscription convert(FlexSubscriptionRequest source) {
    FlexSubscription subscription = new FlexSubscription();
    subscription.setName(source.getName());
    subscription.setSubscriptionId(source.getSubscriptionId());
    subscription.setDefault(source.getUsedAsDefault());
    subscription.setUsedForController(source.isUsedForController());
    Long smartSenseSubscriptionId = source.getSmartSenseSubscriptionId();
    try {
        SmartSenseSubscription smartSenseSubscription = smartSenseSubscriptionService.findOneById(smartSenseSubscriptionId);
        subscription.setSmartSenseSubscription(smartSenseSubscription);
    } catch (NotFoundException ignored) {
        throw new BadRequestException("SmartSense subscription could not be found with id: " + smartSenseSubscriptionId);
    }
    return subscription;
}
Also used : FlexSubscription(com.sequenceiq.cloudbreak.domain.FlexSubscription) SmartSenseSubscription(com.sequenceiq.cloudbreak.domain.SmartSenseSubscription) NotFoundException(com.sequenceiq.cloudbreak.controller.NotFoundException) BadRequestException(com.sequenceiq.cloudbreak.controller.BadRequestException)

Example 4 with SmartSenseSubscription

use of com.sequenceiq.cloudbreak.domain.SmartSenseSubscription in project cloudbreak by hortonworks.

the class SmartSenseSubscriptionRequestToSmartSenseSubscriptionConverter method convert.

@Override
public SmartSenseSubscription convert(SmartSenseSubscriptionJson source) {
    SmartSenseSubscription obj = new SmartSenseSubscription();
    obj.setSubscriptionId(source.getSubscriptionId());
    return obj;
}
Also used : SmartSenseSubscription(com.sequenceiq.cloudbreak.domain.SmartSenseSubscription)

Example 5 with SmartSenseSubscription

use of com.sequenceiq.cloudbreak.domain.SmartSenseSubscription in project cloudbreak by hortonworks.

the class SmartSenseSubscriptionControllerTest method createSmartSenseSubscription.

private SmartSenseSubscription createSmartSenseSubscription() {
    SmartSenseSubscription subscription = new SmartSenseSubscription();
    subscription.setSubscriptionId("A-99900000-C-00000000");
    subscription.setAccount("account id");
    subscription.setOwner("user id");
    subscription.setPublicInAccount(true);
    return subscription;
}
Also used : SmartSenseSubscription(com.sequenceiq.cloudbreak.domain.SmartSenseSubscription)

Aggregations

SmartSenseSubscription (com.sequenceiq.cloudbreak.domain.SmartSenseSubscription)24 Test (org.junit.Test)10 AmbariClient (com.sequenceiq.ambari.client.AmbariClient)3 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)3 SmartSenseSubscriptionJson (com.sequenceiq.cloudbreak.api.model.SmartSenseSubscriptionJson)2 FlexSubscription (com.sequenceiq.cloudbreak.domain.FlexSubscription)2 FlexUsageControllerJson (com.sequenceiq.cloudbreak.api.model.flex.FlexUsageControllerJson)1 BlueprintProcessingException (com.sequenceiq.cloudbreak.blueprint.BlueprintProcessingException)1 HdfConfigs (com.sequenceiq.cloudbreak.blueprint.nifi.HdfConfigs)1 BlueprintView (com.sequenceiq.cloudbreak.blueprint.template.views.BlueprintView)1 FileSystemConfigurationView (com.sequenceiq.cloudbreak.blueprint.template.views.FileSystemConfigurationView)1 BlueprintStackInfo (com.sequenceiq.cloudbreak.blueprint.templates.BlueprintStackInfo)1 StackRepoDetails (com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails)1 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)1 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)1 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)1 FileSystem (com.sequenceiq.cloudbreak.domain.FileSystem)1 LdapConfig (com.sequenceiq.cloudbreak.domain.LdapConfig)1 CloudbreakServiceException (com.sequenceiq.cloudbreak.service.CloudbreakServiceException)1 IOException (java.io.IOException)1