-
-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement component property ingest for legacy BOM processing task
Signed-off-by: nscuro <[email protected]>
- Loading branch information
Showing
5 changed files
with
91 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -241,31 +241,29 @@ public void informTest() throws Exception { | |
assertThat(component.getPurl().canonicalize()).isEqualTo("pkg:maven/com.example/[email protected]?packaging=jar"); | ||
assertThat(component.getLicenseUrl()).isEqualTo("https://www.apache.org/licenses/LICENSE-2.0.txt"); | ||
|
||
if (bomUploadProcessingTaskSupplier.get() instanceof BomUploadProcessingTaskV2) { | ||
assertThat(component.getProperties()).satisfiesExactlyInAnyOrder( | ||
property -> { | ||
assertThat(property.getGroupName()).isEqualTo("foo"); | ||
assertThat(property.getPropertyName()).isEqualTo("bar"); | ||
assertThat(property.getPropertyValue()).isEqualTo("baz"); | ||
assertThat(property.getPropertyType()).isEqualTo(PropertyType.STRING); | ||
assertThat(property.getDescription()).isNull(); | ||
}, | ||
property -> { | ||
assertThat(property.getGroupName()).isNull(); | ||
assertThat(property.getPropertyName()).isEqualTo("foo"); | ||
assertThat(property.getPropertyValue()).isEqualTo("bar"); | ||
assertThat(property.getPropertyType()).isEqualTo(PropertyType.STRING); | ||
assertThat(property.getDescription()).isNull(); | ||
}, | ||
property -> { | ||
assertThat(property.getGroupName()).isEqualTo("foo"); | ||
assertThat(property.getPropertyName()).isEqualTo("bar"); | ||
assertThat(property.getPropertyValue()).isEqualTo("qux"); | ||
assertThat(property.getPropertyType()).isEqualTo(PropertyType.STRING); | ||
assertThat(property.getDescription()).isNull(); | ||
} | ||
); | ||
} | ||
assertThat(component.getProperties()).satisfiesExactlyInAnyOrder( | ||
property -> { | ||
assertThat(property.getGroupName()).isEqualTo("foo"); | ||
assertThat(property.getPropertyName()).isEqualTo("bar"); | ||
assertThat(property.getPropertyValue()).isEqualTo("baz"); | ||
assertThat(property.getPropertyType()).isEqualTo(PropertyType.STRING); | ||
assertThat(property.getDescription()).isNull(); | ||
}, | ||
property -> { | ||
assertThat(property.getGroupName()).isNull(); | ||
assertThat(property.getPropertyName()).isEqualTo("foo"); | ||
assertThat(property.getPropertyValue()).isEqualTo("bar"); | ||
assertThat(property.getPropertyType()).isEqualTo(PropertyType.STRING); | ||
assertThat(property.getDescription()).isNull(); | ||
}, | ||
property -> { | ||
assertThat(property.getGroupName()).isEqualTo("foo"); | ||
assertThat(property.getPropertyName()).isEqualTo("bar"); | ||
assertThat(property.getPropertyValue()).isEqualTo("qux"); | ||
assertThat(property.getPropertyType()).isEqualTo(PropertyType.STRING); | ||
assertThat(property.getDescription()).isNull(); | ||
} | ||
); | ||
|
||
assertThat(qm.getAllVulnerabilities(component)).hasSize(2); | ||
assertThat(NOTIFICATIONS).satisfiesExactly( | ||
|
@@ -931,11 +929,6 @@ public void informWithBomContainingServiceTest() throws Exception { | |
|
||
@Test | ||
public void informWithExistingComponentPropertiesAndBomWithoutComponentProperties() { | ||
// Known to now work with old task implementation. | ||
if (bomUploadProcessingTaskSupplier.get() instanceof BomUploadProcessingTask) { | ||
return; | ||
} | ||
|
||
final var project = new Project(); | ||
project.setName("acme-app"); | ||
qm.persist(project); | ||
|
@@ -976,11 +969,6 @@ public void informWithExistingComponentPropertiesAndBomWithoutComponentPropertie | |
|
||
@Test | ||
public void informWithExistingComponentPropertiesAndBomWithComponentProperties() { | ||
// Known to now work with old task implementation. | ||
if (bomUploadProcessingTaskSupplier.get() instanceof BomUploadProcessingTask) { | ||
return; | ||
} | ||
|
||
final var project = new Project(); | ||
project.setName("acme-app"); | ||
qm.persist(project); | ||
|