use of com.epam.pipeline.controller.vo.PipelineSourceItemsVO in project cloud-pipeline by epam.
the class GitManagerTest method shouldUpdateFiles.
@Test
public void shouldUpdateFiles() throws GitClientException {
final Pipeline pipeline = testingPipeline();
final String lastCommit = pipeline.getCurrentVersion().getCommitId();
final PipelineSourceItemVO bla = new PipelineSourceItemVO();
bla.setLastCommitId(lastCommit);
bla.setContents(FILE_CONTENT);
bla.setComment("Update some file");
bla.setPath(DOCS + "/" + README_FILE);
bla.setPreviousPath(DOCS + "/" + README_FILE);
final PipelineSourceItemsVO sourceItemVOList = new PipelineSourceItemsVO();
sourceItemVOList.setLastCommitId(lastCommit);
sourceItemVOList.setItems(singletonList(bla));
final GitCommitEntry expectedCommit = new GitCommitEntry();
givenThat(post(urlPathEqualTo(api(REPOSITORY_COMMITS))).willReturn(okJson(with(expectedCommit))));
final GitCommitEntry resultingCommit = gitManager.updateFiles(pipeline, sourceItemVOList);
assertThat(resultingCommit, is(expectedCommit));
}
Aggregations