Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickmann committed Feb 14, 2025
1 parent 6912ab0 commit c545c82
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public PipelineSource update(@ApiParam(name = "id") @PathParam("id") String id,
@ApiParam(name = "pipeline", required = true) @NotNull PipelineSource update) throws NotFoundException {
checkPermission(PipelineRestPermissions.PIPELINE_EDIT, id);
checkReservedName(update);
return PipelineUtils.update(pipelineService, pipelineRuleParser, id, update, true);
return PipelineUtils.update(pipelineService, pipelineRuleParser, ruleService, id, update, true);
}

public record RoutingRequest(
Expand Down Expand Up @@ -288,7 +288,7 @@ public RoutingResponse routing(@ApiParam(name = "body", required = true) @NotNul
pipelineSource = pipelineSource.toBuilder()
.source(PipelineUtils.createPipelineString(pipelineSource))
.build();
PipelineUtils.update(pipelineService, pipelineRuleParser, pipelineDao.id(), pipelineSource, false);
PipelineUtils.update(pipelineService, pipelineRuleParser, ruleService, pipelineDao.id(), pipelineSource, false);
} else {
log.info(f("Routing for input <%s> already exists - skipping", request.inputId()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private void handleRuleDeleted(String ruleTitle) {
pipelineSource = pipelineSource.toBuilder()
.source(PipelineUtils.createPipelineString(pipelineSource))
.build();
PipelineUtils.update(pipelineService, pipelineRuleParser, pipelineDao.id(), pipelineSource, false);
PipelineUtils.update(pipelineService, pipelineRuleParser, ruleService, pipelineDao.id(), pipelineSource, false);
} catch (NotFoundException e) {
log.warn("Unable to load pipeline {}", GL_INPUT_ROUTING_PIPELINE, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.Mockito.mock;
Expand Down Expand Up @@ -86,14 +87,14 @@ public void updatePipeline() throws Exception {
try (final MockedStatic<PipelineSource> pipelineSourceMockedStatic = mockStatic(PipelineSource.class)) {
pipelineSourceMockedStatic.when(() -> PipelineSource.fromDao(any(), any())).thenReturn(pipelineSource);

PipelineUtils.update(pipelineService, parser, ruleService, pipelineId, pipelineSource);
PipelineUtils.update(pipelineService, parser, ruleService, pipelineId, pipelineSource, true);

verify(pipelineService).save(argThat(dao -> {
assertThat(dao.title()).isEqualTo(pipelineSource.title());
assertThat(dao.description()).isEqualTo(pipelineSource.description());
assertThat(dao.source()).isEqualTo(pipelineSource.source());
return true;
}));
}), anyBoolean());
}
}

Expand All @@ -107,7 +108,7 @@ public void throwWithUnexpectedSystemRule() throws Exception {

try (final MockedStatic<PipelineSource> pipelineSourceMockedStatic = mockStatic(PipelineSource.class)) {
pipelineSourceMockedStatic.when(() -> PipelineSource.fromDao(any(), any())).thenReturn(pipelineSource);
PipelineUtils.update(pipelineService, parser, ruleService, pipelineId, pipelineSource);
PipelineUtils.update(pipelineService, parser, ruleService, pipelineId, pipelineSource, true);
}
}

Expand Down

0 comments on commit c545c82

Please sign in to comment.