Skip to content

Commit

Permalink
update file name
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmcphillips committed Dec 4, 2023
1 parent c8ee847 commit 2d70233
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
import org.springframework.data.mongodb.core.query.Update;

@Slf4j
@ChangeUnit(id = "delete-risk-adjustment-descriptions", order = "2", author = "madie_dev")
public class DeleteRiskAdjustmentDefinitionsChangeUnit {
@ChangeUnit(id = "delete-risk-adjustments-descriptions", order = "2", author = "madie_dev")
public class DeleteRiskAdjustmentsDescriptionsChangeUnit {
@Execution
public void deleteAdjustmentDefinitions(MongoOperations mongoOperations) {
public void deleteAdjustmentDescriptions(MongoOperations mongoOperations) {
Query query = new Query();
Update update = new Update().unset("riskAdjustments.$[].description");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ public class DeleteRiskAdjustmentDefinitionsChangeUnitTest {
@Mock private MongoOperations mongoOperations;

@Test
public void testDeleteRiskAdjustmentDefinitions() {
public void testDeleteRiskAdjustmentsDescriptions() {
Query query = new Query();
Update update = new Update().unset("riskAdjustments.$[].description");
BulkOperations bulkOperations = mock(BulkOperations.class);

when(mongoOperations.bulkOps(BulkOperations.BulkMode.UNORDERED, Measure.class))
.thenReturn(bulkOperations);

new DeleteRiskAdjustmentDefinitionsChangeUnit()
.deleteAdjustmentDefinitions(mongoOperations);
new DeleteRiskAdjustmentsDescriptionsChangeUnit()
.deleteAdjustmentDescriptions(mongoOperations);

verify(bulkOperations, new Times(1)).updateMulti(query, update);
verify(bulkOperations, new Times(1)).execute();
}

@Test
void testRollback() {
new DeleteRiskAdjustmentDefinitionsChangeUnit().rollbackExecution();
new DeleteRiskAdjustmentsDescriptionsChangeUnit().rollbackExecution();
verifyNoInteractions(measureRepository);
}
}

0 comments on commit 2d70233

Please sign in to comment.