Search in sources :

Example 1 with RecipeLoader

use of com.aws.greengrass.componentmanager.converter.RecipeLoader 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 RecipeLoader

use of com.aws.greengrass.componentmanager.converter.RecipeLoader 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)

Aggregations

RecipeLoader (com.aws.greengrass.componentmanager.converter.RecipeLoader)2 PlatformResolver (com.aws.greengrass.config.PlatformResolver)2 BeforeEach (org.junit.jupiter.api.BeforeEach)2 Topic (com.aws.greengrass.config.Topic)1 NucleusPaths (com.aws.greengrass.util.NucleusPaths)1