Skip to content

Commit

Permalink
Add Issue and ExternalIssue` annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Feb 15, 2024
1 parent ffb416a commit 304c2ae
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `DisplayName` annotation, by @HardNorth
- `TmsLink` annotation, by @HardNorth
- `TmsLinks` annotation, by @HardNorth
- `Issue` and `ExternalIssue` annotations, by @HardNorth

## [5.2.4]
### Changed
Expand Down
57 changes: 57 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/ExternalIssue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.*;

/**
* Link current Issue with an Issue posted in External Bug Tracking System. This annotation designed to use within {@link Issue} annotation
* only and does not allow to add it to any other target.
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({})
public @interface ExternalIssue {
/**
* External System Issue ID
*
* @return Issue ID
*/
String value();

/**
* Optional, use custom Bug Tracking System URL instead of one which is set in `reportportal.properties` file.
*
* @return Bug Tracking System URL
*/
String btsUrl() default "";

/**
* Optional, use custom Bug Tracking System Project name instead of one which is set in `reportportal.properties` file.
*
* @return Bug Tracking System Project name
*/
String btsProject() default "";

/**
* Optional, use custom Bug Tracking System Issue URL pattern instead of one which is set in `reportportal.properties` file. Use
* <code>{issue_id}</code> mark to put it into the result URL.
*
* @return Bug Tracking System Issue URL pattern
*/
String urlPattern() default "";
}
51 changes: 51 additions & 0 deletions src/main/java/com/epam/reportportal/annotations/Issue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2024 EPAM Systems
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.epam.reportportal.annotations;

import java.lang.annotation.*;

/**
* This annotation supposed to automatically link failed test items a specific Issue on ReportPortal.
*/
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD })
public @interface Issue {
/**
* Type (Locator), Short Name (Abbreviation) or Long Name (Defect name) (specified by priority) of an Issue on ReportPortal for
* the current project. If there is no such issue found in Project Setting the value will be used "as is" and sent as
* Issue Type (Locator).
*
* @return Type (Locator), Short Name (Abbreviation) or Long Name (Defect name) of an Issue
*/
String value();

/**
* Arbitrary text describing the issue.
*
* @return issue description
*/
String comment() default "";

/**
* Links to External System where this issue is located.
*
* @return External Issue describing object
*/
ExternalIssue[] external() default {};
}

0 comments on commit 304c2ae

Please sign in to comment.