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

Add a WebAc ACL header to response #48

Closed
wants to merge 6 commits into from
Closed

Add a WebAc ACL header to response #48

wants to merge 6 commits into from

Conversation

whikloj
Copy link
Member

@whikloj whikloj commented Nov 3, 2015

Addresses FCREPO-1795

Requires fcrepo/fcrepo#939

return;
}
}
assertEquals("Missing Link Header " + aclLink.toString(), 1, 0);
Copy link
Member Author

Choose a reason for hiding this comment

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

@awoods @acoburn @peichman-umd
This is the cause of the conflict. I can solve it, but I know this is ugly and would appreciate any suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

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

@whikloj in this case, you can just roll back the change on this line from #47 so you get:

try (final CloseableHttpResponse response = execute(request)) {
    assertEquals(HttpStatus.SC_OK, getStatus(response));
    // the rest of your code from your PR
}

It's fine to use the try block if you actually need to inspect the response. For merely checking the status code it was unnecessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

@acoburn but is a for loop the best way to do this type of testing? It seems very basic, but perhaps I am just expecting more.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, that code should definitely be changed:

Optional<String> header = Arrays.asList(response.getHeaders("Link")).stream().map(Header::getValue).filter(aclLink::equals).findFirst();
assertTrue("Missing Link header", header.isPresent());

Copy link
Member Author

Choose a reason for hiding this comment

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

@whikloj
Copy link
Member Author

whikloj commented Nov 5, 2015

So the conflicts here are related to the DelegateHeader. I'll have to rebase my changes on fcrepo4 and fcrepo-module-auth-webac to test. I'll do it in the morning.

@whikloj
Copy link
Member Author

whikloj commented Nov 5, 2015

Rebased on master.

@awoods
Copy link
Member

awoods commented Nov 5, 2015

Resolved with: 6d7f196

@awoods awoods closed this Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants