Search in sources :

Example 21 with MetadataEntry

use of com.epam.pipeline.entity.metadata.MetadataEntry in project cloud-pipeline by epam.

the class MetadataEntityLoaderTest method setup.

@BeforeEach
void setup() {
    EntityPermissionVO entityPermissionVO = buildEntityPermissionVO(USER_NAME, ALLOWED_USERS, DENIED_USERS, ALLOWED_GROUPS, DENIED_GROUPS);
    MetadataEntry metadataEntry = buildMetadataEntry(AclClass.METADATA_ENTITY, 1L, TEST_KEY + " " + TEST_VALUE);
    when(apiClient.loadPermissionsForEntity(anyLong(), any())).thenReturn(entityPermissionVO);
    when(apiClient.loadMetadataEntry(any())).thenReturn(Collections.singletonList(metadataEntry));
}
Also used : ObjectCreationUtils.buildEntityPermissionVO(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildEntityPermissionVO) EntityPermissionVO(com.epam.pipeline.vo.EntityPermissionVO) MetadataEntry(com.epam.pipeline.entity.metadata.MetadataEntry) ObjectCreationUtils.buildMetadataEntry(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildMetadataEntry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 22 with MetadataEntry

use of com.epam.pipeline.entity.metadata.MetadataEntry in project cloud-pipeline by epam.

the class PipelineLoaderTest method setup.

@BeforeEach
void setup() {
    EntityPermissionVO entityPermissionVO = buildEntityPermissionVO(USER_NAME, ALLOWED_USERS, DENIED_USERS, ALLOWED_GROUPS, DENIED_GROUPS);
    MetadataEntry metadataEntry = buildMetadataEntry(AclClass.PIPELINE, 1L, TEST_KEY + " " + TEST_VALUE);
    when(apiClient.loadUserByName(anyString())).thenReturn(USER);
    when(apiClient.loadPermissionsForEntity(anyLong(), any())).thenReturn(entityPermissionVO);
    when(apiClient.loadMetadataEntry(any())).thenReturn(Collections.singletonList(metadataEntry));
}
Also used : ObjectCreationUtils.buildEntityPermissionVO(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildEntityPermissionVO) EntityPermissionVO(com.epam.pipeline.vo.EntityPermissionVO) MetadataEntry(com.epam.pipeline.entity.metadata.MetadataEntry) ObjectCreationUtils.buildMetadataEntry(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildMetadataEntry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 23 with MetadataEntry

use of com.epam.pipeline.entity.metadata.MetadataEntry in project cloud-pipeline by epam.

the class DataStorageLoaderTest method setup.

@BeforeEach
void setup() {
    EntityPermissionVO entityPermissionVO = buildEntityPermissionVO(USER_NAME, ALLOWED_USERS, DENIED_USERS, ALLOWED_GROUPS, DENIED_GROUPS);
    MetadataEntry metadataEntry = buildMetadataEntry(AclClass.DATA_STORAGE, 1L, TEST_KEY + " " + TEST_VALUE);
    when(apiClient.loadUserByName(anyString())).thenReturn(USER);
    when(apiClient.loadPermissionsForEntity(anyLong(), any())).thenReturn(entityPermissionVO);
    when(apiClient.loadMetadataEntry(any())).thenReturn(Collections.singletonList(metadataEntry));
}
Also used : ObjectCreationUtils.buildEntityPermissionVO(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildEntityPermissionVO) EntityPermissionVO(com.epam.pipeline.vo.EntityPermissionVO) MetadataEntry(com.epam.pipeline.entity.metadata.MetadataEntry) ObjectCreationUtils.buildMetadataEntry(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildMetadataEntry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 24 with MetadataEntry

use of com.epam.pipeline.entity.metadata.MetadataEntry in project cloud-pipeline by epam.

the class ToolLoaderTest method setup.

@BeforeEach
void setup() {
    EntityPermissionVO entityPermissionVO = buildEntityPermissionVO(USER_NAME, ALLOWED_USERS, DENIED_USERS, ALLOWED_GROUPS, DENIED_GROUPS);
    MetadataEntry metadataEntry = buildMetadataEntry(AclClass.TOOL, 1L, TEST_KEY + " " + TEST_VALUE);
    when(apiClient.loadUserByName(anyString())).thenReturn(USER);
    when(apiClient.loadPermissionsForEntity(anyLong(), any())).thenReturn(entityPermissionVO);
    when(apiClient.loadMetadataEntry(any())).thenReturn(Collections.singletonList(metadataEntry));
}
Also used : ObjectCreationUtils.buildEntityPermissionVO(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildEntityPermissionVO) EntityPermissionVO(com.epam.pipeline.vo.EntityPermissionVO) MetadataEntry(com.epam.pipeline.entity.metadata.MetadataEntry) ObjectCreationUtils.buildMetadataEntry(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildMetadataEntry) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MetadataEntry (com.epam.pipeline.entity.metadata.MetadataEntry)24 EntityVO (com.epam.pipeline.controller.vo.EntityVO)12 Transactional (org.springframework.transaction.annotation.Transactional)10 ObjectCreationUtils.buildEntityPermissionVO (com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildEntityPermissionVO)9 ObjectCreationUtils.buildMetadataEntry (com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildMetadataEntry)9 EntityPermissionVO (com.epam.pipeline.vo.EntityPermissionVO)9 BeforeEach (org.junit.jupiter.api.BeforeEach)9 PipeConfValue (com.epam.pipeline.entity.metadata.PipeConfValue)7 AbstractSpringTest (com.epam.pipeline.AbstractSpringTest)4 HashMap (java.util.HashMap)4 Test (org.junit.Test)4 Folder (com.epam.pipeline.entity.pipeline.Folder)2 MetadataVO (com.epam.pipeline.controller.vo.MetadataVO)1 MetadataEntityVO (com.epam.pipeline.controller.vo.metadata.MetadataEntityVO)1 Issue (com.epam.pipeline.entity.issue.Issue)1 FolderWithMetadata (com.epam.pipeline.entity.metadata.FolderWithMetadata)1 PasswordGenerator.generateRandomString (com.epam.pipeline.utils.PasswordGenerator.generateRandomString)1 EntityVO (com.epam.pipeline.vo.EntityVO)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1