Skip to content

Commit

Permalink
storage: Do not include default values of includeSampleId nor include…
Browse files Browse the repository at this point in the history
…Genotype #TASK-2420
  • Loading branch information
j-coll committed Nov 29, 2022
1 parent d8b806d commit 9772ee8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class VariantAnalysisTest {
public static Object[][] parameters() {
return new Object[][]{
{MongoDBVariantStorageEngine.STORAGE_ENGINE_ID},
// {HadoopVariantStorageEngine.STORAGE_ENGINE_ID}
{HadoopVariantStorageEngine.STORAGE_ENGINE_ID}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import org.opencb.commons.datastore.core.Query;

/**
* Do not use native values (like boolean or int), so they are null by default.
* When using native values (like boolean or int), set add
* {@code @JsonInclude(JsonInclude.Include.NON_DEFAULT)} so they are null by default.
*/
public class VariantQueryParams extends BasicVariantQueryParams {

Expand All @@ -35,7 +36,9 @@ public class VariantQueryParams extends BasicVariantQueryParams {
private String includeSample;
private String includeFile;
private String includeSampleData;
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private boolean includeSampleId;
@JsonInclude(JsonInclude.Include.NON_DEFAULT)
private boolean includeGenotype;

private String file;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.opencb.opencga.core.models.variant;

import org.junit.Test;

import static org.junit.Assert.*;

public class VariantQueryParamsTest {

@Test
public void test() {
VariantQueryParams params = new VariantQueryParams();
assertEquals(0, params.toObjectMap().size());
assertEquals(0, params.toParams().size());
}
}

0 comments on commit 9772ee8

Please sign in to comment.