Search in sources :

Example 11 with EntityPermissionVO

use of com.epam.pipeline.vo.EntityPermissionVO 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 12 with EntityPermissionVO

use of com.epam.pipeline.vo.EntityPermissionVO in project cloud-pipeline by epam.

the class PipelineRunLoaderTest method setup.

@BeforeEach
void setup() {
    EntityPermissionVO entityPermissionVO = buildEntityPermissionVO(USER_NAME, ALLOWED_USERS, DENIED_USERS, ALLOWED_GROUPS, DENIED_GROUPS);
    when(apiClient.loadUserByName(anyString())).thenReturn(USER);
    when(apiClient.loadPermissionsForEntity(anyLong(), any())).thenReturn(entityPermissionVO);
}
Also used : ObjectCreationUtils.buildEntityPermissionVO(com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildEntityPermissionVO) EntityPermissionVO(com.epam.pipeline.vo.EntityPermissionVO) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 13 with EntityPermissionVO

use of com.epam.pipeline.vo.EntityPermissionVO 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 14 with EntityPermissionVO

use of com.epam.pipeline.vo.EntityPermissionVO 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

EntityPermissionVO (com.epam.pipeline.vo.EntityPermissionVO)14 ObjectCreationUtils.buildEntityPermissionVO (com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildEntityPermissionVO)10 BeforeEach (org.junit.jupiter.api.BeforeEach)10 ObjectCreationUtils.buildMetadataEntry (com.epam.pipeline.elasticsearchagent.ObjectCreationUtils.buildMetadataEntry)9 MetadataEntry (com.epam.pipeline.entity.metadata.MetadataEntry)9 PermissionsContainer (com.epam.pipeline.elasticsearchagent.model.PermissionsContainer)3 PasswordGenerator.generateRandomString (com.epam.pipeline.utils.PasswordGenerator.generateRandomString)2 BulkRequestCreator (com.epam.pipeline.elasticsearchagent.service.BulkRequestCreator)1 ElasticsearchServiceClient (com.epam.pipeline.elasticsearchagent.service.ElasticsearchServiceClient)1 ElasticsearchSynchronizer (com.epam.pipeline.elasticsearchagent.service.ElasticsearchSynchronizer)1 S3Helper (com.epam.pipeline.elasticsearchagent.utils.S3Helper)1 AbstractDataStorage (com.epam.pipeline.entity.datastorage.AbstractDataStorage)1 AbstractTemporaryCredentials (com.epam.pipeline.entity.datastorage.AbstractTemporaryCredentials)1 DataStorageAction (com.epam.pipeline.entity.datastorage.DataStorageAction)1 DataStorageType (com.epam.pipeline.entity.datastorage.DataStorageType)1 AclPermissionEntry (com.epam.pipeline.entity.security.acl.AclPermissionEntry)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 LocalDateTime (java.time.LocalDateTime)1 Collections (java.util.Collections)1