Skip to content

Add possibility to create Default Reviewers #82

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

Merged
merged 42 commits into from
Jun 6, 2017

Conversation

j0nathan33
Copy link
Contributor

No description provided.

@cdancy cdancy self-assigned this May 30, 2017
@cdancy cdancy added this to the v0.0.16 milestone May 30, 2017
Jonathan Doire added 2 commits June 5, 2017 17:13
…o defaultReviewers-list

# Conflicts:
#	src/test/java/com/cdancy/bitbucket/rest/features/RepositoryApiLiveTest.java
Jonathan Doire added 3 commits June 5, 2017 17:57
# Conflicts:
#	src/test/java/com/cdancy/bitbucket/rest/features/BranchApiLiveTest.java
#	src/test/java/com/cdancy/bitbucket/rest/features/DefaultReviewersApiLiveTest.java
Matcher matcherSrc = Matcher.create(Matcher.MatcherId.ANY, true);
Matcher matcherDst = Matcher.create(Matcher.MatcherId.ANY, true);
List<User> listUser = new ArrayList<>();
listUser.add(User.create("test", "test@test.com", 1, "test", true, "test", "NORMAL"));
Copy link
Owner

Choose a reason for hiding this comment

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

Will this work if you just add any user? If not we can always use the default logged in user we are running these tests with.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I will change it for defaultUser.


private GeneratedTestContents generatedTestContents;


Copy link
Owner

Choose a reason for hiding this comment

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

Remove new line?

@Test(groups = "live", testName = "DefaultReviewersApiLiveTest", singleThreaded = true)
public class DefaultReviewersApiLiveTest extends BaseBitbucketApiLiveTest {


Copy link
Owner

Choose a reason for hiding this comment

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

Remove extra newline?

@cdancy cdancy modified the milestones: v0.9.0, v0.0.16 Jun 6, 2017
Jonathan Doire added 10 commits June 6, 2017 08:24
…o defaultReviewers-create

# Conflicts:
#	src/main/java/com/cdancy/bitbucket/rest/domain/defaultreviewers/Condition.java
#	src/main/java/com/cdancy/bitbucket/rest/features/DefaultReviewersApi.java
#	src/test/java/com/cdancy/bitbucket/rest/features/DefaultReviewersApiLiveTest.java
#	src/test/java/com/cdancy/bitbucket/rest/features/DefaultReviewersApiMockTest.java
return defaultUserAsString;
}

protected synchronized User getDefaultUser() {
Copy link
Owner

Choose a reason for hiding this comment

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

I like this better. Would you mind just removing the defaultUserAsString and we will standardize on just using the User object across the board. All classes can then just query the User object for its actual name.

if (username.equals(user.slug())) {
defaultUser = user;
break;
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

I would just return once we've found the correct user and throw an exception if somehow we get past the for loop.

validCondition(returnCondition, requiredApprover, Matcher.MatcherId.ANY_REF, Matcher.MatcherId.ANY_REF);
}

@Test(dependsOnMethods = {"testListDefaultReviewersOnNewRepo", "testCreateCondition"})
Copy link
Owner

Choose a reason for hiding this comment

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

We only need to depend on method testCreateCondition as it in turn depends on method testListDefaultReviewersOnNewRepo .

validCondition(returnCondition, requiredApprover, Matcher.MatcherId.MASTER, Matcher.MatcherId.DEVELOPMENT);
}

@Test(dependsOnMethods = {"testListDefaultReviewersOnNewRepo", "testCreateCondition", "testCreateConditionMatcherDifferent"})
Copy link
Owner

Choose a reason for hiding this comment

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

We only need to depend on method testCreateConditionMatcherDifferent if I'm not mistaken?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I need to depend on method testCreateCondition and testCreateConditionMatcherDifferent because testListConditions do check if It have 2 conditions return by api. I will remove third.

@cdancy
Copy link
Owner

cdancy commented Jun 6, 2017

LGTM. @j0nathan33 merging this now but am making one minor change to the BaseBitbucketApiLiveTest class to query for the user out right instead of by group. Shouldn't effect your other PR's but giving the FYI just incase.

@cdancy cdancy merged commit 3b76c22 into cdancy:master Jun 6, 2017
@j0nathan33 j0nathan33 deleted the defaultReviewers-create branch June 6, 2017 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants