Skip to content

Commit

Permalink
adjisajdisajdijsadijsaidj
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Sikina committed Oct 14, 2023
1 parent 6f0c33e commit 1518d59
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package edu.harvard.dbmi.avillach;

import edu.harvard.dbmi.avillach.domain.QueryRequest;
import junit.framework.TestCase;
import org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider;
import org.junit.Test;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.util.HashMap;

public class PicsureRSTest {

@Test
public void asdf() throws IOException {
ResteasyJackson2Provider p = new ResteasyJackson2Provider();
String json = "{\"resourceUUID\":\"de273216-3b46-4dec-a330-1aa0634624ae\",\"query\":{\"categoryFilters\":{},\"numericFilters\":{},\"requiredFields\":[],\"anyRecordOf\":[],\"variantInfoFilters\":[{\"categoryVariantInfoFilters\":{},\"numericVariantInfoFilters\":{}}],\"expectedResultType\":\"COUNT\"}";
Class<?> queryRequestClass = QueryRequest.class;
Object o = p.readFrom((Class<Object>) queryRequestClass, QueryRequest.class, new Annotation[]{}, MediaType.APPLICATION_JSON_TYPE, new MultivaluedHashMap<>(), new ByteArrayInputStream(json.getBytes()));


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Map;
import java.util.UUID;

@JsonTypeInfo(use = JsonTypeInfo.Id.DEDUCTION, defaultImpl = GeneralQueryRequest.class)
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, defaultImpl = GeneralQueryRequest.class)
@JsonSubTypes({ @JsonSubTypes.Type(GeneralQueryRequest.class), @JsonSubTypes.Type(GICQueryRequest.class) })
@JsonIgnoreProperties(ignoreUnknown = true)
public interface QueryRequest {
Expand Down

0 comments on commit 1518d59

Please sign in to comment.