Skip to content

Commit

Permalink
Bump kotlinVersion to 1.4.0
Browse files Browse the repository at this point in the history
Signed-off-by: a.derendyaev <alexxxdev@yandex.ru>
  • Loading branch information
alexxxdev committed Sep 24, 2020
1 parent b64b44d commit 2390115
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 331 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
[![BCH compliance](https://bettercodehub.com/edge/badge/alexxxdev/fuel-comfy?branch=master)](https://bettercodehub.com/)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=alexxxdev_fuel-comfy&metric=alert_status)](https://sonarcloud.io/dashboard?id=alexxxdev_fuel-comfy)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=alexxxdev_fuel-comfy&metric=coverage)](https://sonarcloud.io/dashboard?id=alexxxdev_fuel-comfy)
[![Kotlin](https://img.shields.io/badge/Kotlin-1.4.0-blue.svg)](https://kotlinlang.org)
[![Fuel](https://img.shields.io/badge/Fuel-2.2.3-blue.svg)](https://github.com/kittinunf/fuel)
[![Kotlin](https://img.shields.io/badge/Kotlin-1.4.10-blue.svg)](https://kotlinlang.org)
[![Fuel](https://img.shields.io/badge/Fuel-2.3.0-blue.svg)](https://github.com/kittinunf/fuel)

More comfortable use of [Fuel](https://github.com/kittinunf/fuel) as in [Retrofit](https://square.github.io/retrofit/) or [Feign](https://github.com/OpenFeign/feign) for Kotlin/Android

Expand Down
2 changes: 1 addition & 1 deletion api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies {
implementation ("com.squareup:kotlinpoet:$kotlinpoetVersion"){
exclude group: 'org.jetbrains.kotlin'
}
implementation "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinxSerializationVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion"
}

group = 'com.github.alexxxdev.fuelcomfy'
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlinVersion = '1.4.0'
ext.kotlinxSerializationVersion = '1.0.0-RC'
ext.detektGradlePluginVersion = '1.11.2'
ext.kotlinVersion = '1.4.10'
ext.kotlinxSerializationVersion = '1.0.0-RC2'
ext.detektGradlePluginVersion = '1.12.0'
ext.gradleVersionsPlugin = '0.27.0'
ext.kotlinpoetVersion = '1.6.0'
ext.fuelVersion = '2.2.3'
ext.fuelVersion = '2.3.0'
ext.spekVersion = '2.0.12'
ext.okio = '2.8.0'
ext.mockwebserver = '4.9.0'
Expand Down Expand Up @@ -53,7 +53,7 @@ allprojects {
resolutionStrategy {
force "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
force "org.jetbrains.kotlin:kotlinx-serialization-core:$kotlinxSerializationVersion"
force "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion"
//force "org.jetbrains.kotlin:kotlin-coroutines-core:1.3.9"
}
}
Expand Down
10 changes: 5 additions & 5 deletions detekt/reports/detekt.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,15 @@ <h2>Complexity Report</h2>

<div>
<ul>
<li>2,550 lines of code (loc)</li>
<li>2,143 source lines of code (sloc)</li>
<li>1,381 logical lines of code (lloc)</li>
<li>2,563 lines of code (loc)</li>
<li>2,156 source lines of code (sloc)</li>
<li>1,382 logical lines of code (lloc)</li>
<li>68 comment lines of code (cloc)</li>
<li>279 cyclomatic complexity (mcc)</li>
<li>97 cognitive complexity</li>
<li>9 number of total code smells</li>
<li>3% comment source ratio</li>
<li>202 mcc per 1,000 lloc</li>
<li>201 mcc per 1,000 lloc</li>
<li>6 code smells per 1,000 lloc</li>
</ul>
</div>
Expand Down Expand Up @@ -221,7 +221,7 @@ <h3>performance: 2</h3>
</div>


generated with <a href="https://arturbosch.github.io/detekt">detekt version 1.10.0</a> on 2020-08-18 04:05:39 UTC.
generated with <a href="https://arturbosch.github.io/detekt">detekt version 1.12.0</a> on 2020-09-24 03:43:21 UTC.

</body>
</html>
1 change: 1 addition & 0 deletions processor-gson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies {
compileOnly project(':api')

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion"
implementation "com.github.kittinunf.fuel:fuel-gson:$fuelVersion"
implementation ("com.squareup:kotlinpoet:$kotlinpoetVersion"){
exclude group: 'org.jetbrains.kotlin'
Expand Down
4 changes: 2 additions & 2 deletions processor/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinxSerializationVersion"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion"
implementation ("com.github.kittinunf.fuel:fuel:$fuelVersion"){
exclude group: 'org.jetbrains.kotlin'
}
Expand Down Expand Up @@ -44,7 +44,7 @@ dependencies {
testImplementation ("com.github.kittinunf.fuel:fuel-coroutines:$fuelVersion"){
exclude group: 'org.jetbrains.kotlin'
}
testImplementation ("org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinxSerializationVersion"){
testImplementation ("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion"){
exclude group: 'org.jetbrains.kotlin'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import kotlin.test.assertTrue

object GsonSerializationTest : BaseTest({
var kclass: GsonSerializationService?
object GsonSerializationTest : BaseTest(
{
var kclass: GsonSerializationService?

group("Prepare class with suspend functions") {
val resultGenerate = generateClass()
val resultCompile = compileClass()
kclass = LoadClass<GsonSerializationService>()
test("Generate success") { assertEquals(ExitCode.OK, resultGenerate.exitCode) }
test("Compile success") { assertTrue(resultCompile) }
test("Load success") { assertNotNull(kclass) }
group("Prepare class with suspend functions") {
val resultGenerate = generateClass()
val resultCompile = compileClass()
kclass = LoadClass<GsonSerializationService>()
test("Generate success") { assertEquals(ExitCode.OK, resultGenerate.exitCode) }
test("Compile success") { assertTrue(resultCompile) }
test("Load success") { assertNotNull(kclass) }
}
}
})
)
146 changes: 74 additions & 72 deletions processor/src/test/kotlin/com/github/alexxxdev/fuelcomfy/HeaderTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,84 +12,86 @@ import kotlin.test.assertEquals
import kotlin.test.assertNotNull
import kotlin.test.assertTrue

object HeaderTest : BaseTest({
val port = 10101
var kclass: GitHubService? = null
FuelManager.instance.basePath = "http://localhost:$port/"
object HeaderTest : BaseTest(
{
val port = 10101
var kclass: GitHubService? = null
FuelManager.instance.basePath = "http://localhost:$port/"

group("Prepare class") {
val resultGenerate = generateClass()
val resultCompile = compileClass()
kclass = LoadClass<GitHubService>()
test("Generate success") { assertEquals(ExitCode.OK, resultGenerate.exitCode) }
test("Compile success") { assertTrue(resultCompile) }
test("Load success") { assertNotNull(kclass) }
}
group("GET Request with params headers") {
var request: RecordedRequest? = null
val server = MockWebServer()
group("Prepare class") {
val resultGenerate = generateClass()
val resultCompile = compileClass()
kclass = LoadClass<GitHubService>()
test("Generate success") { assertEquals(ExitCode.OK, resultGenerate.exitCode) }
test("Compile success") { assertTrue(resultCompile) }
test("Load success") { assertNotNull(kclass) }
}
group("GET Request with params headers") {
var request: RecordedRequest? = null
val server = MockWebServer()

beforeGroup {
server.enqueue(MockResponse().setResponseCode(200))
server.start(port)
beforeGroup {
server.enqueue(MockResponse().setResponseCode(200))
server.start(port)

kclass?.getFunWithParamsHeaders("json", "gzip")
request = server.takeRequest()
}
test("method = GET") {
assertEquals(Method.GET.value, request?.method)
}
test("path = /get") {
assertEquals("/get", request?.path)
}
test("base header Accept: application/json") {
assertEquals("application/json", request?.getHeader("Accept"))
}
test("base header Cache-Control: no-cache") {
assertEquals("no-cache", request?.getHeader("Cache-Control"))
}
test("fun header Content-Type: application/json") {
assertEquals("application/json", request?.getHeader("Content-Type"))
}
test("fun header Accept-Encoding: gzip") {
assertEquals("gzip", request?.getHeader("Accept-Encoding"))
}
afterGroup {
server.shutdown()
kclass?.getFunWithParamsHeaders("json", "gzip")
request = server.takeRequest()
}
test("method = GET") {
assertEquals(Method.GET.value, request?.method)
}
test("path = /get") {
assertEquals("/get", request?.path)
}
test("base header Accept: application/json") {
assertEquals("application/json", request?.getHeader("Accept"))
}
test("base header Cache-Control: no-cache") {
assertEquals("no-cache", request?.getHeader("Cache-Control"))
}
test("fun header Content-Type: application/json") {
assertEquals("application/json", request?.getHeader("Content-Type"))
}
test("fun header Accept-Encoding: gzip") {
assertEquals("gzip", request?.getHeader("Accept-Encoding"))
}
afterGroup {
server.shutdown()
}
}
}

group("POST Request with headers") {
var request: RecordedRequest? = null
val server = MockWebServer()
group("POST Request with headers") {
var request: RecordedRequest? = null
val server = MockWebServer()

beforeGroup {
server.enqueue(MockResponse().setResponseCode(200))
server.start(port)
beforeGroup {
server.enqueue(MockResponse().setResponseCode(200))
server.start(port)

kclass?.postFunWithHeaders()
request = server.takeRequest()
}
test("method = POST") {
assertEquals(Method.POST.value, request?.method)
}
test("path = /post") {
assertEquals("/post", request?.path)
}
test("base header Accept: application/json") {
assertEquals("application/json", request?.getHeader("Accept"))
}
test("base header Cache-Control: no-cache") {
assertEquals("no-cache", request?.getHeader("Cache-Control"))
}
test("fun header Content-Type: application/json") {
assertEquals("application/json", request?.getHeader("Content-Type"))
}
test("fun header Accept-Encoding: gzip") {
assertEquals("gzip", request?.getHeader("Accept-Encoding"))
}
afterGroup {
server.shutdown()
kclass?.postFunWithHeaders()
request = server.takeRequest()
}
test("method = POST") {
assertEquals(Method.POST.value, request?.method)
}
test("path = /post") {
assertEquals("/post", request?.path)
}
test("base header Accept: application/json") {
assertEquals("application/json", request?.getHeader("Accept"))
}
test("base header Cache-Control: no-cache") {
assertEquals("no-cache", request?.getHeader("Cache-Control"))
}
test("fun header Content-Type: application/json") {
assertEquals("application/json", request?.getHeader("Content-Type"))
}
test("fun header Accept-Encoding: gzip") {
assertEquals("gzip", request?.getHeader("Accept-Encoding"))
}
afterGroup {
server.shutdown()
}
}
}
})
)
Loading

0 comments on commit 2390115

Please sign in to comment.