@Test public void shouldCreateLotFromJson() throws Exception { LotAdapter lotAdapter = new LotAdapter(); String json = JsonFileReader.readJson(getClass(), "Lot.json"); Lot lot = lotAdapter.deserialize(new JsonParser().parse(json), null, null); assertEquals("6MK07", lot.getLotNumber()); assertEquals(DateUtil.parseString("2019-10-30", DateUtil.DB_DATE_FORMAT), lot.getExpirationDate()); }
@Override public Lot deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return new Gson().fromJson(json, LotResponse.class).convertToLot(); }
LotAdapter implements JsonDeserializer<Lot> { @Override public Lot deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return new Gson().fromJson(json, LotResponse.class).convertToLot(); } }
LotAdapter implements JsonDeserializer<Lot> { @Override public Lot deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return new Gson().fromJson(json, LotResponse.class).convertToLot(); }  }
LotAdapter implements JsonDeserializer<Lot> { @Override public Lot deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return new Gson().fromJson(json, LotResponse.class).convertToLot(); }  @Override Lot deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context); }
LotAdapter implements JsonDeserializer<Lot> { @Override public Lot deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context) throws JsonParseException { return new Gson().fromJson(json, LotResponse.class).convertToLot(); }  @Override Lot deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context);  }