Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable integration tests #29

Merged
merged 14 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

package org.mskcc.cbio.portal.integrationTest.dao;

import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mskcc.cbio.portal.dao.DaoCancerStudy;
Expand Down Expand Up @@ -71,7 +70,7 @@ public class TestDaoCancerStudy {
@Test
public void testDaoCancerStudy() throws DaoException, IOException {

Assert.assertEquals("Breast Invasive Carcinoma", DaoTypeOfCancer.getTypeOfCancerById("BRCA").getName());
assertEquals("Breast Invasive Carcinoma", DaoTypeOfCancer.getTypeOfCancerById("BRCA").getName());

CancerStudy cancerStudy = new CancerStudy("GBM", "GBM Description", "gbm", "brca", false);
cancerStudy.setReferenceGenome("hg19");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
package org.mskcc.cbio.portal.integrationTest.dao;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -58,7 +57,9 @@
import java.util.Map;
import java.util.Set;

import static org.junit.Assert.assertEquals;
import static org.junit.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
forus marked this conversation as resolved.
Show resolved Hide resolved
import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* JUnit tests for DaoMutation class.
Expand Down Expand Up @@ -223,23 +224,23 @@ private void validateMockAnnotationJson(ExtendedMutation mutation) {
Map<String, Map<String, String>> expectedAnnotationJsonMap = makeMockExpectedAnnotationJsonMap();

// confirm expected sizes
Assert.assertTrue(annotationJsonMap.containsKey("namespace1"));
Assert.assertEquals(expectedAnnotationJsonMap.get("namespace1").size(), annotationJsonMap.get("namespace1").size());
Assert.assertEquals(2, annotationJsonMap.get("namespace1").size());
Assert.assertTrue(annotationJsonMap.containsKey("namespace2"));
Assert.assertEquals(1, annotationJsonMap.get("namespace2").size());
Assert.assertEquals(expectedAnnotationJsonMap.get("namespace2").size(), annotationJsonMap.get("namespace2").size());
assertTrue(annotationJsonMap.containsKey("namespace1"));
assertEquals(expectedAnnotationJsonMap.get("namespace1").size(), annotationJsonMap.get("namespace1").size());
assertEquals(2, annotationJsonMap.get("namespace1").size());
assertTrue(annotationJsonMap.containsKey("namespace2"));
assertEquals(1, annotationJsonMap.get("namespace2").size());
assertEquals(expectedAnnotationJsonMap.get("namespace2").size(), annotationJsonMap.get("namespace2").size());

// compare namespace 1 annotation map values
Map<String, String> namespace1Map = annotationJsonMap.get("namespace1");
Map<String, String> expectedNamespace1Map = expectedAnnotationJsonMap.get("namespace1");
Assert.assertEquals(expectedNamespace1Map.get("header1"), namespace1Map.get("header1"));
Assert.assertEquals(expectedNamespace1Map.get("header2"), namespace1Map.get("header2"));
assertEquals(expectedNamespace1Map.get("header1"), namespace1Map.get("header1"));
assertEquals(expectedNamespace1Map.get("header2"), namespace1Map.get("header2"));

// compare namespace 2 annotation map values
Map<String, String> namespace2Map = annotationJsonMap.get("namespace2");
Map<String, String> expectedNamespace2Map = expectedAnnotationJsonMap.get("namespace2");
Assert.assertEquals(expectedNamespace2Map.get("header1"), namespace2Map.get("header1"));
assertEquals(expectedNamespace2Map.get("header1"), namespace2Map.get("header1"));
}

private String makeMockAnnotationJsonString() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import static org.cbioportal.model.MolecularProfile.DataType.DISCRETE;
import static org.cbioportal.model.MolecularProfile.ImportType.DISCRETE_LONG;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

@RunWith(SpringJUnit4ClassRunner.class)
Expand Down Expand Up @@ -579,8 +580,8 @@ private void assertSampleExistsInGeneticProfile(String sampleId) throws DaoExcep
geneticProfile.getCancerStudyId(),
sampleStableId
);
Assert.assertNotNull(sample);
Assert.assertTrue(DaoSampleProfile.sampleExistsInGeneticProfile(
assertNotNull(sample);
assertTrue(DaoSampleProfile.sampleExistsInGeneticProfile(
sample.getInternalId(),
geneticProfile.getGeneticProfileId()
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
package org.mskcc.cbio.portal.scripts;

import org.junit.Test;
import org.mskcc.cbio.portal.scripts.CutInvalidCases;

import static org.junit.Assert.*;

import java.io.File;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

/**
* JUnit test for CutInvalidCases class.
*/
Expand Down
Loading