use of com.synopsys.integration.blackduck.dockerinspector.ProcessId in project blackduck-docker-inspector by blackducksoftware.
the class ContainerPathsTest method doTest.
private void doTest(String sharedDirPathLocal, String sharedDirPathContainer, String targetFilePathLocal) throws IOException {
Config config = Mockito.mock(Config.class);
Mockito.when(config.getSharedDirPathLocal()).thenReturn(sharedDirPathLocal);
Mockito.when(config.getSharedDirPathImageInspector()).thenReturn(sharedDirPathContainer);
Mockito.when(config.getWorkingDirPath()).thenReturn(sharedDirPathLocal);
ProcessId processId = Mockito.mock(ProcessId.class);
Mockito.when(processId.addProcessIdToName("run")).thenReturn("run_1");
ProgramPaths programPaths = new ProgramPaths(config, processId);
ContainerPaths containerPaths = new ContainerPaths(config, programPaths);
String containerPathToTargetFile = containerPaths.getContainerPathToTargetFile(targetFilePathLocal);
assertEquals(CONTAINER_PATH_TO_TARGET_FILE, containerPathToTargetFile);
String containerPathToOutputFile = containerPaths.getContainerPathToOutputFile("test_out.tar");
assertEquals(CONTAINER_PATH_TO_OUTPUT_FILE, containerPathToOutputFile);
}
use of com.synopsys.integration.blackduck.dockerinspector.ProcessId in project blackduck-docker-inspector by blackducksoftware.
the class SquashedImageTest method setUp.
@BeforeAll
static void setUp() throws IOException {
Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
rootLogger.setLevel(Level.INFO);
Logger integrationLogger = (Logger) LoggerFactory.getLogger("com.synopsys.integration");
integrationLogger.setLevel(Level.DEBUG);
testWorkingDir = new File("test/output/squashingTest");
ImageTarFilename imageTarFilename = new ImageTarFilename();
FileOperations fileOperations = new FileOperations();
Config config = Mockito.mock(Config.class);
Mockito.when(config.getWorkingDirPath()).thenReturn(testWorkingDir.getCanonicalPath());
ProgramPaths programPaths = new ProgramPaths(config, new ProcessId());
dockerClientManager = new DockerClientManager(fileOperations, new ImageNameResolver(), config, imageTarFilename, programPaths);
squashedImage = new SquashedImage();
squashedImage.setDockerClientManager(dockerClientManager);
squashedImage.setFileOperations(new FileOperations());
}
Aggregations