### Question:
WebContainerAuthorizer implements WebAuthorizer { @Override public Principal[] getRoles() { return m_containerRoles.clone(); } WebContainerAuthorizer(); @Override void initialize( final Engine engine, final Properties props ); @Override boolean isUserInRole( final HttpServletRequest request, final Principal role ); @Override boolean isUserInRole( final Session session, final Principal role ); @Override Principal findRole( final String role ); boolean isConstrained( final String url, final Role role ); boolean isContainerAuthorized(); @Override Principal[] getRoles();  }### Answer:
@Test public void testGetRoles() { Principal[] roles = m_authorizer.getRoles(); Assertions.assertEquals( 2, roles.length ); Assertions.assertTrue( ArrayUtils.contains( roles, Role.AUTHENTICATED ) ); Assertions.assertTrue( ArrayUtils.contains( roles, new Role( "Admin" ) ) ); }
@Test public void testRoles() throws Exception { Role[] roles = m_authorizer.getRoles( m_webxml ); boolean found = false; for ( int i = 0; i < roles.length; i++ ) { if ( roles[i].equals( Role.AUTHENTICATED ) ) { found = true; } } Assertions.assertTrue( found, "Didn't find AUTHENTICATED" ); for ( int i = 0; i < roles.length; i++ ) { if ( roles[i].equals( new Role( "Admin" ) ) ) { found = true; } } Assertions.assertTrue( found, "Didn't find ADMIN" ); }