package Ġinspector Ċ Ċ import Ġcom . syn op sys . integration . black duck . art ifactory . Black Duck Art ifactory Property Ċ import Ġcom . syn op sys . integration . black duck . art ifactory . automation . Missing Property Exception Ċ import Ġcom . syn op sys . integration . black duck . art ifactory . automation . No Properties Exception Ċ import Ġcom . syn op sys . integration . black duck . art ifactory . automation . art ifactory . Package Type Ċ import Ġcom . syn op sys . integration . black duck . art ifactory . automation . art ifactory . api . sear ches . Artifact Se ar ches API Service Ċ import Ġcom . syn op sys . integration . black duck . art ifactory . modules . inspection . Inspection Module Ċ import Ġcom . syn op sys . integration . black duck . art ifactory . modules . inspection . model . Inspection Status Ċ import Ġorg . junit . jupiter . params . Parameterized Test Ċ import Ġorg . junit . jupiter . params . provider . Enum Source Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ Ċ class ĠAfter Create Test Ġ: ĠIns pection Test () Ġ{ ĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġlateinit Ġvar Ġartifact Se ar ches API Service : ĠArtifact Se ar ches API Service ĊĊĠĠĠ Ġ@ Parameterized Test ĊĠĠĠ Ġ@ Enum Source ( Package Type . Defaults :: class ) ĊĠĠĠ Ġfun Ġafter Create Test ( package Type : ĠPackage Type ) Ġ{ ĊĠĠĠĠĠĠĠ Ġresolver Required Test ( package Type ) Ġ{ Ġresolver , Ġrepository Key , Ġresolver Repository Key Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġinspection ModuleName Ġ= ĠIns pection Module :: class . simple Name !! ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblack Duck Plugin ApiService . set Module State ( inspection ModuleName , Ġfalse ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrepository Manager . add Repository To Inspection ( repository Key ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblack Duck Plugin ApiService . set Module State ( inspection ModuleName , Ġtrue ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblack Duck Plugin ApiService . delete Inspection Properties () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġblack Duck Plugin ApiService . black Duck Initialize Repositories () ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġtest able Packages Ġ= Ġresolver . test able Packages ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtest able Packages . forEach Ġ{ Ġtest able Package Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprintln (" Testing Ġpackage : Ġ${ test able Package . external Id . create External Id () }") ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresolver . resolver Function ( artifact Resolver , Ġresolver Repository Key , Ġtest able Package . external Id ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġcomponent Verification Service . waitFor Component Inspection ( repository Key , Ġtest able Package ) ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġartifact Ġ= Ġartifact Se ar ches API Service . exact Artifact Search ( test able Package . art ifactory FileName , Ġrepository Key ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġrepo Path Ġ= Ġrepository Key Ġ+ Ġartifact . path ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġitem Properties Ġ= Ġproperties ApiService . getProperties ( repo Path ) Ġ?: Ġthrow ĠNo Properties Exception ( repo Path ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġinspection Status Property Key Ġ= ĠBlack Duck Art ifactory Property . IN SPE CTION _ STATUS . propertyName ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ// ĠIf Ġthe Ġinspection Ġstatus Ġproperty Ġis Ġmissing , Ġthe Ġafter Ġcreate Ġevent Ġwas Ġnot Ġtriggered . ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġinspection Status Ġ= Ġitem Properties . properties [ inspection Status Property Key ]?. first () Ġ?: Ġthrow ĠMissing Property Exception ( inspection Status Property Key , Ġrepo Path ) ĊĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( inspection Status Ġ== ĠIns pection Status . SUCCESS . name ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġassert Success ( item Properties ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġassert Failure ( item Properties ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠException (" after Create Ġfailed Ġand Ġproperly Ġapplied Ġproperties , Ġbut Ġthe Ġinspection Ġshould Ġnot Ġhave Ġfailed .") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn @ resolver Required Test Ġtrue ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }