Search in sources :

Example 1 with ANALYST

use of com.thinkbiganalytics.integration.UserContext.User.ANALYST in project kylo by Teradata.

the class EntityLevelAccessIT method assertAnalystCantEditFeed.

private void assertAnalystCantEditFeed(String[] errorMessages) {
    LOG.debug("EntityLevelAccessIT.assertAnalystCantEditFeed");
    runAs(ANALYST);
    FeedMetadata editFeedRequest = getEditFeedRequest();
    NifiFeed feed = createFeed(editFeedRequest);
    LOG.debug("EntityLevelAccessIT.assertAnalystCantEditFeed - asserting analyst cant create the feed");
    if (feed.getErrorMessages() != null && feed.getErrorMessages().get(0) != null) {
        LOG.debug("Analyst feed error message is {}.", feed.getErrorMessages().get(0));
    }
    Assert.assertEquals(1, feed.getErrorMessages().size());
    Assert.assertTrue(Arrays.asList(errorMessages).stream().anyMatch(msg -> feed.getErrorMessages().get(0).startsWith(msg)));
}
Also used : IntegrationTestBase(com.thinkbiganalytics.integration.IntegrationTestBase) Arrays(java.util.Arrays) LoggerFactory(org.slf4j.LoggerFactory) ANALYST(com.thinkbiganalytics.integration.UserContext.User.ANALYST) FeedMetadata(com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata) Response(com.jayway.restassured.response.Response) HTTP_OK(java.net.HttpURLConnection.HTTP_OK) FeedCategory(com.thinkbiganalytics.feedmgr.rest.model.FeedCategory) RestResponseStatus(com.thinkbiganalytics.rest.model.RestResponseStatus) UserGroup(com.thinkbiganalytics.security.rest.model.UserGroup) NifiFeed(com.thinkbiganalytics.feedmgr.rest.model.NifiFeed) FeedServicesAccessControl(com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl) RegisteredTemplate(com.thinkbiganalytics.feedmgr.rest.model.RegisteredTemplate) FeedCategoryRestController(com.thinkbiganalytics.feedmgr.rest.controller.FeedCategoryRestController) Logger(org.slf4j.Logger) ImportTemplate(com.thinkbiganalytics.feedmgr.service.template.importing.model.ImportTemplate) PermissionsChange(com.thinkbiganalytics.security.rest.model.PermissionsChange) ActionGroup(com.thinkbiganalytics.security.rest.model.ActionGroup) Test(org.junit.Test) Action(com.thinkbiganalytics.security.rest.model.Action) FeedSummary(com.thinkbiganalytics.feedmgr.rest.model.FeedSummary) RoleMembership(com.thinkbiganalytics.security.rest.model.RoleMembership) ADMIN(com.thinkbiganalytics.integration.UserContext.User.ADMIN) Assert(org.junit.Assert) HTTP_FORBIDDEN(java.net.HttpURLConnection.HTTP_FORBIDDEN) RoleMembershipChange(com.thinkbiganalytics.security.rest.model.RoleMembershipChange) HTTP_NOT_FOUND(java.net.HttpURLConnection.HTTP_NOT_FOUND) FeedMetadata(com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata) NifiFeed(com.thinkbiganalytics.feedmgr.rest.model.NifiFeed)

Aggregations

Response (com.jayway.restassured.response.Response)1 FeedCategoryRestController (com.thinkbiganalytics.feedmgr.rest.controller.FeedCategoryRestController)1 FeedCategory (com.thinkbiganalytics.feedmgr.rest.model.FeedCategory)1 FeedMetadata (com.thinkbiganalytics.feedmgr.rest.model.FeedMetadata)1 FeedSummary (com.thinkbiganalytics.feedmgr.rest.model.FeedSummary)1 NifiFeed (com.thinkbiganalytics.feedmgr.rest.model.NifiFeed)1 RegisteredTemplate (com.thinkbiganalytics.feedmgr.rest.model.RegisteredTemplate)1 FeedServicesAccessControl (com.thinkbiganalytics.feedmgr.security.FeedServicesAccessControl)1 ImportTemplate (com.thinkbiganalytics.feedmgr.service.template.importing.model.ImportTemplate)1 IntegrationTestBase (com.thinkbiganalytics.integration.IntegrationTestBase)1 ADMIN (com.thinkbiganalytics.integration.UserContext.User.ADMIN)1 ANALYST (com.thinkbiganalytics.integration.UserContext.User.ANALYST)1 RestResponseStatus (com.thinkbiganalytics.rest.model.RestResponseStatus)1 Action (com.thinkbiganalytics.security.rest.model.Action)1 ActionGroup (com.thinkbiganalytics.security.rest.model.ActionGroup)1 PermissionsChange (com.thinkbiganalytics.security.rest.model.PermissionsChange)1 RoleMembership (com.thinkbiganalytics.security.rest.model.RoleMembership)1 RoleMembershipChange (com.thinkbiganalytics.security.rest.model.RoleMembershipChange)1 UserGroup (com.thinkbiganalytics.security.rest.model.UserGroup)1 HTTP_FORBIDDEN (java.net.HttpURLConnection.HTTP_FORBIDDEN)1