-
Notifications
You must be signed in to change notification settings - Fork 1
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
Rewrite in Kotlin + Dropping Apache HTTP Client #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a list of refinements that need to be made before merging.
Happy Coding,
Wellington
pom.xml
Outdated
</parent> | ||
|
||
<artifactId>alchemy-http</artifactId> | ||
<version>2.1-SNAPSHOT</version> | ||
<version>2.1-kotlin</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously, drop the -kotlin
monicker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -57,8 +58,8 @@ | |||
<properties> | |||
|
|||
<!--Java Compiler Properties--> | |||
<maven.compiler.source>1.8</maven.compiler.source> | |||
<maven.compiler.target>1.8</maven.compiler.target> | |||
<maven.compiler.source>1.6</maven.compiler.source> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
* | ||
* @return | ||
*/ | ||
static AlchemyHttp newDefaultInstance() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By-bye java 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup. Won't be missed.
*/ | ||
fun go(): AlchemyRequest.Step1 | ||
|
||
companion object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Name the companion object Factory
, since it better encapsulates what this is for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
{ | ||
|
||
/** | ||
* Creates a new [AlchemyHttp] using the default settings for the [Apache HTTP Client][HttpClient] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the doc, since the library no longer uses Apache HTTP Client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
/** | ||
* | ||
* @author SirWellington |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bruh, add some java docs here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
val newParam = Pair(name, value) | ||
|
||
val queryParams = request.queryParams?.plus(newParam) ?: mapOf(newParam) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
You probably don't need the empty line above it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
override fun toString(): String | ||
{ | ||
var string = super.toString() | ||
if (hasResponse()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably replace with null-check and Elvis operator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
*/ | ||
@RunWith(AlchemyTestRunner::class) | ||
@IntegrationTest | ||
class DomainsDBTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love these tests. Maybe throw some repetitions in there, like 5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
*/ | ||
@RunWith(AlchemyTestRunner.class) | ||
@IntegrationTest | ||
public class WordnikAPITest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really dope!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
+ Renames HttpExecutor to HttpRequestExecutor
+ Adds documentation notes
+ Adds documentation notes
+ Refines code
+ Refines code
+ Refines code
Looks good! Approved. |
Rewrites the entire Library in Kotlin, and drops usage of the Apache HTTP Client, in favor of the native
HTTPURLConnection
interface.This makes the code compatible with the Android platform as well as the native JDK.