package edu.harvard.iq.dataverse.search;

import javax.json.Json;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import static org.junit.Assert.assertEquals;
import org.junit.Test;

public class SolrSearchResultTest {

    @Test
    public void testJson() {

        boolean showRelevance = false;
        boolean showEntityIds = false;
        boolean showApiUrls = false;

        SolrSearchResult result01 = new SolrSearchResult("myQuery", "myName");
        result01.setType(SearchConstants.DATAVERSES);
        JsonObjectBuilder actual01 = result01.json(showRelevance, showEntityIds, showApiUrls);
        JsonObject actual = actual01.build();
        System.out.println("actual: " + actual);

        JsonObjectBuilder expResult = Json.createObjectBuilder();
        expResult.add("type", SearchConstants.DATAVERSE);
        JsonObject expected = expResult.build();
        System.out.println("expect: " + expected);

        assertEquals(expected, actual);

    }
}

@@ -386,16 +386,56 @@
 = false;
+%0A        boolean showThumbnails = false;
 %0A%0A      
@@ -653,16 +653,32 @@
 wApiUrls
+, showThumbnails
 );%0A     

fix broken test #3559