Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BSU-0020] - Generic Async/Await Network Layer #39

Open
wants to merge 52 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6575345
Add 'ApiManager' and a generic urlRequest method to return a 'URLRequ…
Jan 9, 2023
bc68732
fix test class compile errors
Jan 9, 2023
ca35d04
Fix 'Module was not compiled for testing' error
Jan 9, 2023
c46f3ca
Create 'BaseService' class conforms to 'BaseServiceProtocol' and impl…
Jan 10, 2023
0ea4afc
create AdessoServiceProtocol
Jan 11, 2023
862a189
add 'baseURL' static variable to the 'Configuration' class
Jan 11, 2023
e7b3be7
add 'AdessoServiceProtocol', 'BaseServiceProvider' and 'BaseEndpoint'
Jan 11, 2023
5a07dcb
make generic request method to take responseModel as an argument, so …
Jan 12, 2023
91af74b
add 'testable' keyword to 'BoilerPlateSwiftUITests' file previously d…
Jan 12, 2023
b3cd111
Make implicit dependency 'URLSession' explicit by defining a 'URLSess…
Jan 12, 2023
37fd488
Pass session parameter to all cascading request method invokes
Jan 12, 2023
47a4618
Guarantee that request method invokes URLSession 'data for request' o…
Jan 12, 2023
ef5f369
Remove unused build method in 'AdessoServiceProtocol'
Jan 12, 2023
7175b6f
Add example use case for AdessoServiceProtocol
Jan 12, 2023
7aace2a
Make session and decoder dependency of 'BaseService' constructor inje…
Jan 12, 2023
9425ec9
Add 'ExampleResponse' inside 'ResponseModels' group
Jan 13, 2023
fabd161
Add 'WebServiceProvider'
Jan 13, 2023
da49c99
Add 'ExampleRepository' and 'ExampleRemoteDataSource'
Jan 13, 2023
57e5aa1
Make the test code uses 'ExampleResponse' decodable type instead of S…
Jan 13, 2023
81ff01a
Fix SwiftLint dictionary colon error by removing the whitespace
Jan 13, 2023
7f254a0
Reorganize project files
Jan 16, 2023
7103775
Add 'authenticatedRequest' method, but 'prepareAuthenticatedRequest' …
Jan 16, 2023
5125821
Make the parameter requestObject inout so it can be modified inside t…
Jan 16, 2023
520228c
Request method throws an error when URLSession fails
Jan 18, 2023
c466507
Remove 'Result' return type from request methods, because async metho…
Jan 18, 2023
2d6fa51
Request command fails on non OK HTTPStatusCode
Jan 18, 2023
50241d1
Change expectation timeouts to 1 instead of 5 seconds
Jan 18, 2023
a0be858
Change the name of 'BaseService' to 'NetworkLoader'
Jan 18, 2023
390bf5f
Fix nonOKHTTPStatus code test succeeds on 200 status code
Jan 18, 2023
862a0f4
Change name of 'AdessoServiceProtocol' to 'BaseServiceProtocol'
Jan 18, 2023
187879e
Change SUT 'NetworkLoaderProtocol' instead of 'ExampleService' since …
Jan 18, 2023
ac893ad
Store arrays rather than optional values inside 'URLSessionSpy', so t…
Jan 19, 2023
c21bac8
Extract duplicated test code into 'expect' helper method to simplify …
Jan 19, 2023
66cd312
Fix all the swiftLint errors, clear 'NetworkLoaderTests', Make 'Adess…
Jan 19, 2023
2134fa8
Extract URLRequest creation responsibility to a helper method 'prepar…
Jan 19, 2023
5bc3d3b
Remove `AdessoError` equatable conformance and add it inside the test…
Jan 24, 2023
d15804b
Move `URLSessionSpy` creation inside the makeSUT helper factory metho…
Jan 25, 2023
00a9de5
Does not request upon creation
Jan 25, 2023
299574b
Rename failure test method names, to be more clear
Jan 25, 2023
3add40c
Make `ExampleResponse` a struct, since it doesn't have any behavior
Jan 25, 2023
1793619
Move `AdessoError` equatable conformance to the project target
Jan 25, 2023
e894e13
Delivers `HTTPError` depending on the http status code received from…
Jan 25, 2023
cdd1e32
Delivers error when the given url is invalid (AdessoError.badURL)
Jan 25, 2023
b9e7970
Delivers badURL error with the given url when the string is not conve…
Jan 26, 2023
700d6b5
Delivers notValidCode error when response couldn't be converted to HT…
Jan 26, 2023
d03e8e7
Add some extensions to Dictionary, Encodable, String, DecodingError, …
Jan 26, 2023
d79eb95
Delivers error on invalid data with successful response
Jan 30, 2023
66385a0
`Request` command succeeds on correct data, parse the json and return…
Jan 30, 2023
d04fd5e
Use test class's own `TestResponse` instead of `ExampleResponse` to p…
Jan 31, 2023
e3f1bef
Merge branch 'develop' into BSU-0020, conflicts resolved
Feb 2, 2023
3f59829
Merge branch 'develop' into BSU-0020
egesucu Feb 16, 2023
90dbc1b
Merge branch 'develop' into BSU-0020
egesucu Feb 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move AdessoError equatable conformance to the project target
[email protected] authored and [email protected] committed Jan 25, 2023
commit 17936198b57a9bc15acc872e91f2f5fdf487d5f2
2 changes: 1 addition & 1 deletion BoilerPlateSwiftUI/Network/Entities/AdessoError.swift
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

import Foundation

enum AdessoError: Error {
enum AdessoError: Error, Equatable {
case httpError(status: HTTPStatus, data: Data? = nil)
case unknown(error: NSError)
case customError(_ code: Int, _ message: String, _ data: Data? = nil)
Original file line number Diff line number Diff line change
@@ -113,9 +113,3 @@ final class NetworkLoaderTests: XCTestCase {
}
}
}

extension AdessoError: Equatable {
public static func == (lhs: AdessoError, rhs: AdessoError) -> Bool {
return lhs.errorCode == rhs.errorCode && lhs.localizedDescription == rhs.localizedDescription
}
}