use of com.synopsys.integration.detectable.detectables.dart.pubdep.DartPubDepDetectable in project synopsys-detect by blackducksoftware.
the class PubDepsDetectableTest method testThrowExceptionWhenLockFilePresentButNotYaml.
@Test
public void testThrowExceptionWhenLockFilePresentButNotYaml() throws DetectableException {
FileFinder fileFinder = Mockito.mock(FileFinder.class);
Mockito.when(fileFinder.findFile(null, "pubspec.yaml")).thenReturn(null);
Mockito.when(fileFinder.findFile(null, "pubspec.lock")).thenReturn(new File(""));
DartPubDepDetectable dartPubDepDetectable = new DartPubDepDetectable(new DetectableEnvironment(null), fileFinder, null, null, null, null);
DetectableResult applicable = dartPubDepDetectable.applicable();
Assertions.assertTrue(applicable.getPassed());
DetectableResult extractable = dartPubDepDetectable.extractable();
Assertions.assertTrue(extractable instanceof FileNotFoundDetectableResult);
}
use of com.synopsys.integration.detectable.detectables.dart.pubdep.DartPubDepDetectable in project synopsys-detect by blackducksoftware.
the class DetectableFactory method createDartPubDepDetectable.
public DartPubDepDetectable createDartPubDepDetectable(DetectableEnvironment environment, DartPubDepsDetectableOptions dartPubDepsDetectableOptions, DartResolver dartResolver, FlutterResolver flutterResolver) {
PubDepsParser pubDepsParser = new PubDepsParser();
PubSpecYamlNameVersionParser pubSpecYamlNameVersionParser = new PubSpecYamlNameVersionParser();
PubDepsExtractor pubDepsExtractor = new PubDepsExtractor(executableRunner, pubDepsParser, pubSpecYamlNameVersionParser, toolVersionLogger);
return new DartPubDepDetectable(environment, fileFinder, pubDepsExtractor, dartPubDepsDetectableOptions, dartResolver, flutterResolver);
}
Aggregations