Search in sources :

Example 1 with Analysis

use of org.icgc.dcc.song.server.model.analysis.Analysis in project SONG by overture-stack.

the class ExportServiceTest method generateData.

/**
 * Generate {@code numStudies} studies and for each study generate {@code numAnalysisPerStudy} analyses, and put
 * everything in a map, where the keys are studyIds and the values are all the analyses for that study
 */
private Map<String, List<? extends Analysis>> generateData(Class<? extends Analysis> analysisClass, int numStudies, int numAnalysesPerStudy, boolean includeAnalysisId, boolean includeOtherIds) {
    val studyGenerator = createStudyGenerator(studyService, randomGenerator);
    val map = Maps.<String, List<? extends Analysis>>newHashMap();
    for (int s = 0; s < numStudies; s++) {
        val studyId = studyGenerator.createRandomStudy();
        val analysisGenerator = createAnalysisGenerator(studyId, analysisService, randomGenerator);
        val analyses = range(0, numAnalysesPerStudy).boxed().map(x -> analysisGenerator.createDefaultRandomAnalysis(analysisClass)).peek(x -> massageAnalysisInplace(x, includeAnalysisId, includeOtherIds)).collect(toImmutableList());
        map.put(studyId, analyses);
    }
    return ImmutableMap.copyOf(map);
}
Also used : lombok.val(lombok.val) File(org.icgc.dcc.song.server.model.entity.File) SneakyThrows(lombok.SneakyThrows) IntStream.range(java.util.stream.IntStream.range) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Autowired(org.springframework.beans.factory.annotation.Autowired) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TestFiles.assertSetsMatch(org.icgc.dcc.song.server.utils.TestFiles.assertSetsMatch) AnalysisTypes.resolveAnalysisType(org.icgc.dcc.song.server.model.enums.AnalysisTypes.resolveAnalysisType) TestExecutionListeners(org.springframework.test.context.TestExecutionListeners) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Map(java.util.Map) JsonNode(com.fasterxml.jackson.databind.JsonNode) ExportService(org.icgc.dcc.song.server.service.export.ExportService) SpringRunner(org.springframework.test.context.junit4.SpringRunner) Collectors.toSet(java.util.stream.Collectors.toSet) RandomGenerator.createRandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator.createRandomGenerator) Reductions.groupUnique(org.icgc.dcc.song.core.utils.Reductions.groupUnique) ImmutableMap(com.google.common.collect.ImmutableMap) Specimen(org.icgc.dcc.song.server.model.entity.Specimen) Collection(java.util.Collection) Set(java.util.Set) JsonUtils(org.icgc.dcc.song.core.utils.JsonUtils) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) JsonUtils.fromJson(org.icgc.dcc.song.core.utils.JsonUtils.fromJson) RandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator) RunWith(org.junit.runner.RunWith) SEQUENCING_READ(org.icgc.dcc.song.server.model.enums.AnalysisTypes.SEQUENCING_READ) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis) StudyGenerator(org.icgc.dcc.song.server.utils.StudyGenerator) AnalysisGenerator.createAnalysisGenerator(org.icgc.dcc.song.server.utils.AnalysisGenerator.createAnalysisGenerator) DependencyInjectionTestExecutionListener(org.springframework.test.context.support.DependencyInjectionTestExecutionListener) Before(org.junit.Before) Donor(org.icgc.dcc.song.server.model.entity.Donor) VARIANT_CALL(org.icgc.dcc.song.server.model.enums.AnalysisTypes.VARIANT_CALL) JsonUtils.toJson(org.icgc.dcc.song.core.utils.JsonUtils.toJson) lombok.val(lombok.val) Test(org.junit.Test) Maps(com.google.common.collect.Maps) CompositeEntity(org.icgc.dcc.song.server.model.entity.composites.CompositeEntity) UploadStates.resolveState(org.icgc.dcc.song.server.model.enums.UploadStates.resolveState) AnalysisRepository(org.icgc.dcc.song.server.repository.AnalysisRepository) EMPTY_STRING(org.icgc.dcc.song.server.utils.TestFiles.EMPTY_STRING) Collectors.toImmutableList(org.icgc.dcc.common.core.util.stream.Collectors.toImmutableList) StudyGenerator.createStudyGenerator(org.icgc.dcc.song.server.utils.StudyGenerator.createStudyGenerator) UploadStates(org.icgc.dcc.song.server.model.enums.UploadStates) ResponseEntity(org.springframework.http.ResponseEntity) Sample(org.icgc.dcc.song.server.model.entity.Sample) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) Collectors.toImmutableList(org.icgc.dcc.common.core.util.stream.Collectors.toImmutableList)

