mirror of
https://github.com/jlengrand/ExtraTestModuleExample.git
synced 2026-03-10 08:21:18 +00:00
Class def not found error
This commit is contained in:
@@ -4,6 +4,7 @@ plugins {
|
|||||||
alias(libs.plugins.kotlinMultiplatform)
|
alias(libs.plugins.kotlinMultiplatform)
|
||||||
alias(libs.plugins.composeMultiplatform)
|
alias(libs.plugins.composeMultiplatform)
|
||||||
alias(libs.plugins.composeCompiler)
|
alias(libs.plugins.composeCompiler)
|
||||||
|
alias(libs.plugins.serialization)
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlin {
|
kotlin {
|
||||||
@@ -34,6 +35,10 @@ kotlin {
|
|||||||
implementation(compose.components.uiToolingPreview)
|
implementation(compose.components.uiToolingPreview)
|
||||||
implementation(libs.androidx.lifecycle.viewmodel)
|
implementation(libs.androidx.lifecycle.viewmodel)
|
||||||
implementation(libs.androidx.lifecycle.runtime.compose)
|
implementation(libs.androidx.lifecycle.runtime.compose)
|
||||||
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0")
|
||||||
|
implementation(libs.kbsky.core)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
desktopMain.dependencies {
|
desktopMain.dependencies {
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ package nl.lengrand
|
|||||||
|
|
||||||
import org.junit.jupiter.api.Assertions.*
|
import org.junit.jupiter.api.Assertions.*
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
import org.junit.jupiter.api.assertThrows
|
||||||
|
import work.socialhub.kbsky.ATProtocolException
|
||||||
|
|
||||||
class GreetingTest {
|
class GreetingTest {
|
||||||
@Test
|
@Test
|
||||||
@@ -10,4 +12,9 @@ class GreetingTest {
|
|||||||
assertEquals("Hello, you!", Greeting().greet())
|
assertEquals("Hello, you!", Greeting().greet())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun connect(){
|
||||||
|
assertThrows<ATProtocolException> { Greeting().connect() }
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,30 @@
|
|||||||
package nl.lengrand
|
package nl.lengrand
|
||||||
|
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
import work.socialhub.kbsky.BlueskyFactory
|
||||||
|
import work.socialhub.kbsky.api.entity.com.atproto.server.ServerCreateSessionRequest
|
||||||
|
import work.socialhub.kbsky.domain.Service
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class User (val name: String)
|
||||||
|
|
||||||
class Greeting {
|
class Greeting {
|
||||||
private val platform = getPlatform()
|
private val platform = getPlatform()
|
||||||
|
|
||||||
fun greet(): String {
|
fun greet(): String {
|
||||||
return "Hello, you!"
|
return "Hello, ${User("you").name}!"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun connect(){
|
||||||
|
val response = BlueskyFactory
|
||||||
|
.instance(Service.BSKY_SOCIAL.uri)
|
||||||
|
.server()
|
||||||
|
.createSession(
|
||||||
|
ServerCreateSessionRequest().also {
|
||||||
|
it.identifier = "test"
|
||||||
|
it.password = "tests"
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
println(response.data.accessJwt)}
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,8 @@ package nl.lengrand
|
|||||||
|
|
||||||
import org.junit.jupiter.api.Assertions.*
|
import org.junit.jupiter.api.Assertions.*
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
import org.junit.jupiter.api.assertThrows
|
||||||
|
import work.socialhub.kbsky.ATProtocolException
|
||||||
|
|
||||||
class GreetingTest {
|
class GreetingTest {
|
||||||
@Test
|
@Test
|
||||||
@@ -10,4 +12,10 @@ class GreetingTest {
|
|||||||
assertEquals("Hello, you!", Greeting().greet())
|
assertEquals("Hello, you!", Greeting().greet())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun connect(){
|
||||||
|
assertThrows<ATProtocolException> { Greeting().connect() }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -3,9 +3,10 @@ androidx-lifecycle = "2.8.4"
|
|||||||
compose-multiplatform = "1.7.3"
|
compose-multiplatform = "1.7.3"
|
||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
junit5 = "5.8.1"
|
junit5 = "5.8.1"
|
||||||
|
|
||||||
kotlin = "2.1.20"
|
kotlin = "2.1.20"
|
||||||
kotlinx-coroutines = "1.10.2"
|
kotlinx-coroutines = "1.10.2"
|
||||||
|
serialization = "1.8.0"
|
||||||
|
kbsky = "0.3.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
||||||
@@ -15,8 +16,12 @@ junit5 = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.r
|
|||||||
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
|
androidx-lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel", version.ref = "androidx-lifecycle" }
|
||||||
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
|
androidx-lifecycle-runtime-compose = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
|
||||||
kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
|
kotlinx-coroutines-swing = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-swing", version.ref = "kotlinx-coroutines" }
|
||||||
|
serialization = {group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization"}
|
||||||
|
kbsky-core = { module = "work.socialhub.kbsky:core", version.ref = "kbsky" }
|
||||||
|
|
||||||
|
|
||||||
[plugins]
|
[plugins]
|
||||||
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
|
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose-multiplatform" }
|
||||||
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
composeCompiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||||||
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||||
|
serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||||
Reference in New Issue
Block a user