mirror of https://github.com/apache/nifi.git
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:
parent
292dd1d66b
commit
e8771e59a7
|
@ -183,19 +183,21 @@ public class ITFlowAccessControl {
|
|||
*/
|
||||
@Test
|
||||
public void testGetAction() throws Exception {
|
||||
final String uri = helper.getBaseUrl() + "/flow/history/1";
|
||||
final String uri = helper.getBaseUrl() + "/flow/history/98766";
|
||||
|
||||
ClientResponse response;
|
||||
|
||||
// the action does not exist... all users should return 403
|
||||
// the action does not exist... should return 404
|
||||
|
||||
// read
|
||||
response = helper.getReadUser().testGet(uri);
|
||||
assertEquals(403, response.getStatus());
|
||||
assertEquals(404, response.getStatus());
|
||||
|
||||
// read/write
|
||||
response = helper.getReadWriteUser().testGet(uri);
|
||||
assertEquals(403, response.getStatus());
|
||||
assertEquals(404, response.getStatus());
|
||||
|
||||
// no read access should return 403
|
||||
|
||||
// write
|
||||
response = helper.getWriteUser().testGet(uri);
|
||||
|
@ -213,7 +215,27 @@ public class ITFlowAccessControl {
|
|||
*/
|
||||
@Test
|
||||
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 {
|
||||
|
|
Loading…
Reference in New Issue