<commit_before>package io.sentry.core

import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNull

class DsnTest {

    @Test
    fun `dsn parsed with path, sets all properties`() {
        val dsn = Dsn("https://publicKey:secretKey@host/path/id")

        assertEquals("https://host/path/api/id", dsn.sentryUri.toURL().toString())
        assertEquals("publicKey", dsn.publicKey)
        assertEquals("secretKey", dsn.secretKey)
        assertEquals("/path/", dsn.path)
        assertEquals("id", dsn.projectId)
    }
<commit_msg>test: adding a test for DSN with query strings, they should be ignored (getsentry/sentry-android#447)<commit_after>package io.sentry.core

import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNull

class DsnTest {

    @Test
    fun `dsn parsed with path, sets all properties`() {
        val dsn = Dsn("https://publicKey:secretKey@host/path/id")

        assertEquals("https://host/path/api/id", dsn.sentryUri.toURL().toString())
        assertEquals("publicKey", dsn.publicKey)
        assertEquals("secretKey", dsn.secretKey)
        assertEquals("/path/", dsn.path)
        assertEquals("id", dsn.projectId)
    }

    @Test
    fun `dsn parsed with path, sets all properties and ignores query strings`() {
        // query strings were once a feature, but no more
        val dsn = Dsn("https://publicKey:secretKey@host/path/id?sample.rate=0.1")

        assertEquals("https://host/path/api/id", dsn.sentryUri.toURL().toString())
        assertEquals("publicKey", dsn.publicKey)
        assertEquals("secretKey", dsn.secretKey)
        assertEquals("/path/", dsn.path)
        assertEquals("id", dsn.projectId)
    }

{'fraction_non_alphanumeric': 0.13160854893138357, 'fraction_numerical': 0.00281214848143982, 'mean_word_length': 3.371007371007371, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7481827', 'n_tokens_mistral': 555, 'n_tokens_neox': 544, 'n_words': 116}