Skip to content
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

Issues 1198: Maven specific features support for @TestArtifact annotation #1199

Merged
merged 12 commits into from
Apr 12, 2019

Conversation

sbespalov
Copy link
Member

@sbespalov sbespalov commented Apr 11, 2019

Fixes #1198

  • @MavenTestArtifact annotation implemented
  • ArtifactMetadataServiceSnapshotsTest reworked to use @TestRespository and @TestArtifact

@sbespalov sbespalov added the in progress work is in progress label Apr 11, 2019
@sbespalov sbespalov changed the title Issues/1198: Maven classifiers support for @TestArtifact annotation Issues/1198: Maven specific features support for @TestArtifact annotation Apr 11, 2019
@sbespalov sbespalov added ready ready to be merged and removed in progress work is in progress labels Apr 11, 2019
@carlspring carlspring changed the title Issues/1198: Maven specific features support for @TestArtifact annotation Issues 1198: Maven specific features support for @TestArtifact annotation Apr 11, 2019
public void testSnapshotWithoutTimestampMetadataRebuild()
@ExtendWith({ RepositoryManagementTestExecutionListener.class, ArtifactManagementTestExecutionListener.class })
public void testSnapshotWithoutTimestampMetadataRebuild(@MavenSnapshotRepository Repository repository,
@MavenArtifactWithClassifiers(repository = REPOSITORY_SNAPSHOTS, id = "org.carlspring.strongbox.snapshots:metadata", versions = "2.0-SNAPSHOT") List<Path> snapshotArtifactPath)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, how do you actually specify what classifiers to use when generating the artifacts? I'm not sure I get it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classifiers defined in MavenArtifactWithClassifiersGeneratorStrategy.CLASSIFIERS

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlspring classifiers parameter implemented as you requested (see here)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much! :)

public void testSnapshotMetadataRebuild()
@ExtendWith({ RepositoryManagementTestExecutionListener.class, ArtifactManagementTestExecutionListener.class })
public void testSnapshotMetadataRebuild(@MavenSnapshotRepository Repository repository,
@MavenSnapshotArtifactWithClassifiers(id = "org.carlspring.strongbox:strongbox-metadata") List<Path> snapshotArtifacts)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I get the idea behind this List<Path> .... I don't understand...
Would you mind explaining this sourcery to me? :-o

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it explained in #1165 under "To create multiple test artifact versions" section.

We have @MavenSnapshotArtifactWithClassifiers here which is shortcut for @MavenArtifactWithClassifiers with predefined 5 snapshot versions. So the List<Path> will contain 5 elements, each for every version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have only one version then List not required and single Path can be injected.

@carlspring carlspring merged commit c1c046a into strongbox:master Apr 12, 2019
@carlspring carlspring deleted the issues/1198 branch April 12, 2019 09:57
@carlspring
Copy link
Member

Thanks, @sbespalov ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maven classifiers support for @TestArtifact annotation
2 participants