@Test
void should_DetermineDifferences_When_ComparingWorkbaskets() {

  Instant created = Instant.now();
  WorkbasketImpl oldWorkbasket = new WorkbasketImpl();
  oldWorkbasket.setId("oldWbId");
  oldWorkbasket.setKey("oldWbKey");
  oldWorkbasket.setDomain("oldWbDomain");
  oldWorkbasket.setCreated(created.minus(10, ChronoUnit.SECONDS));
  oldWorkbasket.setModified(created.minus(5, ChronoUnit.SECONDS));
  oldWorkbasket.setName("oldWb");
  oldWorkbasket.setType(WorkbasketType.PERSONAL);
  oldWorkbasket.setOrgLevel1("oworgLevel1");
  oldWorkbasket.setCustom1("owcustom1");
  oldWorkbasket.setOrgLevel2("oworgLevel2");
  oldWorkbasket.setCustom2("owcustom2");
  oldWorkbasket.setOrgLevel3("oworgLevel3");
  oldWorkbasket.setCustom3("owcustom3");
  oldWorkbasket.setOrgLevel4("oworgLevel4");
  oldWorkbasket.setCustom4("owcustom4");
  WorkbasketImpl newWorkbasket = new WorkbasketImpl();
  newWorkbasket.setId("newWbId");
  newWorkbasket.setKey("newWbKey");
  newWorkbasket.setDomain("oldWbDomain");
  newWorkbasket.setName("newWb");
  newWorkbasket.setCreated(created.minus(10, ChronoUnit.SECONDS));
  newWorkbasket.setModified(created.minus(2, ChronoUnit.SECONDS));
  newWorkbasket.setType(WorkbasketType.GROUP);
  newWorkbasket.setOrgLevel1("nworgLevel1");
  newWorkbasket.setCustom1("nwcustom1");
  newWorkbasket.setOrgLevel2("nworgLevel2");
  newWorkbasket.setCustom2("nwcustom2");
  newWorkbasket.setOrgLevel3("nworgLevel3");
  newWorkbasket.setCustom3("nwcustom3");
  newWorkbasket.setOrgLevel4("nworgLevel4");
  newWorkbasket.setCustom4("nwcustom4");
  JSONArray changedAttributes =
      new JSONObject(
              ObjectAttributeChangeDetector.determineChangesInAttributes(
                  oldWorkbasket, newWorkbasket))
          .getJSONArray("changes");
  assertThat(changedAttributes).hasSize(13);
}