NIFI-2940: - Fixing broken integration test following changes introduced in NIFI-2940.

This closes #1653.

Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
Matt Gilman 2017-04-06 14:39:40 -04:00 committed by Bryan Bende
parent 292dd1d66b
commit e8771e59a7
No known key found for this signature in database
GPG Key ID: A0DDA9ED50711C39
1 changed files with 27 additions and 5 deletions

View File

@ -183,19 +183,21 @@ public class ITFlowAccessControl {
*/ */
@Test @Test
public void testGetAction() throws Exception { public void testGetAction() throws Exception {
final String uri = helper.getBaseUrl() + "/flow/history/1"; final String uri = helper.getBaseUrl() + "/flow/history/98766";
ClientResponse response; ClientResponse response;
// the action does not exist... all users should return 403 // the action does not exist... should return 404
// read // read
response = helper.getReadUser().testGet(uri); response = helper.getReadUser().testGet(uri);
assertEquals(403, response.getStatus()); assertEquals(404, response.getStatus());
// read/write // read/write
response = helper.getReadWriteUser().testGet(uri); response = helper.getReadWriteUser().testGet(uri);
assertEquals(403, response.getStatus()); assertEquals(404, response.getStatus());
// no read access should return 403
// write // write
response = helper.getWriteUser().testGet(uri); response = helper.getWriteUser().testGet(uri);
@ -213,7 +215,27 @@ public class ITFlowAccessControl {
*/ */
@Test @Test
public void testGetComponentHistory() throws Exception { public void testGetComponentHistory() throws Exception {
testComponentSpecificGetUri(helper.getBaseUrl() + "/flow/history/components/my-component"); final String uri = helper.getBaseUrl() + "/flow/history/components/my-component-id";
// will succeed due to controller level access
// read
ClientResponse response = helper.getReadUser().testGet(uri);
assertEquals(200, response.getStatus());
// read/write
response = helper.getReadWriteUser().testGet(uri);
assertEquals(200, response.getStatus());
// will be denied because component does not exist and no controller level access
// write
response = helper.getWriteUser().testGet(uri);
assertEquals(403, response.getStatus());
// none
response = helper.getNoneUser().testGet(uri);
assertEquals(403, response.getStatus());
} }
public void testComponentSpecificGetUri(final String uri) throws Exception { public void testComponentSpecificGetUri(final String uri) throws Exception {