Search in sources :

Example 6 with PreferenceManager

use of com.epam.pipeline.manager.preference.PreferenceManager in project cloud-pipeline by epam.

the class FolderManagerGetProjectTest method setUp.

@Before
public void setUp() {
    data.put(DATA_KEY_1, new PipeConfValue(DATA_TYPE_1, DATA_VALUE_1));
    dataWithIndicator.put(DATA_KEY_1, new PipeConfValue(DATA_TYPE_1, PROJECT_INDICATOR_VALUE));
    folder1 = initFolderWithMetadata(folder1, 1L, "folder1", null, data);
    folder2 = initFolderWithMetadata(folder2, 2L, "folder2", folder1.getId(), dataWithIndicator);
    folder3 = initFolderWithMetadata(folder3, 3L, "folder3", folder2.getId(), data);
    Mockito.when(folderDao.loadParentFolders(Matchers.any(Long.class))).thenReturn(Stream.of(folder1, folder2, folder3).collect(Collectors.toList()));
    PreferenceManager preferenceManager = mock(PreferenceManager.class);
    ReflectionTestUtils.setField(folderManager, "preferenceManager", preferenceManager);
    Mockito.when(preferenceManager.getPreference(SystemPreferences.UI_PROJECT_INDICATOR)).thenReturn("tag=project,other=indicator");
}
Also used : PipeConfValue(com.epam.pipeline.entity.metadata.PipeConfValue) PreferenceManager(com.epam.pipeline.manager.preference.PreferenceManager) Before(org.junit.Before)

Aggregations

PreferenceManager (com.epam.pipeline.manager.preference.PreferenceManager)6 Test (org.junit.Test)5 Preference (com.epam.pipeline.entity.preference.Preference)3 SystemPreferences (com.epam.pipeline.manager.preference.SystemPreferences)3 Before (org.junit.Before)3 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)2 MessageHelper (com.epam.pipeline.common.MessageHelper)2 PreferenceDao (com.epam.pipeline.dao.preference.PreferenceDao)2 ToolDaoTest (com.epam.pipeline.dao.tool.ToolDaoTest)2 ClairService (com.epam.pipeline.manager.docker.scan.clair.ClairService)2 AuthManager (com.epam.pipeline.manager.security.AuthManager)2 Assert (org.junit.Assert)2 Matchers.eq (org.mockito.Matchers.eq)2 Mock (org.mockito.Mock)2 Mockito (org.mockito.Mockito)2 Mockito.when (org.mockito.Mockito.when)2 MockitoAnnotations (org.mockito.MockitoAnnotations)2 Answer (org.mockito.stubbing.Answer)2 Transactional (org.springframework.transaction.annotation.Transactional)2 DataStorageFile (com.epam.pipeline.entity.datastorage.DataStorageFile)1