* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-
package org.sonar.server.ui.ws;
import com.google.common.collect.Lists;
private void writeComponent(JsonWriter json, DbSession session, ComponentDto component, @Nullable SnapshotDto analysis) {
json.prop("key", component.key())
+ .prop("organization", component.getOrganizationKey())
.prop("id", component.uuid())
.prop("name", component.name())
.prop("description", component.description())
import org.sonar.db.component.ComponentDto;
import org.sonar.db.component.SnapshotDto;
import org.sonar.db.metric.MetricDto;
+import org.sonar.db.organization.OrganizationDto;
import org.sonar.db.property.PropertyDbTester;
import org.sonar.db.property.PropertyDto;
import org.sonar.db.qualitygate.QualityGateDto;
@Before
public void before() {
- project = newProjectDto(dbTester.getDefaultOrganization(), "abcd")
+ OrganizationDto organization = dbTester.organizations().insertForKey("my-org");
+ project = newProjectDto(organization, "abcd")
.setKey(PROJECT_KEY)
.setName("Polop")
.setDescription("test project")
@Test
public void test_example_response() throws Exception {
init(createPages());
- ComponentDto project = newProjectDto(dbTester.getDefaultOrganization(), "ABCD")
+ OrganizationDto organizationDto = dbTester.organizations().insertForKey("my-org-1");
+ ComponentDto project = newProjectDto(organizationDto, "ABCD")
.setKey("org.codehaus.sonar:sonar")
.setName("Sonarqube")
.setDescription("Open source platform for continuous inspection of code quality");