Skip to content

Commit

Permalink
DTPOMERSER-1001 Address Fix issues non_optional_string_data_conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
grmeyer-hw-dev committed Jul 7, 2024
1 parent 64a22c1 commit 13bf629
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ jobs:

- name: Lint validation
run:
swiftlint lint --strict --reporter json
| swiftlint --version
| swiftlint lint --strict --reporter json

- name: Code Coverage [Build report]
run: |
Expand Down
2 changes: 1 addition & 1 deletion Tests/AnyCodableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AnyCodableTests: XCTestCase {

// Then
XCTAssertNotNil(jsonBody)
let jsonBodyString = String(data: jsonBody, as: UTF8.self)
let jsonBodyString = String(decoding: jsonBody, as: UTF8.self)
XCTAssertTrue(((jsonBodyString.contains("USD"))))
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/TransactionTypeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ class TransactionTypeTests: XCTestCase {
if httpMethod == .get {
XCTAssertNil(urlRequest.httpBody, "The HTTP body should be nil")
} else {
let httpBody = String(data: urlRequest.httpBody!, as: UTF8.self)
let httpBody = String(decoding: urlRequest.httpBody!, as: UTF8.self)
let payloadData = try JSONEncoder().encode(payload)
let payloadString = String(data: payloadData, as: UTF8.self)
let payloadString = String(decoding: payloadData, as: UTF8.self)
XCTAssertEqual(httpBody, payloadString, "The HTTP body should be equals to payload")
}

Expand Down Expand Up @@ -165,7 +165,7 @@ class TransactionTypeTests: XCTestCase {
if httpMethod == .get {
XCTAssertNil(urlRequest.httpBody, "The HTTP body should be nil")
} else {
let query = String(data: urlRequest.httpBody!, as: UTF8.self)
let query = String(decoding: urlRequest.httpBody!, as: UTF8.self)
let payloadString = payload.toGraphQl(userToken: configuration.userToken)
XCTAssertEqual(query, payloadString, "The HTTP body should be equals to payload")
}
Expand Down

0 comments on commit 13bf629

Please sign in to comment.