Skip to content
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

Create/Delete permission group in repo #62

Merged
merged 8 commits into from
May 17, 2017

Conversation

j0nathan33
Copy link
Contributor

No description provided.

@cdancy cdancy self-assigned this May 11, 2017
@cdancy cdancy added this to the v0.0.16 milestone May 11, 2017
@cdancy
Copy link
Owner

cdancy commented May 16, 2017

LGTM but will need some live tests before we can merge.

# Conflicts:
#	src/main/java/com/cdancy/bitbucket/rest/features/RepositoryApi.java
#	src/test/java/com/cdancy/bitbucket/rest/features/RepositoryApiMockTest.java
@@ -119,6 +119,18 @@ public void testListPermissionByGroup() {
assertThat(permissionsPage.values()).isEmpty();
}

@Test(dependsOnMethods = "testGetRepository")
public void testCreatePermissionByGroupNonExistent() {
boolean success = api().createPermissionsByGroup(projectKey, repoKey, "REPO_WRITE", randomString());
Copy link
Owner

Choose a reason for hiding this comment

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

This actually returns a 204 no content. Can we update the test to reflect as much as well as the mock test to set the correct return code?

Copy link
Contributor Author

@j0nathan33 j0nathan33 May 17, 2017

Choose a reason for hiding this comment

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

This test is good, because It try to create permission group with group don't existent. If group don't exist, Bitbucket return a 404 Not Found.

@cdancy
Copy link
Owner

cdancy commented May 16, 2017

One minor hiccup and I would like to see actual live tests that can succeed and work. Something like the below would suffice:

    @Test 
    public void testDeletePermissionByGroupNonExistent() {
        boolean success = api().deletePermissionsByGroup(projectKey, repoKey, "some-name");
        assertThat(success).isTrue();
    }
    
    @Test (dependsOnMethods = "testDeletePermissionByGroupNonExistent")
    public void testCreatePermissionByGroupNonExistent() {
        boolean success = api().createPermissionsByGroup(projectKey, repoKey, "REPO_WRITE", "some-name");
        assertThat(success).isTrue();
    }

@j0nathan33
Copy link
Contributor Author

For me, default group in bitbucket is stash-users.

@cdancy
Copy link
Owner

cdancy commented May 17, 2017

For me, default group in bitbucket is stash-users.

@j0nathan33 yeah that works. One of these days we'll have to get a proper integration test flow going instead of this ad-hoc process I have now. That would be an awesome story/ISSUE to take on ;)

@cdancy
Copy link
Owner

cdancy commented May 17, 2017

In either event LGTM. Thanks @j0nathan33 !

@cdancy cdancy merged commit e78a83d into cdancy:master May 17, 2017
@j0nathan33 j0nathan33 deleted the repo-permission-create-group branch May 17, 2017 17:51
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