-
Notifications
You must be signed in to change notification settings - Fork 2
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
adding support for calling the public branding APIs from the SDK. #74
base: master
Are you sure you want to change the base?
Conversation
|
||
public static CompletionStage<Branding> getBranding(String appId, String version, String os) { | ||
WSRequest request; | ||
String routerUrl = "https://go-monolith-v2-sbx.herokuapp.com"; |
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.
The router URL should be parameterized, or otherwise configurable
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.
addressed.
|
||
public static CompletionStage<Branding> getBranding(String appId, String version) { | ||
return getBranding(appId, version, "https://go-monolith-v2-sbx.herokuapp.com"); | ||
} |
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.
The url should be configurable rather than hard coded. The default should be go-monolith-v2.herokuapp.com.
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.
pushed the constant string into Constants.java
* Date: 11/22/17 | ||
*/ | ||
|
||
public class BrandingConfiguration { |
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.
You should consider adding @JsonIgnoreProperties(ignoreUnknown = true)
If the response changes it will break this request.
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.
addressed.
} | ||
|
||
JsonNode json = wsResponse.asJson(); | ||
return Optional.ofNullable(JsonUtils.fromJson(json, Branding.class)).orElse(null); |
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.
Doesn't Optional.ofNullable
return value if not null or Optional.empty()
if it is null? I'm not sure why you need orElse(null)
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.
Just a few comments. Looks good to me for the most part.
app/sdk/utils/Constants.java
Outdated
@@ -34,4 +35,6 @@ | |||
public static final String UPDATED_DATE_PARAM = "updatedate"; | |||
|
|||
public static final String AllowedOffsetKey = "apptree.allowedServerOffset"; | |||
|
|||
public static final String BRANDING_ROUTER_URL = "https://go-monolith-v2-sbx.herokuapp.com"; |
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.
Rename this to ROUTER_URL
.
Shouldn't the default be https://go-monolith-v2.herokuapp.com
?
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.
addressed
Gets all branding information from the public API.