Search in sources :

Example 1 with PlatformResolver

use of com.aws.greengrass.config.PlatformResolver in project aws-greengrass-nucleus by aws-greengrass.

the class ComponentStoreTest method beforeEach.

@BeforeEach
void beforeEach() throws IOException {
    platformResolver = new PlatformResolver(null);
    recipeLoader = new RecipeLoader(platformResolver);
    nucleusPaths = new NucleusPaths();
    nucleusPaths.setComponentStorePath(packageStoreRootPath);
    componentStore = new ComponentStore(nucleusPaths, platformResolver, recipeLoader);
    recipeDirectory = packageStoreRootPath.resolve("recipes");
    artifactDirectory = packageStoreRootPath.resolve("artifacts");
    artifactsUnpackDirectory = packageStoreRootPath.resolve("artifacts-unarchived");
}
Also used : PlatformResolver(com.aws.greengrass.config.PlatformResolver) NucleusPaths(com.aws.greengrass.util.NucleusPaths) RecipeLoader(com.aws.greengrass.componentmanager.converter.RecipeLoader) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with PlatformResolver

use of com.aws.greengrass.config.PlatformResolver in project aws-greengrass-nucleus by aws-greengrass.

the class ComponentManagerTest method beforeEach.

@BeforeEach
void beforeEach() throws Exception {
    PlatformResolver platformResolver = new PlatformResolver(null);
    recipeLoader = new RecipeLoader(platformResolver);
    lenient().when(artifactDownloader.downloadRequired()).thenReturn(true);
    lenient().when(artifactDownloader.checkDownloadable()).thenReturn(Optional.empty());
    lenient().when(artifactDownloader.checkComponentStoreSize()).thenReturn(true);
    lenient().when(artifactDownloader.canSetFilePermissions()).thenReturn(true);
    lenient().when(artifactDownloader.canUnarchiveArtifact()).thenReturn(true);
    lenient().when(artifactDownloaderFactory.getArtifactDownloader(any(), any(), any())).thenReturn(artifactDownloader);
    lenient().when(deviceConfiguration.isDeviceConfiguredToTalkToCloud()).thenReturn(true);
    Topic maxSizeTopic = Topic.of(context, COMPONENT_STORE_MAX_SIZE_BYTES, COMPONENT_STORE_MAX_SIZE_DEFAULT_BYTES);
    lenient().when(deviceConfiguration.getComponentStoreMaxSizeBytes()).thenReturn(maxSizeTopic);
    lenient().when(componentStore.getUsableSpace()).thenReturn(100_000_000L);
    componentManager = new ComponentManager(artifactDownloaderFactory, componentManagementServiceHelper, executor, componentStore, kernel, mockUnarchiver, deviceConfiguration, nucleusPaths);
}
Also used : PlatformResolver(com.aws.greengrass.config.PlatformResolver) Topic(com.aws.greengrass.config.Topic) RecipeLoader(com.aws.greengrass.componentmanager.converter.RecipeLoader) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 3 with PlatformResolver

use of com.aws.greengrass.config.PlatformResolver in project aws-greengrass-nucleus by aws-greengrass.

the class RecipeLoaderTest method setupRecipeLoader.

@BeforeEach
void setupRecipeLoader() {
    PlatformResolver platformResolver = new PlatformResolver(null);
    recipeLoader = new RecipeLoader(platformResolver);
}
Also used : PlatformResolver(com.aws.greengrass.config.PlatformResolver) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with PlatformResolver

use of com.aws.greengrass.config.PlatformResolver in project aws-greengrass-nucleus by aws-greengrass.

the class FleetStatusServiceTest method createFSS.

private FleetStatusService createFSS(int periodicUpdateIntervalSec) {
    PlatformResolver platformResolver = new PlatformResolver(null);
    FleetStatusService fleetStatusService = new FleetStatusService(config, mockMqttClient, mockDeploymentStatusKeeper, mockKernel, mockDeviceConfiguration, platformResolver, periodicUpdateIntervalSec);
    fleetStatusService.postInject();
    return fleetStatusService;
}
Also used : PlatformResolver(com.aws.greengrass.config.PlatformResolver)

Example 5 with PlatformResolver

use of com.aws.greengrass.config.PlatformResolver in project aws-greengrass-nucleus by aws-greengrass.

the class FleetStatusServiceTest method createFSS.

private FleetStatusService createFSS() {
    PlatformResolver platformResolver = new PlatformResolver(null);
    FleetStatusService fleetStatusService = new FleetStatusService(config, mockMqttClient, mockDeploymentStatusKeeper, mockKernel, mockDeviceConfiguration, platformResolver);
    fleetStatusService.postInject();
    return fleetStatusService;
}
Also used : PlatformResolver(com.aws.greengrass.config.PlatformResolver)

Aggregations

PlatformResolver (com.aws.greengrass.config.PlatformResolver)8 BeforeEach (org.junit.jupiter.api.BeforeEach)4 RecipeLoader (com.aws.greengrass.componentmanager.converter.RecipeLoader)2 ComponentRecipe (com.aws.greengrass.componentmanager.models.ComponentRecipe)2 Topics (com.aws.greengrass.config.Topics)2 DeviceConfiguration (com.aws.greengrass.deployment.DeviceConfiguration)2 HashMap (java.util.HashMap)2 Test (org.junit.jupiter.api.Test)2 Topic (com.aws.greengrass.config.Topic)1 NucleusPaths (com.aws.greengrass.util.NucleusPaths)1