Skip to content

Commit

Permalink
Merge pull request #20 from niscy-eudiw/main
Browse files Browse the repository at this point in the history
Interactors Unit tests
  • Loading branch information
stzouvaras authored Nov 22, 2024
2 parents 5fc9cb0 + b6b53ab commit 652d197
Show file tree
Hide file tree
Showing 11 changed files with 1,181 additions and 15 deletions.
44 changes: 44 additions & 0 deletions .run/Run All Unit Tests.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
~ Copyright (c) 2023 European Commission
~
~ Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European
~ Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work
~ except in compliance with the Licence.
~
~ You may obtain a copy of the Licence at:
~ https://joinup.ec.europa.eu/software/page/eupl
~
~ Unless required by applicable law or agreed to in writing, software distributed under
~ the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF
~ ANY KIND, either express or implied. See the Licence for the specific language
~ governing permissions and limitations under the Licence.
-->

<component name="ProjectRunConfigurationManager">
<configuration name="Run All Unit Tests" default="false" factoryName="Gradle"
type="GradleRunConfiguration">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":rqes-ui-sdk:testDebugUnitTest" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<EXTENSION ID="com.intellij.execution.ExternalSystemRunConfigurationJavaExtension">
<extension name="coverage" track_test_folders="true" />
</EXTENSION>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>true</RunAsTest>
<method v="2" />
</configuration>
</component>
41 changes: 41 additions & 0 deletions .run/Run Kover report.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!--
~ Copyright (c) 2023 European Commission
~
~ Licensed under the EUPL, Version 1.2 or - as soon they will be approved by the European
~ Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work
~ except in compliance with the Licence.
~
~ You may obtain a copy of the Licence at:
~ https://joinup.ec.europa.eu/software/page/eupl
~
~ Unless required by applicable law or agreed to in writing, software distributed under
~ the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF
~ ANY KIND, either express or implied. See the Licence for the specific language
~ governing permissions and limitations under the Licence.
-->

<component name="ProjectRunConfigurationManager">
<configuration name="Run Kover report" default="false" factoryName="Gradle"
type="GradleRunConfiguration">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value=":rqes-ui-sdk:koverHtmlReportDebug" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
</component>
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.kotlin.kover) apply false
}
12 changes: 11 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
eudiRqesCore = "0.0.3-SNAPSHOT"
agp = "8.7.2"
kotlin = "2.0.21"
kotlinxCoroutines = "1.8.1"
coreKtx = "1.15.0"
junit = "4.13.2"
junitVersion = "1.2.1"
Expand All @@ -20,6 +21,10 @@ koinAnnotations = "1.4.0"
ksp = "2.0.21-1.0.26"
gson = "2.11.0"
mavenPublish = "0.27.0"
mockito = "5.12.0"
mockitoKotlin = "5.3.1"
kover = "0.7.5"
robolectric = "4.11.1"

[libraries]
eudi-lib-android-rqes-core = { module = "eu.europa.ec.eudi:eudi-lib-android-rqes-core", version.ref = "eudiRqesCore" }
Expand Down Expand Up @@ -48,6 +53,10 @@ koin-test = { group = "io.insert-koin", name = "koin-android-test", version.ref
koin-annotations = { group = "io.insert-koin", name = "koin-annotations", version.ref = "koinAnnotations" }
koin-ksp = { group = "io.insert-koin", name = "koin-ksp-compiler", version.ref = "koinAnnotations" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
mockito-core = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
mockito-kotlin = { group = "org.mockito.kotlin", name = "mockito-kotlin", version.ref = "mockitoKotlin" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinxCoroutines" }
robolectric = { group = "org.robolectric", name = "robolectric", version.ref = "robolectric" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Expand All @@ -56,4 +65,5 @@ kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "ko
android-library = { id = "com.android.library", version.ref = "agp" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
kotlin-parcelize = { id = "org.jetbrains.kotlin.plugin.parcelize", version.ref = "kotlin" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "mavenPublish" }
kotlin-kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
29 changes: 29 additions & 0 deletions rqes-ui-sdk/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ plugins {
alias(libs.plugins.ksp)
alias(libs.plugins.kotlin.parcelize)
alias(libs.plugins.maven.publish)
alias(libs.plugins.kotlin.kover)
}

val NAMESPACE: String by project
Expand Down Expand Up @@ -103,6 +104,10 @@ dependencies {
// Test Dependencies
testImplementation(libs.junit)
testImplementation(libs.koin.test)
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.kotlin)
testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.robolectric)
}

// Compile time check
Expand All @@ -125,4 +130,28 @@ mavenPublishing {
url = "${POM_SCM_URL}/actions"
}
}
}

koverReport {
filters {
excludes {
packages(
"*.ksp.*",
"*.di",
"*.router",
"*.serializer",
"*.config",
"*.config.*",
"*.infrastructure.*",
"*.infrastructure",
"*.ui.component.*",
"*.ui.component",
"*.ui.container",
"*.ui.container.*",
)
classes(
"*Screen*",
)
}
}
}
Loading

0 comments on commit 652d197

Please sign in to comment.