use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.
the class IntermediateStepParseFilterLinesTest method testMixed.
@Test
public void testMixed() throws IntegrationException, ExecutableFailedException {
IntermediateStep intermediateStep = new IntermediateStepParseFilterLines(".*maven_coordinates=.*");
List<String> input = Arrays.asList(NAME_LINE, TAGS_LINE_MIXED);
List<String> output = intermediateStep.process(input);
assertEquals(1, output.size());
assertEquals(TAGS_LINE_MIXED, output.get(0));
}
use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.
the class IntermediateStepParseFilterLinesTest method testMavenCoordinateOnly.
@Test
public void testMavenCoordinateOnly() throws IntegrationException, ExecutableFailedException {
IntermediateStep intermediateStep = new IntermediateStepParseFilterLines(".*maven_coordinates=.*");
List<String> input = Arrays.asList(NAME_LINE, TAGS_LINE_MAVEN_COORDINATES);
List<String> output = intermediateStep.process(input);
assertEquals(1, output.size());
assertEquals(TAGS_LINE_MAVEN_COORDINATES, output.get(0));
}
use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.
the class IntermediateStepParseReplaceInEachLineTest method testRemoveLeadingAtSignMixedTags.
@Test
public void testRemoveLeadingAtSignMixedTags() throws IntegrationException, ExecutableFailedException {
List<String> input = Arrays.asList(" tags = [\"__SOME_OTHER_TAG__\", \"maven_coordinates=com.company.thing:thing-common-client:2.100.0\"],", " tags = [\"maven_coordinates=com.google.code.findbugs:jsr305:3.0.2\"],");
IntermediateStep intermediateStep1 = new IntermediateStepParseReplaceInEachLine(".*\"maven_coordinates=", "");
IntermediateStep intermediateStep2 = new IntermediateStepParseReplaceInEachLine("\".*", "");
List<String> intermediate = intermediateStep1.process(input);
List<String> output = intermediateStep2.process(intermediate);
assertEquals(2, output.size());
assertEquals("com.company.thing:thing-common-client:2.100.0", output.get(0));
assertEquals("com.google.code.findbugs:jsr305:3.0.2", output.get(1));
}
use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.
the class IntermediateStepParseReplaceInEachLineTest method testRemoveLeadingAtSign.
@Test
public void testRemoveLeadingAtSign() throws IntegrationException, ExecutableFailedException {
List<String> input = Arrays.asList("@org_apache_commons_commons_io//jar:jar", "@com_google_guava_guava//jar:jar");
IntermediateStep intermediateStep = new IntermediateStepParseReplaceInEachLine("^@", "");
List<String> output = intermediateStep.process(input);
assertEquals(2, output.size());
assertEquals("org_apache_commons_commons_io//jar:jar", output.get(0));
assertEquals("com_google_guava_guava//jar:jar", output.get(1));
}
use of com.synopsys.integration.detectable.detectables.bazel.pipeline.step.IntermediateStep in project synopsys-detect by blackducksoftware.
the class IntermediateStepParseSplitEachEachTest method test.
@Test
public void test() throws IntegrationException, ExecutableFailedException {
IntermediateStep intermediateStepSplitEach = new IntermediateStepParseSplitEach("\\s+");
List<String> input = Arrays.asList("@org_apache_commons_commons_io//jar:jar\n@com_google_guava_guava//jar:jar");
List<String> output = intermediateStepSplitEach.process(input);
assertEquals(2, output.size());
assertEquals("@org_apache_commons_commons_io//jar:jar", output.get(0));
assertEquals("@com_google_guava_guava//jar:jar", output.get(1));
}
Aggregations