Skip to content

Commit

Permalink
Merge pull request #1601 from LemonAppDev/release/v0.17.1
Browse files Browse the repository at this point in the history
Release v0.17.1
  • Loading branch information
igorwojda authored Dec 2, 2024
2 parents 1e8e0ee + 41a1ae8 commit 8cdaa81
Show file tree
Hide file tree
Showing 58 changed files with 2,732 additions and 460 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ tests ([JUnit](https://junit.org/) / [Kotest](https://kotest.io/)).

Gradle Kotlin:
```kotlin
testImplementation("com.lemonappdev:konsist:0.17.0")
testImplementation("com.lemonappdev:konsist:0.17.1")
```

Gradle Groovy:
```groovy
testImplementation "com.lemonappdev:konsist:0.17.0"
testImplementation "com.lemonappdev:konsist:0.17.1"
```

Maven:
```xml
<dependency>
<groupId>com.lemonappdev</groupId>
<artifactId>konsist</artifactId>
<version>0.17.0</version>
<version>0.17.1</version>
<scope>test</scope>
</dependency>
```
Expand Down
3 changes: 2 additions & 1 deletion detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ complexity:
LargeClass:
active: true
threshold: 800
excludes: [ '**/test/**', '**/**Test/**' ]
LongMethod:
active: true
threshold: 60
Expand Down Expand Up @@ -162,7 +163,7 @@ complexity:
ignoreStringsRegex: '$^'
TooManyFunctions:
active: true
excludes: [ '**/test/**', '**/**Test/**', '**/konsist/api/ext/sequence/**' ]
excludes: [ '**/test/**', '**/**Test/**' ]
thresholdInFiles: 25
thresholdInClasses: 25
thresholdInInterfaces: 25
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ org.gradle.jvmargs=-Xms512M -Xmx4g -Dkotlin.daemon.jvm.options="-Xmx1g"
org.gradle.parallel=true
org.gradle.daemon=true

konsist.version=0.17.0
konsist.version=0.17.1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.lemonappdev.konsist.core.exception.KoAssertionFailedException
import com.lemonappdev.konsist.core.filesystem.PathProvider
import io.kotest.assertions.throwables.shouldThrow
import org.amshove.kluent.shouldBeEqualTo
import org.amshove.kluent.shouldNotThrow
import org.junit.jupiter.api.Test

class Architecture2Test {
Expand Down Expand Up @@ -84,95 +85,68 @@ class Architecture2Test {

// fails when dependency is set that domain layer depend on presentation domain layer
@Test
fun `fails when dependency is set that domain layer depend on presentation domain layer (lambda scope)`() {
fun `passes when dependency is set that domain layer depend on presentation domain layer (lambda scope)`() {
// when
val result =
shouldThrow<KoAssertionFailedException> {
scope
.assertArchitecture {
domain.dependsOn(presentation)
}
}
val func = {
scope
.assertArchitecture {
domain.dependsOn(presentation)
}
}

// then
result
.message
.shouldBeEqualTo(
"'fails when dependency is set that domain layer depend on presentation domain layer (lambda scope)' " +
"test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.",
)
func shouldNotThrow KoAssertionFailedException::class
}

@Test
fun `fails when dependency is set that domain layer depend on presentation domain layer (lambda files)`() {
fun `passes when dependency is set that domain layer depend on presentation domain layer (lambda files)`() {
// when
val result =
shouldThrow<KoAssertionFailedException> {
scope
.files
.assertArchitecture {
domain.dependsOn(presentation)
}
}
val func = {
scope
.files
.assertArchitecture {
domain.dependsOn(presentation)
}
}

// then
result
.message
.shouldBeEqualTo(
"'fails when dependency is set that domain layer depend on presentation domain layer (lambda files)' " +
"test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.",
)
func shouldNotThrow KoAssertionFailedException::class
}

@Test
fun `fails when dependency is set to domain layer depends on presentation layer (parameter scope)`() {
fun `passes when dependency is set to domain layer depends on presentation layer (parameter scope)`() {
// given
val layerDependencies =
architecture {
domain.dependsOn(presentation)
}

// when
val result =
shouldThrow<KoAssertionFailedException> {
scope.assertArchitecture(layerDependencies)
}
val func = {
scope.assertArchitecture(layerDependencies)
}

// then
result
.message
.shouldBeEqualTo(
"'fails when dependency is set to domain layer depends on presentation layer (parameter scope)' " +
"test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.",
)
func shouldNotThrow KoAssertionFailedException::class
}

@Test
fun `fails when dependency is set to domain layer depends on presentation layer (parameter files)`() {
fun `passes when dependency is set to domain layer depends on presentation layer (parameter files)`() {
// given
val layerDependencies =
architecture {
domain.dependsOn(presentation)
}

// when
val result =
shouldThrow<KoAssertionFailedException> {
scope
.files
.assertArchitecture(layerDependencies)
}
val func = {
scope
.files
.assertArchitecture(layerDependencies)
}

// then
result
.message
.shouldBeEqualTo(
"'fails when dependency is set to domain layer depends on presentation layer (parameter files)' test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.",
)
func shouldNotThrow KoAssertionFailedException::class
}

// endregion
Expand Down Expand Up @@ -247,7 +221,6 @@ class Architecture2Test {
.message
.shouldBeEqualTo(
"'fails when dependency is set that domain layer is depend on presentation layer (parameter scope)' test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.\n" +
"'Presentation' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture2." +
Expand Down Expand Up @@ -278,7 +251,6 @@ class Architecture2Test {
.shouldBeEqualTo(
"'fails when dependency is set that domain layer is depend on presentation layer (parameter files)' " +
"test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.\n" +
"'Presentation' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture2." +
Expand Down Expand Up @@ -312,7 +284,6 @@ class Architecture2Test {
.shouldBeEqualTo(
"'fails when dependency is set that domain layer is depend on presentation layer (lambda scope)' " +
"test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.\n" +
"'Presentation' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture2." +
Expand Down Expand Up @@ -348,7 +319,6 @@ class Architecture2Test {
.shouldBeEqualTo(
"'fails when dependency is set that domain layer is depend on presentation layer (lambda files)' " +
"test has failed. \n" +
"Layer 'Domain' does not depends on 'Presentation' layer.\n" +
"'Presentation' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture2.project." +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ class Architecture4Test {
.message
.shouldBeEqualTo(
"'fails when (lambda scope)' test has failed. \n" +
"Layer 'Presentation' does not depends on 'Data' layer.\n" +
"Layer 'Domain' does not depends on 'Data' layer.\n" +
"'Data' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture4." +
Expand Down Expand Up @@ -191,8 +189,6 @@ class Architecture4Test {
.message
.shouldBeEqualTo(
"'fails when (lambda files)' test has failed. \n" +
"Layer 'Presentation' does not depends on 'Data' layer.\n" +
"Layer 'Domain' does not depends on 'Data' layer.\n" +
"'Data' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture4." +
Expand Down Expand Up @@ -225,8 +221,6 @@ class Architecture4Test {
.message
.shouldBeEqualTo(
"'fails when (parameter scope)' test has failed. \n" +
"Layer 'Presentation' does not depends on 'Data' layer.\n" +
"Layer 'Domain' does not depends on 'Data' layer.\n" +
"'Data' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture4." +
Expand Down Expand Up @@ -261,8 +255,6 @@ class Architecture4Test {
.message
.shouldBeEqualTo(
"'fails when (parameter files)' test has failed. \n" +
"Layer 'Presentation' does not depends on 'Data' layer.\n" +
"Layer 'Domain' does not depends on 'Data' layer.\n" +
"'Data' layer should not depend on anything but has dependencies in files:\n" +
"└── File $filepath\n" +
" └── Import com.lemonappdev.konsist.architecture.assertarchitecture.architecture4." +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.lemonappdev.konsist.api.architecture.KoArchitectureCreator.architectu
import com.lemonappdev.konsist.api.architecture.KoArchitectureCreator.assertArchitecture
import com.lemonappdev.konsist.api.architecture.Layer
import com.lemonappdev.konsist.core.exception.KoAssertionFailedException
import org.amshove.kluent.shouldNotThrow
import org.amshove.kluent.shouldThrow
import org.junit.jupiter.api.Test

Expand Down Expand Up @@ -161,7 +162,7 @@ class Architecture5Test {
}

// then
sut shouldThrow KoAssertionFailedException::class
sut shouldNotThrow KoAssertionFailedException::class
}

@Test
Expand All @@ -179,7 +180,7 @@ class Architecture5Test {
}

// then
sut shouldThrow KoAssertionFailedException::class
sut shouldNotThrow KoAssertionFailedException::class
}

@Test
Expand All @@ -198,7 +199,7 @@ class Architecture5Test {
}

// then
sut shouldThrow KoAssertionFailedException::class
sut shouldNotThrow KoAssertionFailedException::class
}

@Test
Expand All @@ -219,7 +220,7 @@ class Architecture5Test {
}

// then
sut shouldThrow KoAssertionFailedException::class
sut shouldNotThrow KoAssertionFailedException::class
}

// endregion
Expand Down
Loading

0 comments on commit 8cdaa81

Please sign in to comment.