maven icon indicating copy to clipboard operation
maven copied to clipboard

Add test case for DefaultArtifact

Open chenchc6 opened this issue 1 year ago • 1 comments

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.

chenchc6 avatar May 28 '24 02:05 chenchc6

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

hiufung-kwok avatar Aug 09 '24 16:08 hiufung-kwok

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

gnodet avatar Oct 16 '24 14:10 gnodet