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

Add test case for DefaultArtifact #1539

Closed
wants to merge 1 commit into from

Conversation

chenchc6
Copy link

Description

This pull request adds a new unit test for the DefaultArtifact class in the Apache Maven project. The test verifies the correctness of the DefaultArtifact class's constructor and its methods by asserting the expected values.

Changes Made

  • Added DefaultArtifactTest.java under maven-artifact/src/test/java/org/apache/maven/artifact/
  • The test case validates:
    • Artifact is not null
    • Group ID, Artifact ID, Version, Scope, Type are correctly assigned
    • Classifier is null
    • Artifact handler is correctly assigned

Purpose

The purpose of this test is to ensure that the DefaultArtifact class correctly initializes its fields and that its getter methods return the expected values. This helps in maintaining the robustness and reliability of the Apache Maven project.

Contribution

  • Verifying the correctness of the DefaultArtifact class's behavior.
  • Enhancing the test coverage of the Apache Maven codebase.
  • Providing a reference for future tests and improvements.

<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>3.6.1</version>
Copy link
Contributor

@hiufung-kwok hiufung-kwok Aug 9, 2024

Choose a reason for hiding this comment

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

Should this be read from the Parent pom, instead of hard-coding it?

@hiufung-kwok
Copy link
Contributor

Also, would you mind to update the title to include the associated Jira ticket?

@gnodet
Copy link
Contributor

gnodet commented Oct 16, 2024

The maven-artifact will be deprecated and is not part of the upcoming Maven 4 api.

@gnodet gnodet closed this Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants