Skip to content

Commit b524a99

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

File tree

9 files changed

+27
-38
lines changed

9 files changed

+27
-38
lines changed

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
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ case "`uname`" in
7272
Darwin* )
7373
darwin=true
7474
;;
75-
MINGW* )
75+
MSYS* | MINGW* )
7676
msys=true
7777
;;
7878
NONSTOP* )
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
129130
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath

gradlew.bat

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
3336
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
3740

3841
set JAVA_EXE=java.exe
3942
%JAVA_EXE% -version >NUL 2>&1
40-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4144

4245
echo.
4346
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
5154
set JAVA_HOME=%JAVA_HOME:"=%
5255
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5356

54-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5558

5659
echo.
5760
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
6164

6265
goto fail
6366

64-
:init
65-
@rem Get command-line arguments, handling Windows variants
66-
67-
if not "%OS%" == "Windows_NT" goto win9xME_args
68-
69-
:win9xME_args
70-
@rem Slurp the command line arguments.
71-
set CMD_LINE_ARGS=
72-
set _SKIP=2
73-
74-
:win9xME_args_slurp
75-
if "x%~1" == "x" goto execute
76-
77-
set CMD_LINE_ARGS=%*
78-
7967
:execute
8068
@rem Setup the command line
8169

8270
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8371

72+
8473
@rem Execute Gradle
85-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8675

8776
:end
8877
@rem End local scope for the variables with windows NT shell

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)