-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
94 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...src/test/java/com/github/swissquote/carnotzet/core/maven/MavenDependencyResolverTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.github.swissquote.carnotzet.core.maven; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.List; | ||
import java.util.function.Function; | ||
import java.util.regex.Pattern; | ||
|
||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
|
||
import com.github.swissquote.carnotzet.core.Carnotzet; | ||
import com.github.swissquote.carnotzet.core.CarnotzetConfig; | ||
import com.github.swissquote.carnotzet.core.CarnotzetModule; | ||
|
||
public class MavenDependencyResolverTest { | ||
|
||
private Function<CarnotzetModuleCoordinates, String> getDefaultModuleResolver() { | ||
Pattern moduleFilterPattern = Pattern.compile(CarnotzetConfig.DEFAULT_MODULE_FILTER_PATTERN); | ||
Pattern classifierIncludePattern = Pattern.compile(CarnotzetConfig.DEFAULT_CLASSIFIER_INCLUDE_PATTERN); | ||
|
||
return (module) -> Carnotzet.getModuleName(module, moduleFilterPattern, classifierIncludePattern); | ||
} | ||
|
||
@Test | ||
@Ignore("Dependencies are not published to Maven Central which makes it impossible to run this test in CI for now") | ||
public void resolveDependencies() { | ||
Path resourcesPath = Paths.get("/tmp/carnotzet_" + System.nanoTime()); | ||
|
||
MavenDependencyResolver resolver = new MavenDependencyResolver( | ||
getDefaultModuleResolver(), | ||
resourcesPath.resolve("maven") | ||
); | ||
|
||
CarnotzetModuleCoordinates coord = new CarnotzetModuleCoordinates("com.github.swissquote.examples", "voting-all-carnotzet", "1.8.9-SNAPSHOT", null); | ||
|
||
List<CarnotzetModule> modules = resolver.resolve(coord, true); | ||
|
||
assertEquals(modules.size(), 6); | ||
} | ||
} |