Search in sources :

Example 16 with CveSearchData

use of org.eclipse.sw360.cvesearch.datasource.CveSearchData in project sw360portal by sw360.

the class CveSearchDataTranslatorTest method testWithRealData.

@Test
public void testWithRealData() throws IOException {
    List<CveSearchData> cveSearchDatas = new CveSearchApiImpl(host).search("zyxel", "zywall");
    List<CveSearchDataTranslator.VulnerabilityWithRelation> vms = cveSearchDatas.stream().map(cveSearchData -> cveSearchDataTranslator.apply(cveSearchData)).collect(Collectors.toList());
    assert (vms != null);
}
Also used : java.util(java.util) CveSearchData(org.eclipse.sw360.cvesearch.datasource.CveSearchData) Test(org.junit.Test) IOException(java.io.IOException) CveSearchHandler(org.eclipse.sw360.cvesearch.service.CveSearchHandler) Collectors(java.util.stream.Collectors) CommonUtils(org.eclipse.sw360.datahandler.common.CommonUtils) CveSearchApiImpl(org.eclipse.sw360.cvesearch.datasource.CveSearchApiImpl) Assume(org.junit.Assume) CVEReference(org.eclipse.sw360.datahandler.thrift.vulnerabilities.CVEReference) Vulnerability(org.eclipse.sw360.datahandler.thrift.vulnerabilities.Vulnerability) Before(org.junit.Before) CveSearchDataTestHelper.isUrlReachable(org.eclipse.sw360.cvesearch.datasource.CveSearchDataTestHelper.isUrlReachable) CveSearchData(org.eclipse.sw360.cvesearch.datasource.CveSearchData) CveSearchApiImpl(org.eclipse.sw360.cvesearch.datasource.CveSearchApiImpl) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 CveSearchData (org.eclipse.sw360.cvesearch.datasource.CveSearchData)10 Vulnerability (org.eclipse.sw360.datahandler.thrift.vulnerabilities.Vulnerability)5 List (java.util.List)4 Release (org.eclipse.sw360.datahandler.thrift.components.Release)4 IOException (java.io.IOException)3 java.util (java.util)3 Collectors (java.util.stream.Collectors)3 CveSearchApiImpl (org.eclipse.sw360.cvesearch.datasource.CveSearchApiImpl)3 CommonUtils (org.eclipse.sw360.datahandler.common.CommonUtils)3 CVEReference (org.eclipse.sw360.datahandler.thrift.vulnerabilities.CVEReference)3 Before (org.junit.Before)3 CveSearchDataTestHelper.isUrlReachable (org.eclipse.sw360.cvesearch.datasource.CveSearchDataTestHelper.isUrlReachable)2 CveSearchHandler (org.eclipse.sw360.cvesearch.service.CveSearchHandler)2 Assume (org.junit.Assume)2 Ignore (org.junit.Ignore)2 Type (java.lang.reflect.Type)1 Logger (org.apache.log4j.Logger)1 TException (org.apache.thrift.TException)1 VulnerabilityConnector (org.eclipse.sw360.cvesearch.datasink.VulnerabilityConnector)1