-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jarviz Updates #4
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"artifactDirectory": "/tmp/jarviz/artifacts" | ||
"artifactDirectory": "/tmp/jarviz/artifacts", | ||
"continueOnMavenError": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,8 @@ | |
@JsonInclude(value = JsonInclude.Include.NON_EMPTY) | ||
public interface CouplingRecord { | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a Java doc pls? |
||
String getAppSetName(); | ||
|
||
/** | ||
* The human readable name of the application. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,52 @@ public void testToFileName() { | |
.isEqualTo("foo-bar-2.0.1-SNAPSHOT.jar"); | ||
} | ||
|
||
@Test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
public void testToFileName_WhenVersionIsUnspecified() { | ||
|
||
final Artifact releaseVerArtifact = | ||
new Artifact.Builder() | ||
.artifactId("api-service") | ||
.groupId("com.vrbo.api") | ||
.version("RELEASE") | ||
.build(); | ||
|
||
assertThat(releaseVerArtifact.toFileName()) | ||
.isEqualTo("api-service.jar"); | ||
|
||
assertThat(new Artifact.Builder() | ||
.from(releaseVerArtifact) | ||
.classifier("logic") | ||
.build() | ||
.toFileName()) | ||
.isEqualTo("api-service.jar"); | ||
|
||
assertThat(new Artifact.Builder() | ||
.from(releaseVerArtifact) | ||
.packaging("war") | ||
.build() | ||
.toFileName()) | ||
.isEqualTo("api-service.war"); | ||
|
||
final Artifact latestVerArtifact = | ||
new Artifact.Builder() | ||
.artifactId("foo-bar") | ||
.groupId("abc.xyz") | ||
.version("LATEST") | ||
.build(); | ||
|
||
assertThat(latestVerArtifact.toFileName()) | ||
.isEqualTo("foo-bar.jar"); | ||
|
||
assertThat(new Artifact.Builder() | ||
.from(latestVerArtifact) | ||
.version("LATEST") | ||
.baseVersion(Optional.empty()) | ||
.build() | ||
.toFileName()) | ||
.isEqualTo("foo-bar.jar"); | ||
} | ||
|
||
@Test | ||
public void testToMavenId() { | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ public void setup() { | |
artifactDiscoveryService = new MavenArtifactDiscoveryService( | ||
new JarvizConfig.Builder() | ||
.artifactDirectory("/tmp/jarviz/artifacts") | ||
.continueOnMavenError(false) | ||
.build()); | ||
} | ||
|
||
|
@@ -59,4 +60,19 @@ public void testDiscoverArtifact_Fail() throws ArtifactNotFoundException { | |
artifactDiscoveryService.discoverArtifact(artifact); | ||
} | ||
|
||
@Test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
public void testDiscoverArtifact_WhenContinueOnMavenError_IsTrue() throws ArtifactNotFoundException { | ||
final MavenArtifactDiscoveryService artifactDiscoveryService2 = new MavenArtifactDiscoveryService( | ||
new JarvizConfig.Builder() | ||
.artifactDirectory("/tmp/jarviz/artifacts") | ||
.continueOnMavenError(true) | ||
.build()); | ||
final Artifact artifact = new Artifact.Builder() | ||
.groupId("__my_invalid_group__") | ||
.artifactId("__my_invalid_artifact__") | ||
.version("0") | ||
.build(); | ||
final File file = artifactDiscoveryService2.discoverArtifact(artifact); | ||
assertThat(file).doesNotExist(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this contain 2, we can keep it as a List, else we can make a it a Set.