use of com.synopsys.integration.blackduck.api.core.response.LinkSingleResponse in project hub-alert by blackducksoftware.
the class BlackDuckMessageComponentVersionUpgradeGuidanceServiceTest method requestUpgradeGuidanceItemsBomTest.
@Test
public void requestUpgradeGuidanceItemsBomTest() throws IntegrationException {
HttpUrl httpUrl = new HttpUrl("https://fake-url");
UrlSingleResponse<ComponentVersionUpgradeGuidanceView> expectedUrl = new UrlSingleResponse<>(httpUrl, ComponentVersionUpgradeGuidanceView.class);
ComponentVersionUpgradeGuidanceView upgradeGuidanceView = createUpgradeGuidance(true);
BlackDuckApiClient blackDuckApiClient = createBlackDuckApiClient(expectedUrl, upgradeGuidanceView);
LinkSingleResponse<ComponentVersionUpgradeGuidanceView> upgradeGuidanceLink = new LinkSingleResponse<>("upgrade-guidance", ComponentVersionUpgradeGuidanceView.class);
ProjectVersionComponentVersionView bomComponent = createBomComponent(upgradeGuidanceLink, expectedUrl);
BlackDuckMessageComponentVersionUpgradeGuidanceService upgradeGuidanceService = new BlackDuckMessageComponentVersionUpgradeGuidanceService(blackDuckApiClient);
ComponentUpgradeGuidance componentUpgradeGuidance = upgradeGuidanceService.requestUpgradeGuidanceItems(bomComponent);
assertTrue(componentUpgradeGuidance.getLongTermUpgradeGuidance().isPresent());
assertTrue(componentUpgradeGuidance.getShortTermUpgradeGuidance().isPresent());
}
Aggregations