Hi, you can setup jaas (with @ContainerProperties setting java.security.auth.login.config=jaas.config and jaas.config in the classpath) to use PropertiesLoginModule and then rely on users.properties and groups.properties in the classpath or just override the security service to implement a mock: https://github.com/apache/tomee/blob/4b9d8c9d221948547d49427077fcf68709a186bd/server/openejb-cxf-rs/src/test/java/org/apache/openejb/server/cxf/rs/SecurityContextIsUsableTest.java#L73
Note: I think by default PropertiesLoginModule is setup so just adding users.properties with "me=password" and a groups.properties with "superrole=me" in the classpath should work Romain Manni-Bucau @rmannibucau <https://twitter.com/rmannibucau> | Blog <https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-06-06 16:17 GMT+02:00 mark.cavender <[email protected]>: > Hi, > > I am trying to run an integration test where I actually call a restful web > service (WebClient). The web service uses @RolesAllowed. I have been > trying to do this with the ApplicationComposer. Since I am actually > testing > with OpenEJB in the JUnit, how do I associate an account with a group? > Thanks in advance, > > Mark > > > > -- > View this message in context: > http://tomee-openejb.979440.n4.nabble.com/Integration-testing-with-JUnit-Rest-and-RolesAllowed-tp4678780.html > Sent from the TomEE Users mailing list archive at Nabble.com. >
