Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

TestKit - How to change the rest call username and password?

Alex M April 22, 2014

Hi,

I'm trying to use the JIRA's TestKit tool. Is there a way to change the default authentication credentials? i.e. Instead of using admin/admin change it to tester/tester?

Thanks!

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2014

The user and password are not configurable through property, but you can call com.atlassian.jira.testkit.client.RestApiClient.loginAs(String, String) method on any of the "Control" classes(i.e. com.atlassian.jira.testkit.client.IssueTypeControl, com.atlassian.jira.testkit.client.ProjectControl, etc...) and the credentials will be "remembered" and any subsequent call will use them.

TestKit is also open source, so if you need to have the credentials configurable you can always contribute this to the project :)

https://bitbucket.org/atlassian/jira-testkit

Alex M April 22, 2014

So, let's say I need to restore a jira instance, create a user and add a new project, should I be using this:

Backdoor testKit = new Backdoor(new TestKitLocalEnvironmentData());
testKit.restoreDataFromResource("jira.zip", TimeBombLicence.LICENCE_FOR_TESTING); testKit.usersAndGroups().loginAs("testadmin", "testadmin").addUser("test-user");
testKit.project().addProject("Test Project", "TP", "testadmin");

No need to use:

testKit.project().loginAs("testadmin", "testadmin").addProject("Test Project", "TP", "testadmin");

Is that right?

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 22, 2014

Yes that should work

Alex M April 27, 2014

FYI. It seems that I have to include ".loginAs" everytime I use a different object. This will work:

testKit.usersAndGroups().loginAs("testadmin", "testadmin").addUser("test-user");
testKit.usersAndGroups().addUser("test-user-another");

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 27, 2014

Yes for each different "Control" class you'll have to specify user/pass

TAGS
AUG Leaders

Atlassian Community Events