@Before public void setup() { mockedCmdContext = mock(CommandContext.class); mockedConfiguration = mock(ProcessEngineConfigurationImpl.class); authorizationManager = spy(new AuthorizationManager()); mockedEntityManager = mock(DbEntityManager.class); when(mockedCmdContext.getSession(eq(DbEntityManager.class))).thenReturn(mockedEntityManager); when(authorizationManager.filterAuthenticatedGroupIds(eq(AUTHENTICATED_GROUPS))).thenReturn(AUTHENTICATED_GROUPS); when(mockedCmdContext.getAuthentication()).thenReturn(new Authentication(AUTHENTICATED_USER_ID, AUTHENTICATED_GROUPS)); when(mockedCmdContext.isAuthorizationCheckEnabled()).thenReturn(true); when(mockedConfiguration.isAuthorizationEnabled()).thenReturn(true); Context.setCommandContext(mockedCmdContext); Context.setProcessEngineConfiguration(mockedConfiguration); }
Context.setProcessEngineConfiguration(processEngineConfiguration);
Context.setProcessEngineConfiguration(processEngineConfiguration);
@Before public void setup() { mockedCmdContext = mock(CommandContext.class); mockedConfiguration = mock(ProcessEngineConfigurationImpl.class); authorizationManager = spy(new AuthorizationManager()); mockedEntityManager = mock(DbEntityManager.class); when(mockedCmdContext.getSession(eq(DbEntityManager.class))).thenReturn(mockedEntityManager); when(authorizationManager.filterAuthenticatedGroupIds(eq(AUTHENTICATED_GROUPS))).thenReturn(AUTHENTICATED_GROUPS); when(mockedCmdContext.getAuthentication()).thenReturn(new Authentication(AUTHENTICATED_USER_ID, AUTHENTICATED_GROUPS)); when(mockedCmdContext.isAuthorizationCheckEnabled()).thenReturn(true); when(mockedConfiguration.isAuthorizationEnabled()).thenReturn(true); Context.setCommandContext(mockedCmdContext); Context.setProcessEngineConfiguration(mockedConfiguration); }
Context.setProcessEngineConfiguration(processEngineConfiguration);