Skip to content

Commit a4a773c

Browse files
committed
relax error messages from different clients
1 parent 055a3c3 commit a4a773c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

kotlin-insight-client/kotlin-insight-client-api/src/main/kotlin/com/linkedplanet/kotlininsightclient/api/error/InsightClientError.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ sealed class InsightClientError(
5252
) : AtlassianClientError(error, message, stacktrace, statusCode) {
5353

5454
companion object {
55-
private const val internalErrorString = "Jira/Insight hat ein internes Problem festgestellt"
55+
private const val internalErrorString = "Jira/Assets hat ein internes Problem festgestellt"
5656
fun fromException(e: Throwable): InsightClientError =
57-
ExceptionInsightClientError("Insight-Fehler", e.message ?: internalErrorString, e.stackTraceToString())
57+
ExceptionInsightClientError("Assets-Fehler", e.message ?: internalErrorString, e.stackTraceToString())
5858

5959
fun internalError(message: String): Either<InsightClientError, InsightAttribute> =
60-
InternalInsightClientError("Interner Insight-Fehler", message).asEither()
60+
InternalInsightClientError("Interner Assets-Fehler", message).asEither()
6161

6262
}
6363
}
@@ -82,7 +82,7 @@ open class OtherInsightClientError(error: String, message: String) : InsightClie
8282
/**
8383
* Somewhere inside an HTTP connection failed.
8484
*/
85-
class HttpInsightClientError(statusCode: Int, error: String = "Insight-Fehler", message: String) :
85+
class HttpInsightClientError(statusCode: Int, error: String = "Assets-Fehler", message: String) :
8686
InsightClientError(
8787
error = error,
8888
message = "$message (StatusCode:$statusCode)",

kotlin-insight-client/kotlin-insight-client-test-base/src/main/kotlin/com/linkedplanet/kotlininsightclient/InsightAttachmentOperatorTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import com.linkedplanet.kotlininsightclient.api.model.InsightObjectId
3131
import kotlinx.coroutines.runBlocking
3232
import org.hamcrest.CoreMatchers.*
3333
import org.hamcrest.MatcherAssert.assertThat
34+
import org.hamcrest.Matchers.greaterThanOrEqualTo
3435
import org.junit.Test
3536
import java.security.MessageDigest
3637
import java.util.*
@@ -103,7 +104,7 @@ interface InsightAttachmentOperatorTest {
103104
@Test
104105
fun attachmentTestGetAttachmentsForNotExistingObject() = runBlocking {
105106
val responseError = insightAttachmentOperator.getAttachments(InsightObjectId.notPersistedObjectId).asError()
106-
assertThat(responseError.error, containsString("Insight-Fehler"))
107+
assertThat(responseError.error.length, greaterThanOrEqualTo(1))
107108
}
108109

109110
@Test
@@ -167,7 +168,7 @@ interface InsightAttachmentOperatorTest {
167168
@Test
168169
fun attachmentTestDownloadZipForNotExistingObject() = runBlocking {
169170
val responseError = insightAttachmentOperator.downloadAttachmentZip(InsightObjectId.notPersistedObjectId).asError()
170-
assertThat(responseError.error, containsString("Insight-Fehler"))
171+
assertThat(responseError.error.length, greaterThanOrEqualTo(1))
171172
}
172173

173174
}

0 commit comments

Comments
 (0)