use of com.icthh.xm.commons.security.XmAuthenticationContextHolder in project xm-ms-entity by xm-online.
the class XmAuthContextHolderDefaultTestConfiguration method xmAuthenticationContextHolder.
@Bean
@Primary
public XmAuthenticationContextHolder xmAuthenticationContextHolder() {
XmAuthenticationContext context = mock(XmAuthenticationContext.class);
when(context.hasAuthentication()).thenReturn(true);
when(context.getLogin()).thenReturn(Optional.of("testLogin"));
when(context.getUserKey()).thenReturn(Optional.of("ACCOUNT.TEST"));
XmAuthenticationContextHolder holder = mock(XmAuthenticationContextHolder.class);
when(holder.getContext()).thenReturn(context);
return holder;
}
use of com.icthh.xm.commons.security.XmAuthenticationContextHolder in project xm-ms-entity by xm-online.
the class ProfileResourceIntTest method xmAuthenticationContextHolder.
@Bean
@Primary
public XmAuthenticationContextHolder xmAuthenticationContextHolder() {
XmAuthenticationContext context = mock(XmAuthenticationContext.class);
when(context.hasAuthentication()).thenReturn(true);
when(context.isFullyAuthenticated()).thenReturn(true);
when(context.getUserKey()).thenReturn(Optional.of(DEFAULT_USER_KEY));
when(context.getRequiredUserKey()).thenReturn(DEFAULT_USER_KEY);
XmAuthenticationContextHolder holder = mock(XmAuthenticationContextHolder.class);
when(holder.getContext()).thenReturn(context);
return holder;
}
use of com.icthh.xm.commons.security.XmAuthenticationContextHolder in project xm-ms-entity by xm-online.
the class CommentResourceIntTest method xmAuthenticationContextHolder.
@Bean
@Primary
public XmAuthenticationContextHolder xmAuthenticationContextHolder() {
XmAuthenticationContext context = mock(XmAuthenticationContext.class);
when(context.hasAuthentication()).thenReturn(true);
when(context.getLogin()).thenReturn(Optional.of("testLogin"));
when(context.getUserKey()).thenReturn(Optional.of(DEFAULT_USER_KEY));
XmAuthenticationContextHolder holder = mock(XmAuthenticationContextHolder.class);
when(holder.getContext()).thenReturn(context);
return holder;
}
Aggregations