Examples of PropertyDto


Examples of org.sonar.core.properties.PropertyDto

  @Test
  public void return_no_secured_settings_without_scan_and_preview_permission() throws Exception {
    MockUserSession.set().setLogin("john").setGlobalPermissions();

    when(propertiesDao.selectGlobalProperties(session)).thenReturn(newArrayList(
      new PropertyDto().setKey("foo").setValue("bar"),
      new PropertyDto().setKey("foo.secured").setValue("1234"),
      new PropertyDto().setKey("foo.license.secured").setValue("5678")
    ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "global");
    request.execute().assertJson(getClass(), "return_no_secured_settings_without_scan_and_preview_permission.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    // Project without modules
    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(Collections.<ComponentDto>emptyList());

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_settings.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    // Project without modules
    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(Collections.<ComponentDto>emptyList());

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key()).setParam("preview", "true");
    request.execute().assertJson(getClass(), "not_returned_secured_settings_with_only_preview_permission.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER"),
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_module_settings.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));
    // No property on module -> should have the same than project

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_module_settings_inherited_from_project.json");
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module));
    when(componentDao.findModulesByProject(module.key(), session)).thenReturn(newArrayList(subModule));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER"),
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    when(propertiesDao.selectProjectProperties(subModule.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER-DAO")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_module_with_sub_module.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(project);
    when(componentDao.findModulesByProject(project.key(), session)).thenReturn(newArrayList(module, module2));

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-SERVER"),
      // This property should not be found on the other module
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    when(propertiesDao.selectProjectProperties(module2.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR-APPLICATION")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_with_two_modules.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    // No root project will be found on provisioned project
    when(componentDao.getNullableRootProjectByKey(project.key(), session)).thenReturn(null);

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", project.key());
    request.execute().assertJson(getClass(), "return_project_settings.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    when(componentDao.getNullableRootProjectByKey(subModule.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(module.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(subModule.key(), session)).thenReturn(module);

    when(propertiesDao.selectProjectProperties(subModule.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR"),
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john"),
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", subModule.key());
    request.execute().assertJson(getClass(), "return_sub_module_settings.json");
  }
View Full Code Here

Examples of org.sonar.core.properties.PropertyDto

    when(componentDao.getNullableRootProjectByKey(subModule.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(module.key(), session)).thenReturn(project);
    when(componentDao.getParentModuleByKey(subModule.key(), session)).thenReturn(module);

    when(propertiesDao.selectProjectProperties(project.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.project.key").setValue("SONAR")
      ));

    when(propertiesDao.selectProjectProperties(module.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.jira.login.secured").setValue("john")
      ));

    when(propertiesDao.selectProjectProperties(subModule.key(), session)).thenReturn(newArrayList(
      new PropertyDto().setKey("sonar.coverage.exclusions").setValue("**/*.java")
      ));

    WsTester.TestRequest request = tester.newGetRequest("batch", "project").setParam("key", subModule.key());
    request.execute().assertJson(getClass(), "return_sub_module_settings_including_settings_from_parent_modules.json");
  }
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.