Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
ntqdinh-axonivy committed Jan 10, 2025
1 parent 5aaad72 commit e4b3417
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class BaseSetup {
protected static final String MOCK_PRODUCT_ID = "bpmn-statistic";
protected static final String MOCK_PRODUCT_ID_WITH_VERSION = "bpmn-statistic-10.0.10";
protected static final String MOCK_ARTIFACT_ID = "bpmn-statistic";
protected static final String MOCK_DEMO_ARTIFACT_ID = "bpmn-statistic-demo";
protected static final String MOCK_PRODUCT_ARTIFACT_ID = "bpmn-statistic-product";
protected static final String MOCK_RELEASED_VERSION = "10.0.10";
protected static final String MOCK_SNAPSHOT_VERSION = "10.0.10-SNAPSHOT";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,28 @@ void testUpdateMavenArtifactVersionCacheWithModel() {
Assertions.assertEquals(1, additionalArtifacts.size());
Assertions.assertTrue(CollectionUtils.isEmpty(productArtifacts));

// Simulate add new artifact to the same version in additional list
// Simulate add one new duplicated artifact to the same version in additional list
metadataService.updateMavenArtifactVersionCacheWithModel(mockMavenArtifactVersion, MOCK_RELEASED_VERSION,
mockMetadata);
Assertions.assertEquals(1, additionalArtifacts.size());
productArtifacts = mockMavenArtifactVersion.getProductArtifactsByVersion().get(
MOCK_RELEASED_VERSION);
Assertions.assertTrue(CollectionUtils.isEmpty(productArtifacts));

// Simulate add one new non-duplicated artifact to the same version in additional list
mockMetadata.setArtifactId(MOCK_DEMO_ARTIFACT_ID);
metadataService.updateMavenArtifactVersionCacheWithModel(mockMavenArtifactVersion, MOCK_RELEASED_VERSION,
mockMetadata);
Assertions.assertEquals(2, additionalArtifacts.size());
productArtifacts = mockMavenArtifactVersion.getProductArtifactsByVersion().get(
MOCK_RELEASED_VERSION);
Assertions.assertTrue(CollectionUtils.isEmpty(productArtifacts));

mockMetadata.setProductArtifact(true);
metadataService.updateMavenArtifactVersionCacheWithModel(mockMavenArtifactVersion, MOCK_RELEASED_VERSION,
mockMetadata);
productArtifacts = mockMavenArtifactVersion.getProductArtifactsByVersion().get(
MOCK_RELEASED_VERSION);
Assertions.assertEquals(1, productArtifacts.size());
}

Expand Down

0 comments on commit e4b3417

Please sign in to comment.