Example 2 with Analysis

use of org.icgc.dcc.song.server.model.analysis.Analysis in project SONG by overture-stack.

the class ExportServiceTest method runExportTest.

public void runExportTest(Class<? extends Analysis> analysisClass, int numStudies, int numAnalysesPerStudy) {
    val includeAnalysisId = true;
    val includeOtherIds = false;
    // Check config
    assertCorrectConfig(numStudies, numAnalysesPerStudy);
    // Generate data
    val expectedData = generateData(analysisClass, numStudies, numAnalysesPerStudy, includeAnalysisId, includeOtherIds);
    // Process StudyMode Data
    val actualStudyModeExportedPayloads = expectedData.keySet().stream().map(s -> exportService.exportPayloadsForStudy(s, includeAnalysisId, includeOtherIds)).flatMap(Collection::stream).collect(toImmutableList());
    assertThat(actualStudyModeExportedPayloads).hasSize(numStudies);
    val actualStudyModeData = Maps.<String, List<? extends Analysis>>newHashMap();
    for (val exportedPayload : actualStudyModeExportedPayloads) {
        val studyId = exportedPayload.getStudyId();
        val analyses = exportedPayload.getPayloads().stream().map(x -> fromJson(x, Analysis.class)).collect(toImmutableList());
        actualStudyModeData.put(studyId, analyses);
    }
    // Process AnalysisMode Data
    val expectedAnalysisIds = expectedData.values().stream().flatMap(Collection::stream).map(Analysis::getAnalysisId).collect(toImmutableList());
    val actualAnalysisModeExportedPayloads = exportService.exportPayload(expectedAnalysisIds, includeAnalysisId, includeOtherIds);
    assertThat(actualAnalysisModeExportedPayloads).hasSize(numStudies);
    val actualAnalysisModeData = Maps.<String, List<? extends Analysis>>newHashMap();
    for (val exportedPayload : actualAnalysisModeExportedPayloads) {
        val studyId = exportedPayload.getStudyId();
        val analyses = exportedPayload.getPayloads().stream().map(x -> fromJson(x, Analysis.class)).collect(toImmutableList());
        actualAnalysisModeData.put(studyId, analyses);
    }
    assertMatchingData(actualAnalysisModeData, expectedData);
    assertMatchingData(actualStudyModeData, expectedData);
}
Also used : lombok.val(lombok.val) File(org.icgc.dcc.song.server.model.entity.File) SneakyThrows(lombok.SneakyThrows) IntStream.range(java.util.stream.IntStream.range) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Autowired(org.springframework.beans.factory.annotation.Autowired) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TestFiles.assertSetsMatch(org.icgc.dcc.song.server.utils.TestFiles.assertSetsMatch) AnalysisTypes.resolveAnalysisType(org.icgc.dcc.song.server.model.enums.AnalysisTypes.resolveAnalysisType) TestExecutionListeners(org.springframework.test.context.TestExecutionListeners) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Map(java.util.Map) JsonNode(com.fasterxml.jackson.databind.JsonNode) ExportService(org.icgc.dcc.song.server.service.export.ExportService) SpringRunner(org.springframework.test.context.junit4.SpringRunner) Collectors.toSet(java.util.stream.Collectors.toSet) RandomGenerator.createRandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator.createRandomGenerator) Reductions.groupUnique(org.icgc.dcc.song.core.utils.Reductions.groupUnique) ImmutableMap(com.google.common.collect.ImmutableMap) Specimen(org.icgc.dcc.song.server.model.entity.Specimen) Collection(java.util.Collection) Set(java.util.Set) JsonUtils(org.icgc.dcc.song.core.utils.JsonUtils) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) JsonUtils.fromJson(org.icgc.dcc.song.core.utils.JsonUtils.fromJson) RandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator) RunWith(org.junit.runner.RunWith) SEQUENCING_READ(org.icgc.dcc.song.server.model.enums.AnalysisTypes.SEQUENCING_READ) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis) StudyGenerator(org.icgc.dcc.song.server.utils.StudyGenerator) AnalysisGenerator.createAnalysisGenerator(org.icgc.dcc.song.server.utils.AnalysisGenerator.createAnalysisGenerator) DependencyInjectionTestExecutionListener(org.springframework.test.context.support.DependencyInjectionTestExecutionListener) Before(org.junit.Before) Donor(org.icgc.dcc.song.server.model.entity.Donor) VARIANT_CALL(org.icgc.dcc.song.server.model.enums.AnalysisTypes.VARIANT_CALL) JsonUtils.toJson(org.icgc.dcc.song.core.utils.JsonUtils.toJson) lombok.val(lombok.val) Test(org.junit.Test) Maps(com.google.common.collect.Maps) CompositeEntity(org.icgc.dcc.song.server.model.entity.composites.CompositeEntity) UploadStates.resolveState(org.icgc.dcc.song.server.model.enums.UploadStates.resolveState) AnalysisRepository(org.icgc.dcc.song.server.repository.AnalysisRepository) EMPTY_STRING(org.icgc.dcc.song.server.utils.TestFiles.EMPTY_STRING) Collectors.toImmutableList(org.icgc.dcc.common.core.util.stream.Collectors.toImmutableList) StudyGenerator.createStudyGenerator(org.icgc.dcc.song.server.utils.StudyGenerator.createStudyGenerator) UploadStates(org.icgc.dcc.song.server.model.enums.UploadStates) ResponseEntity(org.springframework.http.ResponseEntity) Sample(org.icgc.dcc.song.server.model.entity.Sample) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis) Collection(java.util.Collection) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) Collectors.toImmutableList(org.icgc.dcc.common.core.util.stream.Collectors.toImmutableList)

