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