Examples of selectTemplateByKey()


Examples of org.sonar.core.permission.PermissionTemplateDao.selectTemplateByKey()

  @Test
  public void should_execute_on_valid_parameters() throws Exception {

    final PermissionTemplateDao permissionTemplateDao = mock(PermissionTemplateDao.class);
    when(permissionTemplateDao.selectTemplateByKey("my_template")).thenReturn(new PermissionTemplateDto().setId(1L));

    PermissionTemplateUpdater updater =
      new PermissionTemplateUpdater("my_template", UserRole.USER, "user", permissionTemplateDao, userDao) {
      @Override
      void doExecute(Long templateId, String permission) {
View Full Code Here

Examples of org.sonar.core.permission.PermissionTemplateDao.selectTemplateByKey()

  public void should_validate_template_reference() throws Exception {
    expected.expect(BadRequestException.class);
    expected.expectMessage("Unknown template:");

    final PermissionTemplateDao permissionTemplateDao = mock(PermissionTemplateDao.class);
    when(permissionTemplateDao.selectTemplateByKey("my_template")).thenReturn(null);

    PermissionTemplateUpdater updater =
      new PermissionTemplateUpdater("my_template", UserRole.USER, "user", permissionTemplateDao, userDao) {
        @Override
        void doExecute(Long templateId, String permission) {
View Full Code Here

Examples of org.sonar.core.permission.PermissionTemplateDao.selectTemplateByKey()

  public void should_validate_permission_reference() throws Exception {
    expected.expect(BadRequestException.class);
    expected.expectMessage("Invalid permission:");

    final PermissionTemplateDao permissionTemplateDao = mock(PermissionTemplateDao.class);
    when(permissionTemplateDao.selectTemplateByKey("my_template")).thenReturn(new PermissionTemplateDto().setId(1L));

    PermissionTemplateUpdater updater =
      new PermissionTemplateUpdater("my_template", "invalid", "user", permissionTemplateDao, userDao) {
        @Override
        void doExecute(Long templateId, String permission) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.