use of org.mule.runtime.api.security.SecurityContext in project mule by mulesoft.
the class PetstoreSecurityContextTestCase method filteredProviders.
@Test
public void filteredProviders() throws Exception {
SecurityContext context = flowRunner("setSecureCageFilterProviders").withVariable("providers", asList(MOCK_PROVIDER)).run().getSecurityContext();
assertThat(context, is(notNullValue()));
assertThat(context, is(securityContext));
}
use of org.mule.runtime.api.security.SecurityContext in project mule by mulesoft.
the class PetstoreSecurityContextTestCase method changedSecurityContext.
@Test
public void changedSecurityContext() throws Exception {
SecurityContext context = flowRunner("setSecureCage").run().getSecurityContext();
assertThat(context, is(notNullValue()));
assertThat(context, is(securityContext));
}
use of org.mule.runtime.api.security.SecurityContext in project mule by mulesoft.
the class MuleEventTestCase method createTestAuthentication.
private SecurityContext createTestAuthentication() {
Authentication auth = new DefaultMuleAuthentication(new DefaultMuleCredentials("dan", new char[] { 'd', 'f' }));
SecurityContext securityContext = new DefaultSecurityContextFactory().create(auth.setProperties(singletonMap("key1", "value1")));
return securityContext;
}
Aggregations