Skip to content

Commit fafde6e

Browse files
committed
[dont-use-arrow-deprecated-methods] Fixed the usage of deprecated methods
1 parent aa999ea commit fafde6e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/main/kotlin/in/rcard/assertj/arrowcore/AbstractOptionAssert.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ abstract class AbstractOptionAssert<
4343
*/
4444
fun isEmpty(): SELF {
4545
isNotNull
46-
if (actual.isDefined()) throwAssertionError(shouldBeEmpty(actual))
46+
if (actual.isSome()) throwAssertionError(shouldBeEmpty(actual))
4747
return myself
4848
}
4949

@@ -74,7 +74,7 @@ abstract class AbstractOptionAssert<
7474
*/
7575
fun containsInstanceOf(expectedClass: Class<*>): SELF {
7676
assertValueIsPresent()
77-
actual.tap { value ->
77+
actual.onSome { value ->
7878
if (!expectedClass.isInstance(value)) {
7979
throwAssertionError(
8080
shouldContainInstanceOf(
@@ -104,6 +104,6 @@ abstract class AbstractOptionAssert<
104104

105105
private fun assertValueIsPresent() {
106106
isNotNull
107-
if (actual.isEmpty()) throwAssertionError(shouldBePresent())
107+
if (actual.isNone()) throwAssertionError(shouldBePresent())
108108
}
109109
}

src/main/kotlin/in/rcard/assertj/arrowcore/errors/OptionShouldBeEmpty.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
1010
* @since 0.0.1
1111
*/
1212
internal class OptionShouldBeEmpty private constructor(expected: Option<*>) :
13-
BasicErrorMessageFactory("%nExpecting an Option to be empty but was <%s>.", expected.orNull()) {
13+
BasicErrorMessageFactory("%nExpecting an Option to be empty but was <%s>.", expected.getOrNull()) {
1414
companion object {
1515
internal fun shouldBeEmpty(actual: Option<*>): OptionShouldBeEmpty =
1616
OptionShouldBeEmpty(actual)

src/main/kotlin/in/rcard/assertj/arrowcore/errors/OptionShouldBePresent.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import org.assertj.core.error.BasicErrorMessageFactory
1010
* @since 0.0.1
1111
*/
1212
internal class OptionShouldBePresent private constructor() :
13-
BasicErrorMessageFactory("%nExpecting Option to contain a value but it didn't.".format()) {
13+
BasicErrorMessageFactory("%nExpecting Option to contain a value but it didn't.") {
1414
companion object {
1515

1616
/**

0 commit comments

Comments
 (0)