Example 3 with Analysis

use of org.icgc.dcc.song.server.model.analysis.Analysis in project SONG by overture-stack.

the class ExportServiceTest method assertMatchingData.

private static void assertMatchingData(Map<String, List<? extends Analysis>> actualData, Map<String, List<? extends Analysis>> expectedData) {
    assertSetsMatch(expectedData.keySet(), actualData.keySet());
    for (val studyId : expectedData.keySet()) {
        val expectedAnalyses = expectedData.get(studyId);
        // Assumed that all analyses in the list are unique
        val actualAnalysisMap = groupUnique(actualData.get(studyId), Analysis::getAnalysisId);
        for (val expectedAnalysis : expectedAnalyses) {
            assertThat(actualAnalysisMap).containsKey(expectedAnalysis.getAnalysisId());
            val actualAnalysis = actualAnalysisMap.get(expectedAnalysis.getAnalysisId());
            assertAnalysis(actualAnalysis, expectedAnalysis);
        }
    }
}
Also used : lombok.val(lombok.val) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis)

Example 4 with Analysis

use of org.icgc.dcc.song.server.model.analysis.Analysis in project SONG by overture-stack.

the class ExportServiceTest method runSingleExportTest.

private void runSingleExportTest(Class<? extends Analysis> analysisClass, boolean includeAnalysisId, boolean includeOtherIds) {
    val studyId = studyGenerator.createRandomStudy();
    val analysisGenerator = createAnalysisGenerator(studyId, analysisService, randomGenerator);
    val expectedAnalysis = analysisGenerator.createDefaultRandomAnalysis(analysisClass);
    val analysisId = expectedAnalysis.getAnalysisId();
    massageAnalysisInplace(expectedAnalysis, includeAnalysisId, includeOtherIds);
    val exportedPayloads = exportService.exportPayload(newArrayList(analysisId), includeAnalysisId, includeOtherIds);
    assertThat(exportedPayloads).hasSize(1);
    val exportedPayload = exportedPayloads.get(0);
    assertThat(exportedPayload.getStudyId()).isEqualTo(studyId);
    val analyses = exportedPayload.getPayloads().stream().map(x -> fromJson(x, Analysis.class)).collect(toImmutableList());
    assertThat(analyses).hasSize(1);
    val actualAnalysis = analyses.get(0);
    assertAnalysis(actualAnalysis, expectedAnalysis);
}
Also used : lombok.val(lombok.val) File(org.icgc.dcc.song.server.model.entity.File) SneakyThrows(lombok.SneakyThrows) IntStream.range(java.util.stream.IntStream.range) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Autowired(org.springframework.beans.factory.annotation.Autowired) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) ActiveProfiles(org.springframework.test.context.ActiveProfiles) TestFiles.assertSetsMatch(org.icgc.dcc.song.server.utils.TestFiles.assertSetsMatch) AnalysisTypes.resolveAnalysisType(org.icgc.dcc.song.server.model.enums.AnalysisTypes.resolveAnalysisType) TestExecutionListeners(org.springframework.test.context.TestExecutionListeners) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Map(java.util.Map) JsonNode(com.fasterxml.jackson.databind.JsonNode) ExportService(org.icgc.dcc.song.server.service.export.ExportService) SpringRunner(org.springframework.test.context.junit4.SpringRunner) Collectors.toSet(java.util.stream.Collectors.toSet) RandomGenerator.createRandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator.createRandomGenerator) Reductions.groupUnique(org.icgc.dcc.song.core.utils.Reductions.groupUnique) ImmutableMap(com.google.common.collect.ImmutableMap) Specimen(org.icgc.dcc.song.server.model.entity.Specimen) Collection(java.util.Collection) Set(java.util.Set) JsonUtils(org.icgc.dcc.song.core.utils.JsonUtils) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) JsonUtils.fromJson(org.icgc.dcc.song.core.utils.JsonUtils.fromJson) RandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator) RunWith(org.junit.runner.RunWith) SEQUENCING_READ(org.icgc.dcc.song.server.model.enums.AnalysisTypes.SEQUENCING_READ) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis) StudyGenerator(org.icgc.dcc.song.server.utils.StudyGenerator) AnalysisGenerator.createAnalysisGenerator(org.icgc.dcc.song.server.utils.AnalysisGenerator.createAnalysisGenerator) DependencyInjectionTestExecutionListener(org.springframework.test.context.support.DependencyInjectionTestExecutionListener) Before(org.junit.Before) Donor(org.icgc.dcc.song.server.model.entity.Donor) VARIANT_CALL(org.icgc.dcc.song.server.model.enums.AnalysisTypes.VARIANT_CALL) JsonUtils.toJson(org.icgc.dcc.song.core.utils.JsonUtils.toJson) lombok.val(lombok.val) Test(org.junit.Test) Maps(com.google.common.collect.Maps) CompositeEntity(org.icgc.dcc.song.server.model.entity.composites.CompositeEntity) UploadStates.resolveState(org.icgc.dcc.song.server.model.enums.UploadStates.resolveState) AnalysisRepository(org.icgc.dcc.song.server.repository.AnalysisRepository) EMPTY_STRING(org.icgc.dcc.song.server.utils.TestFiles.EMPTY_STRING) Collectors.toImmutableList(org.icgc.dcc.common.core.util.stream.Collectors.toImmutableList) StudyGenerator.createStudyGenerator(org.icgc.dcc.song.server.utils.StudyGenerator.createStudyGenerator) UploadStates(org.icgc.dcc.song.server.model.enums.UploadStates) ResponseEntity(org.springframework.http.ResponseEntity) Sample(org.icgc.dcc.song.server.model.entity.Sample)

