### Question:
SpecsHelper { public Spec getSpecFromFile(File specFile, SpecsValidator specsValidator) throws IOException { return getSpecFromString(FileUtils.readFileToString(specFile), specsValidator); } SpecsHelper(Log log); List<Artifact> uploadArtifactsBySpec(String uploadSpec, File workspace,
                                                Map<String, String> buildProperties,
                                                ArtifactoryBuildInfoClientBuilder clientBuilder); List<Artifact> uploadArtifactsBySpec(String uploadSpec, File workspace,
                                                Multimap<String, String> buildProperties,
                                                ArtifactoryBuildInfoClientBuilder clientBuilder); List<Artifact> uploadArtifactsBySpec(String uploadSpec, int numberOfThreads, File workspace,
                                                Multimap<String, String> buildProperties,
                                                ArtifactoryBuildInfoClientBuilder clientBuilder); static Multimap<K, V> createMultiMap(Map<K, V> input); List<Dependency> downloadArtifactsBySpec(String spec, ArtifactoryDependenciesClient client, String targetDirectory); Spec getSpecFromFile(File specFile, SpecsValidator specsValidator); Spec getSpecFromString(String specStr, SpecsValidator specsValidator); @SuppressWarnings("unused") boolean editPropertiesBySpec(String spec, ArtifactoryDependenciesClient client,
                                        EditPropertiesHelper.EditPropertiesActionType editType, String props); static ArrayListMultimap<String, String> getPropertiesMap(String props); static void fillPropertiesMap(String props, ArrayListMultimap<String, String> propertiesMap);  }### Answer:
@Test(dataProvider = "positiveDownloadSpecProvider") public void testPositiveDownloadSpecFromFile (String specFileName, String aql, String pattern, String target, String props, String recursive, String flat, String regexp, String build) throws IOException { SpecsHelper specsHelper = new SpecsHelper(new NullLog()); File fileSpec = getFileFromResources("positiveTestSpecs/" + specFileName); FileSpec spec = specsHelper.getSpecFromFile(fileSpec, downloadSpecValidator).getFiles()[0]; assertSpecParams(aql, pattern, target, props, recursive, flat, regexp, build, spec); }
@Test(dataProvider = "positiveUploadSpecProvider") public void testPositiveUploadSpecFromFile (String specFileName, String aql, String pattern, String target, String props, String recursive, String flat, String regexp, String build) throws IOException { SpecsHelper specsHelper = new SpecsHelper(new NullLog()); File fileSpec = getFileFromResources("positiveTestSpecs/" + specFileName); FileSpec spec = specsHelper.getSpecFromFile(fileSpec, uploadSpecValidator).getFiles()[0]; assertSpecParams(aql, pattern, target, props, recursive, flat, regexp, build, spec); }
@Test(dataProvider = "negativeDownloadFileSpecProvider", expectedExceptions = {JsonMappingException.class, IllegalArgumentException.class}) public void testNegativeDownloadSpecFromFile(String specFileName) throws IOException { SpecsHelper specsHelper = new SpecsHelper(new NullLog()); File fileSpec = getFileFromResources("negativeTestSpecs/" + specFileName); specsHelper.getSpecFromFile(fileSpec, downloadSpecValidator); }
@Test(dataProvider = "negativeUploadFileSpecProvider", expectedExceptions = {JsonMappingException.class, IllegalArgumentException.class}) public void testNegativeUploadSpecFromFile(String specFileName) throws IOException { SpecsHelper specsHelper = new SpecsHelper(new NullLog()); File fileSpec = getFileFromResources("negativeTestSpecs/" + specFileName); specsHelper.getSpecFromFile(fileSpec, uploadSpecValidator); }