38
38
public class NpmExtractorTest extends IntegrationTestsBase {
39
39
40
40
private static final String NPM_LOCAL_REPO = "build-info-tests-npm-local" ;
41
- private static final String NPM_REMOTE_REPO = "build-info-tests-npm-remote" ;
42
- private static final String NPM_VIRTUAL_REPO = "build-info-tests-npm-virtual" ;
43
41
private static final Set <String > DEV_SCOPE = Stream .of ("dev" ).collect (Collectors .toSet ());
44
42
private static final Set <String > PROD_SCOPE = Stream .of ("prod" ).collect (Collectors .toSet ());
45
- private static final Set <String > DEV_PROD_SCOPE = Stream .of ("prod" ,"dev" ).collect (Collectors .toSet ());
43
+ private static final Set <String > DEV_PROD_SCOPE = Stream .of ("prod" , "dev" ).collect (Collectors .toSet ());
46
44
47
45
private static final Path PROJECTS_ROOT = Paths .get ("." ).toAbsolutePath ().normalize ().resolve (Paths .get ("src" , "test" , "resources" , "org" , "jfrog" , "build" , "extractor" ));
48
46
@@ -51,8 +49,7 @@ public class NpmExtractorTest extends IntegrationTestsBase {
51
49
52
50
public NpmExtractorTest () {
53
51
localRepo1 = NPM_LOCAL_REPO ;
54
- remoteRepo = NPM_REMOTE_REPO ;
55
- virtualRepo = NPM_VIRTUAL_REPO ;
52
+ virtualRepo = "" ;
56
53
}
57
54
58
55
private enum Project {
@@ -186,15 +183,15 @@ private void runNpmTest(Project project, Dependency[] expectedDependencies, Stri
186
183
Path path = packageJsonPath ? projectDir .resolve ("package.json" ) : projectDir ;
187
184
if (isNpmCi ) {
188
185
// Run npm install to generate package-lock.json file.
189
- new NpmInstallCi (artifactoryManagerBuilder , virtualRepo , args , log , path , null , null , null , false , null ).execute ();
186
+ new NpmInstallCi (artifactoryManagerBuilder , localRepo1 , args , log , path , null , null , null , false , null ).execute ();
190
187
}
191
188
192
189
// Execute command.
193
190
NpmInstallCi buildExecutor ;
194
191
if (isNpmCi ) {
195
- buildExecutor = new NpmInstallCi (artifactoryManagerBuilder , virtualRepo , args , log , path , null , null , null , true , null );
192
+ buildExecutor = new NpmInstallCi (artifactoryManagerBuilder , localRepo1 , args , log , path , null , null , null , true , null );
196
193
} else {
197
- buildExecutor = new NpmInstallCi (artifactoryManagerBuilder , virtualRepo , args , log , path , null , null , null , false , null );
194
+ buildExecutor = new NpmInstallCi (artifactoryManagerBuilder , localRepo1 , args , log , path , null , null , null , false , null );
198
195
}
199
196
Build build = buildExecutor .execute ();
200
197
@@ -233,15 +230,15 @@ public void npmPublishTest(Project project, ArrayListMultimap<String, String> pr
233
230
// Run npm publish
234
231
projectDir = createProjectDir (project );
235
232
Path path = StringUtils .isNotBlank (packageName ) ? projectDir .resolve (packageName ) : projectDir ;
236
- NpmPublish npmPublish = new NpmPublish (artifactoryManagerBuilder , props , path , virtualRepo , log , null , null );
233
+ NpmPublish npmPublish = new NpmPublish (artifactoryManagerBuilder , props , path , localRepo1 , log , null , null );
237
234
Build build = npmPublish .execute ();
238
235
assertEquals (build .getModules ().size (), 1 );
239
236
Module module = build .getModules ().get (0 );
240
237
241
238
// Check correctness of the module and the artifact
242
239
assertEquals (module .getType (), "npm" );
243
240
assertEquals (module .getId (), project .getModuleId ());
244
- assertEquals (module .getRepository (), virtualRepo );
241
+ assertEquals (module .getRepository (), localRepo1 );
245
242
assertEquals (module .getArtifacts ().size (), 1 );
246
243
assertEquals (module .getArtifacts ().get (0 ).getName (), project .getModuleId ());
247
244
assertEquals (module .getArtifacts ().get (0 ).getRemotePath (), project .getRemotePath ());
0 commit comments