Example 5 with Analysis

use of org.icgc.dcc.song.server.model.analysis.Analysis in project SONG by overture-stack.

the class AnalysisServiceTest method testGetAnalysisAndIdSearch.

@Test
public void testGetAnalysisAndIdSearch() {
    val studyGenerator = createStudyGenerator(studyService, randomGenerator);
    val studyId = studyGenerator.createRandomStudy();
    val analysisGenerator = createAnalysisGenerator(studyId, service, payloadGenerator);
    val numAnalysis = 10;
    val sraMap = Maps.<String, SequencingReadAnalysis>newHashMap();
    val vcaMap = Maps.<String, VariantCallAnalysis>newHashMap();
    val expectedAnalyses = Sets.<Analysis>newHashSet();
    for (int i = 1; i <= numAnalysis; i++) {
        if (i % 2 == 0) {
            val sra = analysisGenerator.createDefaultRandomSequencingReadAnalysis();
            assertThat(sraMap.containsKey(sra.getAnalysisId())).isFalse();
            sraMap.put(sra.getAnalysisId(), sra);
            expectedAnalyses.add(sra);
        } else {
            val vca = analysisGenerator.createDefaultRandomVariantCallAnalysis();
            assertThat(sraMap.containsKey(vca.getAnalysisId())).isFalse();
            vcaMap.put(vca.getAnalysisId(), vca);
            expectedAnalyses.add(vca);
        }
    }
    assertThat(expectedAnalyses).hasSize(numAnalysis);
    assertThat(sraMap.keySet().size() + vcaMap.keySet().size()).isEqualTo(numAnalysis);
    val expectedVCAs = newHashSet(vcaMap.values());
    val expectedSRAs = newHashSet(sraMap.values());
    assertThat(expectedSRAs).hasSize(sraMap.keySet().size());
    assertThat(expectedVCAs).hasSize(vcaMap.keySet().size());
    val actualAnalyses = service.getAnalysis(studyId);
    val actualSRAs = actualAnalyses.stream().filter(x -> resolveAnalysisType(x.getAnalysisType()) == SEQUENCING_READ).collect(toSet());
    val actualVCAs = actualAnalyses.stream().filter(x -> resolveAnalysisType(x.getAnalysisType()) == VARIANT_CALL).collect(toSet());
    assertThat(actualSRAs).hasSize(sraMap.keySet().size());
    assertThat(actualVCAs).hasSize(vcaMap.keySet().size());
    assertThat(actualSRAs).containsAll(expectedSRAs);
    assertThat(actualVCAs).containsAll(expectedVCAs);
    // Do a study-wide idSearch and verify the response effectively has the same
    // number of results as the getAnalysis method
    val searchedAnalyses = service.idSearch(studyId, createIdSearchRequest(null, null, null, null));
    assertThat(searchedAnalyses).hasSameSizeAs(expectedAnalyses);
    assertThat(searchedAnalyses).containsOnlyElementsOf(expectedAnalyses);
}
Also used : lombok.val(lombok.val) ANALYSIS_ID_NOT_FOUND(org.icgc.dcc.song.core.exceptions.ServerErrors.ANALYSIS_ID_NOT_FOUND) ExistenceService.createExistenceService(org.icgc.dcc.song.server.service.ExistenceService.createExistenceService) File(org.icgc.dcc.song.server.model.entity.File) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Autowired(org.springframework.beans.factory.annotation.Autowired) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) ActiveProfiles(org.springframework.test.context.ActiveProfiles) DUPLICATE_ANALYSIS_ATTEMPT(org.icgc.dcc.song.core.exceptions.ServerErrors.DUPLICATE_ANALYSIS_ATTEMPT) AnalysisTypes.resolveAnalysisType(org.icgc.dcc.song.server.model.enums.AnalysisTypes.resolveAnalysisType) TestExecutionListeners(org.springframework.test.context.TestExecutionListeners) Study(org.icgc.dcc.song.server.model.entity.Study) PayloadGenerator.createPayloadGenerator(org.icgc.dcc.song.server.utils.PayloadGenerator.createPayloadGenerator) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Sets.newHashSet(com.google.common.collect.Sets.newHashSet) SpringRunner(org.springframework.test.context.junit4.SpringRunner) SongErrorAssertions.assertSongError(org.icgc.dcc.song.core.testing.SongErrorAssertions.assertSongError) Collectors.toSet(java.util.stream.Collectors.toSet) STUDY_ID_DOES_NOT_EXIST(org.icgc.dcc.song.core.exceptions.ServerErrors.STUDY_ID_DOES_NOT_EXIST) ANALYSIS_MISSING_FILES(org.icgc.dcc.song.core.exceptions.ServerErrors.ANALYSIS_MISSING_FILES) RandomGenerator.createRandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator.createRandomGenerator) WireMock.aResponse(com.github.tomakehurst.wiremock.client.WireMock.aResponse) TestFiles.assertInfoKVPair(org.icgc.dcc.song.server.utils.TestFiles.assertInfoKVPair) Sets(com.google.common.collect.Sets) String.format(java.lang.String.format) JsonUtils(org.icgc.dcc.song.core.utils.JsonUtils) Slf4j(lombok.extern.slf4j.Slf4j) Assertions.fail(org.assertj.core.api.Assertions.fail) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) ANALYSIS_MISSING_SAMPLES(org.icgc.dcc.song.core.exceptions.ServerErrors.ANALYSIS_MISSING_SAMPLES) JsonUtils.fromJson(org.icgc.dcc.song.core.utils.JsonUtils.fromJson) RandomGenerator(org.icgc.dcc.song.core.utils.RandomGenerator) IdSearchRequest.createIdSearchRequest(org.icgc.dcc.song.server.repository.search.IdSearchRequest.createIdSearchRequest) RunWith(org.junit.runner.RunWith) SEQUENCING_READ(org.icgc.dcc.song.server.model.enums.AnalysisTypes.SEQUENCING_READ) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis) ArrayList(java.util.ArrayList) WireMockRule(com.github.tomakehurst.wiremock.junit.WireMockRule) AnalysisGenerator.createAnalysisGenerator(org.icgc.dcc.song.server.utils.AnalysisGenerator.createAnalysisGenerator) AnalysisGenerator(org.icgc.dcc.song.server.utils.AnalysisGenerator) DependencyInjectionTestExecutionListener(org.springframework.test.context.support.DependencyInjectionTestExecutionListener) UNPUBLISHED_FILE_IDS(org.icgc.dcc.song.core.exceptions.ServerErrors.UNPUBLISHED_FILE_IDS) Before(org.junit.Before) WireMock.get(com.github.tomakehurst.wiremock.client.WireMock.get) VARIANT_CALL(org.icgc.dcc.song.server.model.enums.AnalysisTypes.VARIANT_CALL) JsonUtils.toJson(org.icgc.dcc.song.core.utils.JsonUtils.toJson) lombok.val(lombok.val) WireMockConfiguration.options(com.github.tomakehurst.wiremock.core.WireMockConfiguration.options) ReflectionTestUtils(org.springframework.test.util.ReflectionTestUtils) Test(org.junit.Test) Maps(com.google.common.collect.Maps) CompositeEntity(org.icgc.dcc.song.server.model.entity.composites.CompositeEntity) WireMock.urlMatching(com.github.tomakehurst.wiremock.client.WireMock.urlMatching) UNPUBLISHED(org.icgc.dcc.song.server.model.enums.AnalysisStates.UNPUBLISHED) TestFiles.getJsonStringFromClasspath(org.icgc.dcc.song.server.utils.TestFiles.getJsonStringFromClasspath) AnalysisRepository(org.icgc.dcc.song.server.repository.AnalysisRepository) SEQUENCING_READ_NOT_FOUND(org.icgc.dcc.song.core.exceptions.ServerErrors.SEQUENCING_READ_NOT_FOUND) PayloadGenerator(org.icgc.dcc.song.server.utils.PayloadGenerator) Rule(org.junit.Rule) Metadata(org.icgc.dcc.song.server.model.Metadata) SampleRepository(org.icgc.dcc.song.server.repository.SampleRepository) VARIANT_CALL_NOT_FOUND(org.icgc.dcc.song.core.exceptions.ServerErrors.VARIANT_CALL_NOT_FOUND) StudyGenerator.createStudyGenerator(org.icgc.dcc.song.server.utils.StudyGenerator.createStudyGenerator) RetryTemplate(org.springframework.retry.support.RetryTemplate) OK(org.springframework.http.HttpStatus.OK) Sample(org.icgc.dcc.song.server.model.entity.Sample) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) SequencingReadAnalysis(org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) Analysis(org.icgc.dcc.song.server.model.analysis.Analysis) VariantCallAnalysis(org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Aggregations

lombok.val (lombok.val)6 Analysis (org.icgc.dcc.song.server.model.analysis.Analysis)6 SequencingReadAnalysis (org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis)6 VariantCallAnalysis (org.icgc.dcc.song.server.model.analysis.VariantCallAnalysis)6 Maps (com.google.common.collect.Maps)5 Collectors.toSet (java.util.stream.Collectors.toSet)5 Slf4j (lombok.extern.slf4j.Slf4j)5 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)5 JsonUtils (org.icgc.dcc.song.core.utils.JsonUtils)5 JsonUtils.fromJson (org.icgc.dcc.song.core.utils.JsonUtils.fromJson)5 JsonUtils.toJson (org.icgc.dcc.song.core.utils.JsonUtils.toJson)5 RandomGenerator (org.icgc.dcc.song.core.utils.RandomGenerator)5 RandomGenerator.createRandomGenerator (org.icgc.dcc.song.core.utils.RandomGenerator.createRandomGenerator)5 File (org.icgc.dcc.song.server.model.entity.File)5 Sample (org.icgc.dcc.song.server.model.entity.Sample)5 CompositeEntity (org.icgc.dcc.song.server.model.entity.composites.CompositeEntity)5 SEQUENCING_READ (org.icgc.dcc.song.server.model.enums.AnalysisTypes.SEQUENCING_READ)5 VARIANT_CALL (org.icgc.dcc.song.server.model.enums.AnalysisTypes.VARIANT_CALL)5 AnalysisTypes.resolveAnalysisType (org.icgc.dcc.song.server.model.enums.AnalysisTypes.resolveAnalysisType)5 AnalysisRepository (org.icgc.dcc.song.server.repository.AnalysisRepository)5