Skip to content

Commit 628d284

Browse files
committed
wip
1 parent 98840f8 commit 628d284

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

test/generators/rust/presets/__snapshots__/CommonPreset.spec.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub enum OptionalMembers {
3434

3535
exports[`RUST_COMMON_PRESET Enum should render \`enum\` of union type with Default implementation of integer type 3`] = `
3636
"// Address represents a Address model.
37-
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
37+
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
3838
pub struct Address {
3939
#[serde(rename=\\"members\\")]
4040
pub members: Box<crate::Members>,
@@ -90,7 +90,7 @@ pub enum OptionalMembers {
9090

9191
exports[`RUST_COMMON_PRESET Enum should render \`enum\` of union type with Default implementation of string type 3`] = `
9292
"// Address represents a Address model.
93-
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
93+
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
9494
pub struct Address {
9595
#[serde(rename=\\"members\\")]
9696
pub members: Box<crate::Members>,

test/runtime/runtime-kotlin/build.gradle

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,23 @@ repositories {
66
mavenCentral()
77
}
88

9+
java {
10+
toolchain {
11+
languageVersion.set(JavaLanguageVersion.of(11))
12+
}
13+
}
14+
915
dependencies {
16+
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
17+
18+
// Jackson for JSON serialization
19+
implementation("com.fasterxml.jackson.core:jackson-databind:2.15.2")
20+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.2")
21+
22+
// Test dependencies
1023
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
1124
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.1")
12-
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
25+
testImplementation("org.hamcrest:hamcrest:2.2")
1326
}
1427

1528
tasks.named('test') {

test/runtime/runtime-kotlin/src/test/kotlin/com/mycompany/app/generic/AddressTest.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package com.mycompany.app.generic
22

33
import com.fasterxml.jackson.databind.ObjectMapper
44
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
5+
import org.hamcrest.MatcherAssert.assertThat
56
import org.hamcrest.CoreMatchers.containsString
67
import org.hamcrest.CoreMatchers.not
78
import org.junit.jupiter.api.Assertions.assertTrue
89
import org.junit.jupiter.api.Test
9-
import org.junit.jupiter.api.BeforeEach
1010
import org.junit.jupiter.api.BeforeAll
1111
import org.junit.jupiter.api.TestInstance
1212

@@ -16,13 +16,14 @@ class AddressTest {
1616

1717
@BeforeAll
1818
fun setup() {
19+
val nestedObj = NestedObject(test = "test")
1920
address = Address(
2021
streetName = "Test address 2",
21-
houseNumber = 2,
22+
houseNumber = 2.0,
2223
marriage = true,
2324
members = 2,
2425
arrayType = listOf(2, "test"),
25-
nestedObject = Address.NestedObject(test = "test")
26+
nestedObject = nestedObj
2627
)
2728
}
2829

test/runtime/runtime-rust/Cargo.toml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,4 @@ serde_json = { version="1", optional = true }
1616

1717
[features]
1818
default = ["json"]
19-
json = ["dep:serde_json"]
20-
21-
[lib]
22-
path = "src/lib.rs"
23-
24-
[[bin]]
25-
name = "asyncapi-rs-example"
26-
path = "src/lib.rs"
27-
28-
[[test]]
29-
name = "asyncapi-rs-test"
30-
path = "test/addressTest.rs"
19+
json = ["dep:serde_json"]

0 commit comments

Comments
 (0)