Skip to content

Commit

Permalink
Add mising test case and migration
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonpoo committed Dec 17, 2024
1 parent 06a50a3 commit 7076c14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,10 @@ public void publishedToRecord(MongockTemplate mongoTemplate, CommonConfig common
mongoTemplate.insert(record);
}
}
@ChangeSet(order = "029", id = "add-tag-index-to-record", author = "Thomas")
public void addTagIndexToRecord(MongockTemplate mongoTemplate, CommonConfig commonConfig) {
ensureIndexes(mongoTemplate, ApplicationRecord.class, makeIndex("applicationId", "tag").unique());
}

private void addGidField(MongockTemplate mongoTemplate, String collectionName) {
// Create a query to match all documents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public void testPublishApplication() {
.assertNext(applicationView -> Assertions.assertEquals(Map.of("comp", "list"), applicationView.getApplicationDSL()))
.verifyComplete();

// publish
// publish 2
applicationIdMono = applicationIdMono
.delayUntil(id -> applicationApiService.publish(id, new ApplicationPublishRequest("Test Publish 2", "2.0.0"))).cache();

Expand All @@ -192,6 +192,14 @@ public void testPublishApplication() {
StepVerifier.create(applicationIdMono.flatMap(id -> applicationApiService.getPublishedApplication(id, ApplicationRequestType.PUBLIC_TO_ALL)))
.assertNext(applicationView -> Assertions.assertEquals(Map.of("comp", "table"), applicationView.getApplicationDSL()))
.verifyComplete();

// publish 3
applicationIdMono = applicationIdMono
.delayUntil(id -> applicationApiService.publish(id, new ApplicationPublishRequest("Same tag", "2.0.0"))).cache();

// Error
StepVerifier.create(applicationIdMono)
.verifyError();
}

@Test
Expand Down

0 comments on commit 7076c14

Please sign in to comment.