use of com.epam.pipeline.elasticsearchagent.service.impl.converter.pipeline.PipelineCodeMapper in project cloud-pipeline by epam.
the class PipelineCodeHandlerTest method setup.
@BeforeEach
void setup() {
pipelineCodeHandler = new PipelineCodeHandler(INDEX_PREFIX, INDEX_NAME, apiClient, new ElasticIndexService(), FILE_INDEX_PATHS, objectMapper, pipelineLoader, new PipelineCodeMapper(), "master");
expectedPipelineEvent = new PipelineEvent();
expectedPipelineEvent.setEventType(EventType.INSERT);
expectedPipelineEvent.setObjectType(PipelineEvent.ObjectType.PIPELINE);
expectedPipelineEvent.setObjectId(1L);
expectedPipelineEvent.setCreatedDate(LocalDateTime.now());
expectedPipelineEvent.setData("{\"tag\": {\"type\": \"string\", \"value\": \"admin\"}}");
pipeline = new Pipeline();
pipeline.setId(1L);
pipeline.setName(TEST_NAME);
pipeline.setCreatedDate(DateUtils.now());
pipeline.setParentFolderId(2L);
pipeline.setDescription(TEST_DESCRIPTION);
pipeline.setRepository(TEST_REPO);
pipeline.setTemplateId(TEST_TEMPLATE);
Revision revision = new Revision();
revision.setName(TEST_VERSION);
PipelineDoc pipelineDoc = PipelineDoc.builder().pipeline(pipeline).revisions(Collections.singletonList(revision)).build();
gitPushEventData = new GitEventData();
gitPushEventData.setGitEventType(GitEventType.push);
gitPushEventData.setPaths(Collections.singletonList(FILE_INDEX_PATHS));
gitPushEventData.setVersion(VERSION);
gitTagEventData = new GitEventData();
gitTagEventData.setGitEventType(GitEventType.tag_push);
gitTagEventData.setPaths(Collections.singletonList(FILE_INDEX_PATHS));
gitTagEventData.setVersion(VERSION);
gitRepositoryEntry = new GitRepositoryEntry();
gitRepositoryEntry.setId("1");
gitRepositoryEntry.setName(TEST_NAME);
gitRepositoryEntry.setPath(FOLDER_INDEX_PATHS);
gitRepositoryEntry.setType("blob");
container = EntityContainer.<PipelineDoc>builder().entity(pipelineDoc).owner(USER).metadata(METADATA).permissions(PERMISSIONS_CONTAINER).build();
}
Aggregations