Skip to content

Conversation

@thewheat
Copy link
Contributor

@thewheat thewheat commented Feb 14, 2018

Addresses #179 & #202

  • Add support for some missing company attributes
    - Add tests including

@thewheat thewheat force-pushed the timlim/company-setters branch from 17c71c4 to e76c356 Compare February 14, 2018 15:13
* @param sessionCount
* @return the company object
*/
@Deprecated
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Needed to remove this as it was preventing tests from passing.
Open to alternative approaches to this

It is possible to remove setSessionCount method completely and Jackson will automatically read and extract the correct sessionCount value

@thewheat thewheat force-pushed the timlim/company-setters branch from e76c356 to 794a361 Compare June 21, 2018 08:50
@Deprecated
public Company setSessionCount(int sessionCount) {
return this;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this as it

//noinspection RedundantIfStatement
if (userCount != null ? !userCount.equals(company.userCount) : company.userCount != null) return false;
if (size != company.size) return false;
if (website != null ? !website.equals(company.website) : company.website != null) return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is quite complicated to read, you want to make sure that the current website and company website aren't equal, right? Is there any way you could export the equals checks to a separate method that returns the boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I can see that it is essentially checking for the possibly inequality between the 2 objects. I was following the standard format that exists for string checking and it is utilised in several places. Could definitely use a refactor though 👍

Do you see any issues with if (!Objects.equals(website, company.website)) return false; https://docs.oracle.com/javase/7/docs/api/java/util/Objects.html#equals(java.lang.Object,%20java.lang.Object)

I can try implement that as it seems built but seems to require Java 1.7

Copy link
Contributor

Choose a reason for hiding this comment

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

That's definitely a lot easier to read. What version of Java is this on? Why isn't it up higher?

That would definitely be nice, but I can understand that you're following the format. As well though, maintainability and readability are definitely important 😄

This definitely isn't a breaking change though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't think we have specified a version of Java we support but created this issue #214 to track the possibility of simplifying this

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry Tim, I missed this. I think you're definitely right we need to look into simplifying it.

@@ -0,0 +1,222 @@
package io.intercom.api;
Copy link
Contributor

Choose a reason for hiding this comment

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

Delighted that you're adding these tests, but I'm not actually sure that they're running in CI? Taking a look I can't see any specific suites listed 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh maybe they are 🤔

Copy link
Contributor

@SeanHealy33 SeanHealy33 left a comment

Choose a reason for hiding this comment

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

Chatted on Slack about this.

I think this pr is trying to do too much currently and would like 2-3 separate pr's for each issue.

@thewheat thewheat force-pushed the timlim/company-setters branch from 794a361 to e20348b Compare August 7, 2018 09:13
@thewheat thewheat changed the title Add support for new company attributes + add tests Add support for new company attributes Aug 7, 2018
@thewheat thewheat mentioned this pull request Aug 7, 2018
@thewheat
Copy link
Contributor Author

thewheat commented Aug 7, 2018

@SeanHealy33 split out into

@thewheat thewheat force-pushed the timlim/company-setters branch from 054b2ac to d36de74 Compare August 13, 2018 08:24
@thewheat thewheat mentioned this pull request Aug 15, 2018
Copy link
Contributor

@jonnyom jonnyom left a comment

Choose a reason for hiding this comment

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

I'm happy with this, just curious about the lastRequestAt object and then I'll approve!

Copy link
Contributor

@jonnyom jonnyom left a comment

Choose a reason for hiding this comment

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

This looks good to me 👍

@jonnyom jonnyom dismissed SeanHealy33’s stale review September 12, 2018 09:24

Tim has refined the PR to only work on company data

@jonnyom jonnyom merged commit 5586abb into master Sep 12, 2018
@jonnyom jonnyom deleted the timlim/company-setters branch September 12, 2018 09:26
@SeanHealy33
Copy link
Contributor

👍 nice work @thewheat

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