Package com.privalia.qa.utils
Class JiraConnector
- java.lang.Object
-
- com.privalia.qa.utils.JiraConnector
-
public class JiraConnector extends Object
An small utility for interacting with entities in Jira- Author:
- José Fernández
-
-
Field Summary
Fields Modifier and Type Field Description static String
JIRA_PROPERTIES_FILE
-
Constructor Summary
Constructors Constructor Description JiraConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
entityShouldRun(String entity)
Determines if the entity status matches any of the expected statusesString
getFirstTicketReference(List<String> tags)
Returns the first reference to the jira ticket from the tag referenceString
getProperty(String property, String defaultValue)
Reads the given key from the properties file.void
postCommentToEntity(String entity, String message)
Adds a new comment to the entityvoid
transitionEntity(String entity)
Transition (change status) of the entity to the value provided in the properties file.
-
-
-
Field Detail
-
JIRA_PROPERTIES_FILE
public static final String JIRA_PROPERTIES_FILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProperty
public String getProperty(String property, String defaultValue)
Reads the given key from the properties file. The system will try to locate the key first in the maven variables (System.getProperty) and if not found will look for it in the properties file. If the value is still not found it will return the default value (if provided) or an exception- Parameters:
property
- keydefaultValue
- defaultValue- Returns:
- value
-
entityShouldRun
public Boolean entityShouldRun(String entity) throws Exception
Determines if the entity status matches any of the expected statuses- Parameters:
entity
- Entity identifier (i.e QMS-123)- Returns:
- True if the entity status is within the expected statuses
- Throws:
Exception
- Exception
-
postCommentToEntity
public void postCommentToEntity(String entity, String message) throws Exception
Adds a new comment to the entity- Parameters:
entity
- Entity identifier (i.e QMS-123)message
- Message to post- Throws:
Exception
- Exception
-
transitionEntity
public void transitionEntity(String entity) throws Exception
Transition (change status) of the entity to the value provided in the properties file. Will default to "In Progress" is the value is not found- Parameters:
entity
- Entity identifier (i.e QMS-123)- Throws:
Exception
- Exception
-
-