Skip to content

Commit

Permalink
SLI-1680 Update documentation links to match the rebranding
Browse files Browse the repository at this point in the history
  • Loading branch information
nquinquenel committed Nov 28, 2024
1 parent 30a595a commit 0557d87
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package org.sonarlint.intellij.documentation
object SonarLintDocumentation {

object Intellij {
const val BASE_DOCS_URL = "https://docs.sonarsource.com/sonarlint/intellij"
const val BASE_DOCS_URL = "https://docs.sonarsource.com/sonarqube-for-ide/intellij"
const val CONNECTED_MODE_LINK = "$BASE_DOCS_URL/team-features/connected-mode"
const val CONNECTED_MODE_SETUP_LINK = "$BASE_DOCS_URL/team-features/connected-mode-setup"
const val SECURITY_HOTSPOTS_LINK = "$BASE_DOCS_URL/using-sonarlint/security-hotspots"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.sonarlint.intellij.documentation

import java.net.HttpURLConnection
import java.net.URL
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.TestInstance
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.MethodSource

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Disabled("Only for manual testing - this test should not impact realisability")
class SonarLintDocumentationTests {

@ParameterizedTest
@MethodSource("pagesProvider")
fun should_verify_page_is_not_404(pageUrl: String) {
val url = URL(pageUrl)

val connection = url.openConnection() as HttpURLConnection

val responseCode = connection.responseCode
assertThat(responseCode).isNotEqualTo(404)
}

private fun pagesProvider() = listOf(
SonarLintDocumentation.Intellij.BASE_DOCS_URL,
SonarLintDocumentation.Intellij.CONNECTED_MODE_LINK,
SonarLintDocumentation.Intellij.CONNECTED_MODE_SETUP_LINK,
SonarLintDocumentation.Intellij.SECURITY_HOTSPOTS_LINK,
SonarLintDocumentation.Intellij.TAINT_VULNERABILITIES_LINK,
SonarLintDocumentation.Intellij.CLEAN_CODE_LINK,
SonarLintDocumentation.Intellij.SUPPORT_POLICY_LINK,
SonarLintDocumentation.Intellij.FOCUS_ON_NEW_CODE_LINK,
SonarLintDocumentation.Intellij.CONNECTED_MODE_BENEFITS_LINK,
SonarLintDocumentation.Intellij.SHARING_CONNECTED_MODE_CONFIGURATION_LINK,
SonarLintDocumentation.Intellij.TROUBLESHOOTING_CONNECTED_MODE_SETUP_LINK,
SonarLintDocumentation.Intellij.RULE_SECTION_LINK,
SonarLintDocumentation.Intellij.FILE_EXCLUSION_LINK,

SonarLintDocumentation.SonarQube.SMART_NOTIFICATIONS,

SonarLintDocumentation.SonarCloud.SMART_NOTIFICATIONS,

SonarLintDocumentation.Marketing.COMPARE_SERVER_PRODUCTS_LINK,
SonarLintDocumentation.Marketing.SONARQUBE_EDITIONS_DOWNLOADS_LINK,
SonarLintDocumentation.Marketing.SONARCLOUD_PRODUCT_LINK,
SonarLintDocumentation.Marketing.SONARCLOUD_PRODUCT_SIGNUP_LINK,
)

}

0 comments on commit 0557d87

Please sign in to comment.