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

adding support for calling the public branding APIs from the SDK. #74

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

karikittie
Copy link
Contributor

Gets all branding information from the public API.


public static CompletionStage<Branding> getBranding(String appId, String version, String os) {
WSRequest request;
String routerUrl = "https://go-monolith-v2-sbx.herokuapp.com";
Copy link
Contributor

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

Copy link
Contributor Author

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");
}
Copy link
Contributor

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.

Copy link
Contributor Author

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 {
Copy link
Contributor

@SamOrozco SamOrozco Nov 27, 2017

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.

Copy link
Contributor Author

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);
Copy link
Contributor

@SamOrozco SamOrozco Nov 27, 2017

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)

Copy link
Contributor

@SamOrozco SamOrozco left a 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.

@@ -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";
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants