Where answers come from

Some pages can ask a language model questions. Set this up once; your choice is remembered in this browser for the whole site.

Model source
Use another source instead
You sign in on OpenRouter; it gives this page a key for your account.

EJB3 security annotations

Originally published .

So with EJB3 declarative security annotations I can do things like this:


@DeclareRoles("ADMIN", "USER")

public class Frobnicator {

  @RolesAllowed("ADMIN","USER")

  public boolean checkFrobnication() { ... }

   @RolesAllowed("ADMIN")

  public boolean fullyFrobnicate() { ... }

}

Which will allow me to lift the Frobnicator bean out and drop it into a JUnit tests as a POJO. The POJO can then call the methods in Frobnicator without authentication. This helps doing unit tests and getting higher code coverage. But… isn’t the authentication part of what I’ve written? Isn’t that something that needs testing?

So my predicament is how do I provide automated acceptance testing for all the permutations of roles in the system?

Explore the map · Browse by topic and date