Skip to content

Commit b524a99

Browse files
committed
updated dependencies, fixed bugs and updated some tests
1 parent 546734c commit b524a99

9 files changed

Lines changed: 27 additions & 38 deletions

File tree

build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
}
55

66
group 'com.github.papsign'
7-
version '0.2-beta.18-SNAPSHOT'
7+
version '0.2-beta.19-SNAPSHOT'
88

99
repositories {
1010
mavenCentral()
@@ -34,6 +34,7 @@ dependencies {
3434

3535
implementation "org.reflections:reflections:0.9.11" // only used while initializing
3636

37+
testImplementation "org.jetbrains.kotlin:kotlin-test"
3738
testImplementation "io.ktor:ktor-server-netty:$ktor_version"
3839
testImplementation "io.ktor:ktor-server-test-host:$ktor_version"
3940
testImplementation "ch.qos.logback:logback-classic:$logback_version"
@@ -44,13 +45,13 @@ dependencies {
4445
}
4546

4647
compileKotlin {
47-
kotlinOptions.jvmTarget = "1.6"
48+
kotlinOptions.jvmTarget = "1.8"
4849
kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlin.ExperimentalStdlibApi"]
4950
}
5051
compileTestKotlin {
51-
kotlinOptions.jvmTarget = "1.6"
52+
kotlinOptions.jvmTarget = "1.8"
5253
}
5354

5455
wrapper {
55-
gradleVersion = '6.0.1'
56+
gradleVersion = '7.1.1'
5657
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
kotlin.code.style=official
2-
ktor_version=1.3.2
2+
ktor_version=1.6.1
33
logback_version=1.2.1
44
slf4j_version=1.7.30
5-
kotlin_version=1.3.70
5+
kotlin_version=1.5.21

gradle/wrapper/gradle-wrapper.jar

834 Bytes
Binary file not shown.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Mon Mar 02 14:17:20 CET 2020
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
31
distributionBase=GRADLE_USER_HOME
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
64
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

gradlew

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 7 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/kotlin/com/papsign/ktor/openapigen/parameters/parsers/builders/query/deepobject/CollectionDeepBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ abstract class CollectionDeepBuilder(type: KType) : DeepBuilder {
2323
val indices =
2424
names.entries.groupBy { (k, _) -> k.substring(key.length + 1, k.indexOf("]", key.length)).toInt() }
2525
indices.entries.fold(
26-
ArrayList<Any?>((0..(indices.keys.max() ?: 0)).map { null })
26+
ArrayList<Any?>((0..(indices.keys.maxOrNull() ?: 0)).map { null })
2727
) { acc, (idx, params) ->
2828
acc[idx] = builder.build("$key[$idx]", params.associate { (key, value) -> key to value })
2929
acc

src/main/kotlin/com/papsign/ktor/openapigen/route/path/auth/OpenAPIAuthenticatedRoute.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class OpenAPIAuthenticatedRoute<TAuth>(
2828
body: suspend OpenAPIPipelineAuthContext<TAuth, TResponse>.(TParams, TRequest) -> Unit
2929
) {
3030
child().apply {// child in case path is branch to prevent propagation of the mutable nature of the provider
31-
provider.registerModule(authProvider)
31+
provider.registerModule(authProvider as AuthProvider<*>)
3232
handle<TParams, TResponse, TRequest>(
3333
paramsType,
3434
responseType,
@@ -46,7 +46,7 @@ class OpenAPIAuthenticatedRoute<TAuth>(
4646
body: suspend OpenAPIPipelineAuthContext<TAuth, TResponse>.(TParams) -> Unit
4747
) {
4848
child().apply {// child in case path is branch to prevent propagation of the mutable nature of the provider
49-
provider.registerModule(authProvider)
49+
provider.registerModule(authProvider as AuthProvider<*>)
5050
handle<TParams, TResponse, Unit>(
5151
paramsType,
5252
responseType,

src/test/kotlin/com/papsign/ktor/openapigen/content/type/binary/BinaryContentTypeParserTest.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import com.papsign.ktor.openapigen.route.path.normal.post
55
import com.papsign.ktor.openapigen.route.response.respond
66
import com.papsign.ktor.openapigen.route.route
77
import installOpenAPI
8-
import io.ktor.http.ContentType
9-
import io.ktor.http.HttpHeaders
10-
import io.ktor.http.HttpMethod
8+
import io.ktor.http.*
119
import io.ktor.server.testing.contentType
1210
import io.ktor.server.testing.handleRequest
1311
import io.ktor.server.testing.setBody
@@ -68,7 +66,7 @@ class BinaryContentTypeParserTest {
6866
addHeader(HttpHeaders.Accept, contentType)
6967
setBody(bytes)
7068
}.apply {
71-
assertNull(response.status())
69+
assertEquals(HttpStatusCode.NotFound, response.status())
7270
}
7371

7472
println("Test: Bad Accept")
@@ -77,7 +75,7 @@ class BinaryContentTypeParserTest {
7775
addHeader(HttpHeaders.Accept, ContentType.Application.Json.toString())
7876
setBody(bytes)
7977
}.apply {
80-
assertNull(response.status())
78+
assertEquals(HttpStatusCode.NotFound, response.status())
8179
}
8280

8381
println("Test: Bad Content-Type")
@@ -86,8 +84,8 @@ class BinaryContentTypeParserTest {
8684
addHeader(HttpHeaders.Accept, contentType)
8785
setBody(bytes)
8886
}.apply {
89-
assertNull(response.status())
87+
assertEquals(HttpStatusCode.NotFound, response.status())
9088
}
9189
}
9290
}
93-
}
91+
}

0 commit comments

Comments
 (0)