use of org.springframework.security.core.context.SecurityContextImpl in project head by mifos.
the class SavingsApplyAdjustmentActionStrutsTest method setUp.
@Before
public void setUp() throws Exception {
userContext = TestObjectFactory.getContext();
userContext.setPreferredLocale(new Locale("en", "GB"));
addRequestParameter("recordLoanOfficerId", "1");
addRequestParameter("recordOfficeId", "1");
request.getSession().setAttribute(Constants.USER_CONTEXT_KEY, userContext);
request.getSession(false).setAttribute("ActivityContext", TestObjectFactory.getActivityContext());
flowKey = createFlow(request, SavingsApplyAdjustmentAction.class);
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
SecurityContext securityContext = new SecurityContextImpl();
MifosUser principal = new MifosUserBuilder().build();
Authentication authentication = new TestingAuthenticationToken(principal, principal);
securityContext.setAuthentication(authentication);
SecurityContextHolder.setContext(securityContext);
}
use of org.springframework.security.core.context.SecurityContextImpl in project head by mifos.
the class SavingsClosureActionStrutsTest method setUp.
@Before
public void setUp() throws Exception {
userContext = TestUtils.makeUser();
addRequestParameter("recordLoanOfficerId", "1");
addRequestParameter("recordOfficeId", "1");
request.getSession().setAttribute(Constants.USER_CONTEXT_KEY, userContext);
request.getSession(false).setAttribute("ActivityContext", TestObjectFactory.getActivityContext());
flowKey = createFlow(request, SavingsClosureAction.class);
request.setAttribute(Constants.CURRENTFLOWKEY, flowKey);
addRequestParameter(Constants.CURRENTFLOWKEY, flowKey);
SecurityContext securityContext = new SecurityContextImpl();
MifosUser principal = new MifosUserBuilder().build();
Authentication authentication = new TestingAuthenticationToken(principal, principal);
securityContext.setAuthentication(authentication);
SecurityContextHolder.setContext(securityContext);
}
use of org.springframework.security.core.context.SecurityContextImpl in project head by mifos.
the class CenterActionStrutsTest method setNonLoanOfficerMifosUser.
private void setNonLoanOfficerMifosUser() {
SecurityContext securityContext = new SecurityContextImpl();
MifosUser principal = new MifosUserBuilder().nonLoanOfficer().build();
Authentication authentication = new TestingAuthenticationToken(principal, principal);
securityContext.setAuthentication(authentication);
SecurityContextHolder.setContext(securityContext);
}
use of org.springframework.security.core.context.SecurityContextImpl in project head by mifos.
the class AspectJApprovalInterceptorTest method init.
@BeforeClass
public static void init() {
SecurityContext securityContext = new SecurityContextImpl();
MifosUser principal = new MifosUserBuilder().nonLoanOfficer().withAdminRole().build();
Authentication authentication = new TestingAuthenticationToken(principal, principal);
securityContext.setAuthentication(authentication);
SecurityContextHolder.setContext(securityContext);
}
use of org.springframework.security.core.context.SecurityContextImpl in project head by mifos.
the class ApprovalServiceTest method init.
@BeforeClass
public static void init() {
SecurityContext securityContext = new SecurityContextImpl();
MifosUser principal = new MifosUserBuilder().nonLoanOfficer().withAdminRole().build();
Authentication authentication = new TestingAuthenticationToken(principal, principal);
securityContext.setAuthentication(authentication);
SecurityContextHolder.setContext(securityContext);
}
Aggregations