use of org.camunda.bpm.engine.impl.identity.Authentication in project camunda-bpm-platform by camunda.
the class IdentityServiceTest method testSetAuthenticatedUserId.
@Test
public void testSetAuthenticatedUserId() {
identityService.setAuthenticatedUserId("john");
Authentication currentAuthentication = identityService.getCurrentAuthentication();
assertNotNull(currentAuthentication);
assertEquals("john", currentAuthentication.getUserId());
assertNull(currentAuthentication.getGroupIds());
assertNull(currentAuthentication.getTenantIds());
}
use of org.camunda.bpm.engine.impl.identity.Authentication in project camunda-bpm-platform by camunda.
the class RuntimeAuthorizationQueryPerformanceTest method params.
@Parameters(name = "{0} - {4}")
public static Iterable<Object[]> params() {
final ArrayList<Object[]> params = new ArrayList<Object[]>();
for (Object[] queryResourcesAndPermission : queryResourcesAndPermissions) {
for (Authentication authentication : authentications) {
Object[] array = new Object[queryResourcesAndPermission.length + 1];
System.arraycopy(queryResourcesAndPermission, 0, array, 0, queryResourcesAndPermission.length);
array[queryResourcesAndPermission.length] = authentication;
params.add(array);
}
}
return params;
}
use of org.camunda.bpm.engine.impl.identity.Authentication in project camunda-bpm-platform by camunda.
the class HistoryAuthorizationQueryPerformanceTest method params.
@Parameters(name = "{0} - {4}")
public static Iterable<Object[]> params() {
final ArrayList<Object[]> params = new ArrayList<Object[]>();
for (Object[] queryResourcesAndPermission : queryResourcesAndPermissions) {
for (Authentication authentication : authentications) {
Object[] array = new Object[queryResourcesAndPermission.length + 1];
System.arraycopy(queryResourcesAndPermission, 0, array, 0, queryResourcesAndPermission.length);
array[queryResourcesAndPermission.length] = authentication;
params.add(array);
}
}
return params;
}
use of org.camunda.bpm.engine.impl.identity.Authentication in project camunda-bpm-platform by camunda.
the class RepositoryAuthorizationQueryPerformanceTest method params.
@Parameters(name = "{0} - {4}")
public static Iterable<Object[]> params() {
final ArrayList<Object[]> params = new ArrayList<Object[]>();
for (Object[] queryResourcesAndPermission : queryResourcesAndPermissions) {
for (Authentication authentication : authentications) {
Object[] array = new Object[queryResourcesAndPermission.length + 1];
System.arraycopy(queryResourcesAndPermission, 0, array, 0, queryResourcesAndPermission.length);
array[queryResourcesAndPermission.length] = authentication;
params.add(array);
}
}
return params;
}
use of org.camunda.bpm.engine.impl.identity.Authentication in project camunda-bpm-platform by camunda.
the class FetchAndLockRestServiceInteractionTest method shouldSetAuthenticationProperly.
@Ignore
@Test
public void shouldSetAuthenticationProperly() {
when(identityServiceMock.getCurrentAuthentication()).thenReturn(new Authentication(MockProvider.EXAMPLE_USER_ID, groupIds, tenantIds));
FetchExternalTasksExtendedDto fetchExternalTasksDto = createDto(500L);
given().contentType(ContentType.JSON).body(fetchExternalTasksDto).pathParam("name", "default").when().post(FETCH_EXTERNAL_TASK_URL_NAMED_ENGINE);
ArgumentCaptor<Authentication> argumentCaptor = ArgumentCaptor.forClass(Authentication.class);
verify(identityServiceMock, atLeastOnce()).setAuthentication(argumentCaptor.capture());
assertThat(argumentCaptor.getValue().getUserId(), is(MockProvider.EXAMPLE_USER_ID));
assertThat(argumentCaptor.getValue().getGroupIds(), is(groupIds));
assertThat(argumentCaptor.getValue().getTenantIds(), is(tenantIds));
}
Aggregations