-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/main/kotlin/com/github/roroche/plantuml/classes/exceptions/InvalidPackageException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.github.roroche.plantuml.classes.exceptions | ||
|
||
class InvalidPackageException( | ||
packageName: String | ||
) : RuntimeException("Invalid package '$packageName', maybe missing or empty") |
31 changes: 31 additions & 0 deletions
31
src/test/kotlin/com/github/roroche/plantuml/assertions/ClsThrowsAssertion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.github.roroche.plantuml.assertions | ||
|
||
import com.github.roroche.plantuml.classes.Classes | ||
import com.pragmaticobjects.oo.tests.Assertion | ||
import org.assertj.core.api.Assertions.assertThatThrownBy | ||
|
||
/** | ||
* Assertion that checks that [Classes] throws exception. | ||
* | ||
* @property classes The [Classes] to check. | ||
* @property expectedClass The [Exception] [Class] expected to be thrown. | ||
* @property expectedMessage The expected [Exception] message. | ||
*/ | ||
class ClsThrowsAssertion( | ||
private val classes: Classes, | ||
private val expectedClass: Class<out Exception>, | ||
private val expectedMessage: String | ||
) : Assertion { | ||
/** | ||
* Check the assertion. | ||
*/ | ||
override fun check() { | ||
assertThatThrownBy { | ||
classes.list() | ||
}.isInstanceOf( | ||
expectedClass | ||
).hasMessageContaining( | ||
expectedMessage | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters