    @Test
    public void writeJSONWithSelectedFieldsAddsFiles() throws ComponentLookupException
    {

        JSONObject json = new JSONObject();
        this.mocker.getComponentUnderTest().writeJSON(this.patient, json, Collections.singletonList(CONTROLLER_NAME));

        Assert.assertTrue(json.has(DATA_NAME));
        JSONArray result = json.getJSONArray(DATA_NAME);
        Assert.assertEquals(2, result.length());
        Assert.assertSame(this.json1full, result.getJSONObject(0));
        Assert.assertSame(this.json2full, result.getJSONObject(1));
    }