@Test public void shouldGetUnit_when_jsonContainsUnit() { ObjectNode document = JsonHandler.createObjectNode(); document.set("unit", JsonHandler.createObjectNode()); document.set("lfc", JsonHandler.createObjectNode()); JsonNode unit = MetadataStorageHelper.getUnitFromUnitWithLFC(document); assertThat(unit).isNotNull(); }
public static JsonNode getUnitFromUnitWithLFC(JsonNode document) { if(document == null || !document.hasNonNull(UNIT_KEY)) { throw new IllegalArgumentException("Document should contain a "+UNIT_KEY+" object"); } return document.get(UNIT_KEY); }
MetadataStorageHelper { public static JsonNode getUnitFromUnitWithLFC(JsonNode document) { if(document == null || !document.hasNonNull(UNIT_KEY)) { throw new IllegalArgumentException("Document should contain a "+UNIT_KEY+" object"); } return document.get(UNIT_KEY); } }
MetadataStorageHelper { public static JsonNode getUnitFromUnitWithLFC(JsonNode document) { if(document == null || !document.hasNonNull(UNIT_KEY)) { throw new IllegalArgumentException("Document should contain a "+UNIT_KEY+" object"); } return document.get(UNIT_KEY); }  }
MetadataStorageHelper { public static JsonNode getUnitFromUnitWithLFC(JsonNode document) { if(document == null || !document.hasNonNull(UNIT_KEY)) { throw new IllegalArgumentException("Document should contain a "+UNIT_KEY+" object"); } return document.get(UNIT_KEY); }  static JsonNode getUnitWithLFC(JsonNode document, JsonNode lfc); static JsonNode getUnitFromUnitWithLFC(JsonNode document); static JsonNode getGotWithLFC(JsonNode document, JsonNode lfc); }
MetadataStorageHelper { public static JsonNode getUnitFromUnitWithLFC(JsonNode document) { if(document == null || !document.hasNonNull(UNIT_KEY)) { throw new IllegalArgumentException("Document should contain a "+UNIT_KEY+" object"); } return document.get(UNIT_KEY); }  static JsonNode getUnitWithLFC(JsonNode document, JsonNode lfc); static JsonNode getUnitFromUnitWithLFC(JsonNode document); static JsonNode getGotWithLFC(JsonNode document, JsonNode lfc);  }