@Test public void fromJSONReturnsNullForNullArgument() throws ComponentLookupException { Assert.assertNull(this.mocker.getComponentUnderTest().fromJSON(null)); }
public Attachment fromJSON(JSONObject attachment) { if (attachment == null) { return null; } try { return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); } catch (IllegalArgumentException ex) { this.logger.warn("Invalid JSON for deserializing an attachment: {}", attachment); return null; } }
AttachmentAdapterFactory { public Attachment fromJSON(JSONObject attachment) { if (attachment == null) { return null; } try { return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); } catch (IllegalArgumentException ex) { this.logger.warn("Invalid JSON for deserializing an attachment: {}", attachment); return null; } } }
AttachmentAdapterFactory { public Attachment fromJSON(JSONObject attachment) { if (attachment == null) { return null; } try { return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); } catch (IllegalArgumentException ex) { this.logger.warn("Invalid JSON for deserializing an attachment: {}", attachment); return null; } }  }
AttachmentAdapterFactory { public Attachment fromJSON(JSONObject attachment) { if (attachment == null) { return null; } try { return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); } catch (IllegalArgumentException ex) { this.logger.warn("Invalid JSON for deserializing an attachment: {}", attachment); return null; } }  Attachment fromXWikiAttachment(XWikiAttachment attachment); Attachment fromJSON(JSONObject attachment); }
AttachmentAdapterFactory { public Attachment fromJSON(JSONObject attachment) { if (attachment == null) { return null; } try { return new Attachment(attachment, this.userResolver, this.userSerializer, this.contextProvider); } catch (IllegalArgumentException ex) { this.logger.warn("Invalid JSON for deserializing an attachment: {}", attachment); return null; } }  Attachment fromXWikiAttachment(XWikiAttachment attachment); Attachment fromJSON(JSONObject attachment);  }