use of com.synopsys.integration.blackduck.dockerinspector.config.Config in project blackduck-docker-inspector by blackducksoftware.
the class DockerClientManagerTest method setUp.
@BeforeAll
public static void setUp() {
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);
config = Mockito.mock(Config.class);
programPaths = Mockito.mock(ProgramPaths.class);
FileOperations fileOperations = new FileOperations();
dockerClientManager = new DockerClientManager(fileOperations, new ImageNameResolver(), config, new ImageTarFilename(), programPaths);
}
use of com.synopsys.integration.blackduck.dockerinspector.config.Config 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.config.Config in project blackduck-docker-inspector by blackducksoftware.
the class ProgramPathsTest method setup.
@BeforeClass
public static void setup() throws IOException {
config = Mockito.mock(Config.class);
processId = Mockito.mock(ProcessId.class);
Mockito.when(processId.addProcessIdToName(Mockito.anyString())).thenReturn("run_1");
final File installDir = TestUtils.createTempDirectory();
installDirPath = installDir.getAbsolutePath();
Mockito.when(config.getWorkingDirPath()).thenReturn(installDirPath);
Mockito.when(processId.addProcessIdToName(Mockito.anyString())).thenReturn("test");
programPaths = new ProgramPaths(config, processId);
}
use of com.synopsys.integration.blackduck.dockerinspector.config.Config 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