Exemplo n.º 1
0
 @Test
 public void shouldFailWithNoRoles() {
   roleBasedIdentity.addRoles();
   assertThatThrownBy(() -> controller.doWork())
       .isInstanceOf(MissingRolesException.class)
       .hasMessageContaining("jane, bob, ralph");
 }
Exemplo n.º 2
0
 @Test
 public void shouldSucceedWithAllRoles() {
   roleBasedIdentity.addRoles("jane", "bob", "ralph");
   String s = controller.doWork();
   assertThat(s).isEqualTo(SUCCESS);
 }