Search in sources :

Example 1 with Link

use of com.sonarsource.governance.projectdump.protobuf.ProjectDump.Link in project sonarqube by SonarSource.

the class ExportLinksStepTest method test_all_fields.

@Test
public void test_all_fields() {
    ProjectLinkDto link = db.componentLinks().insertCustomLink(PROJECT, l -> l.setName("name").setHref("href").setType("type"));
    underTest.execute(new TestComputationStepContext());
    Link reloaded = dumpWriter.getWrittenMessagesOf(DumpElement.LINKS).get(0);
    assertThat(reloaded.getUuid()).isEqualTo(link.getUuid());
    assertThat(reloaded.getName()).isEqualTo(link.getName());
    assertThat(reloaded.getHref()).isEqualTo(link.getHref());
    assertThat(reloaded.getType()).isEqualTo(link.getType());
}
Also used : ProjectLinkDto(org.sonar.db.component.ProjectLinkDto) TestComputationStepContext(org.sonar.ce.task.step.TestComputationStepContext) Link(com.sonarsource.governance.projectdump.protobuf.ProjectDump.Link) Test(org.junit.Test)

Aggregations

Link (com.sonarsource.governance.projectdump.protobuf.ProjectDump.Link)1 Test (org.junit.Test)1 TestComputationStepContext (org.sonar.ce.task.step.TestComputationStepContext)1 ProjectLinkDto (org.sonar.db.component.ProjectLinkDto)1