Class def not found error

This commit is contained in:
Julien Lengrand-Lambert
2025-04-30 10:30:08 +02:00
parent a744fd1e0e
commit 158ea47f51
5 changed files with 49 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.composeCompiler)
alias(libs.plugins.serialization)
}
kotlin {
@@ -34,6 +35,10 @@ kotlin {
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.8.0")
implementation(libs.kbsky.core)
}
desktopMain.dependencies {

View File

@@ -2,6 +2,8 @@ package nl.lengrand
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import work.socialhub.kbsky.ATProtocolException
class GreetingTest {
@Test
@@ -10,4 +12,9 @@ class GreetingTest {
assertEquals("Hello, you!", Greeting().greet())
}
@Test
fun connect(){
assertThrows<ATProtocolException> { Greeting().connect() }
}
}

View File

@@ -1,9 +1,30 @@
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 {
private val platform = getPlatform()
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)}
}

View File

@@ -2,6 +2,8 @@ package nl.lengrand
import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertThrows
import work.socialhub.kbsky.ATProtocolException
class GreetingTest {
@Test
@@ -10,4 +12,10 @@ class GreetingTest {
assertEquals("Hello, you!", Greeting().greet())
}
@Test
fun connect(){
assertThrows<ATProtocolException> { Greeting().connect() }
}
}