use of uk.ac.ebi.spot.goci.curation.model.MappingDetails in project goci by EBISPOT.
the class AssociationOperationsServiceTest method createMappingDetails.
@Test
public void createMappingDetails() throws Exception {
MappingDetails mappingDetails = associationOperationsService.createMappingDetails(ASS_INTER);
assertThat(mappingDetails).isInstanceOf(MappingDetails.class);
assertThat(mappingDetails.getMappingDate()).isToday();
assertThat(mappingDetails.getPerformer()).isEqualTo("test");
}
use of uk.ac.ebi.spot.goci.curation.model.MappingDetails in project goci by EBISPOT.
the class AssociationController method addRowEditMode.
// Add single row to table
@RequestMapping(value = "/associations/{associationId}", params = { "addRow" })
public String addRowEditMode(SnpAssociationStandardMultiForm snpAssociationStandardMultiForm, Model model, @PathVariable Long associationId) {
snpAssociationStandardMultiForm.getSnpFormRows().add(new SnpFormRow());
// Pass back updated form
model.addAttribute("form", snpAssociationStandardMultiForm);
// Also passes back study object to view so we can create links back to main study page
Association currentAssociation = associationRepository.findOne(associationId);
Study associationStudy = currentAssociation.getStudy();
Long studyId = associationStudy.getId();
model.addAttribute("study", studyRepository.findOne(studyId));
// Determine if association is an OR or BETA type
String measurementType = associationOperationsService.determineIfAssociationIsOrType(currentAssociation);
model.addAttribute("measurementType", measurementType);
// Get mapping details
MappingDetails mappingDetails = associationOperationsService.createMappingDetails(currentAssociation);
model.addAttribute("mappingDetails", mappingDetails);
// Return any association errors
model.addAttribute("errors", associationValidationReportService.generateAssociationWarningsListView(associationId));
return "edit_multi_snp_association";
}
use of uk.ac.ebi.spot.goci.curation.model.MappingDetails in project goci by EBISPOT.
the class AssociationController method removeColEditMode.
// Remove column from table
@RequestMapping(value = "/associations/{associationId}", params = { "removeCol" })
public String removeColEditMode(SnpAssociationInteractionForm snpAssociationInteractionForm, HttpServletRequest req, Model model, @PathVariable Long associationId) {
//Index of value to remove
final Integer colId = Integer.valueOf(req.getParameter("removeCol"));
// Remove col
snpAssociationInteractionForm.getSnpFormColumns().remove(colId.intValue());
// Pass back updated form
model.addAttribute("form", snpAssociationInteractionForm);
// Also passes back study object to view so we can create links back to main study page
Association currentAssociation = associationRepository.findOne(associationId);
Study associationStudy = currentAssociation.getStudy();
Long studyId = associationStudy.getId();
model.addAttribute("study", studyRepository.findOne(studyId));
// Determine if association is an OR or BETA type
String measurementType = associationOperationsService.determineIfAssociationIsOrType(currentAssociation);
model.addAttribute("measurementType", measurementType);
// Get mapping details
MappingDetails mappingDetails = associationOperationsService.createMappingDetails(currentAssociation);
model.addAttribute("mappingDetails", mappingDetails);
// Return any association errors
model.addAttribute("errors", associationValidationReportService.generateAssociationWarningsListView(associationId));
return "edit_snp_interaction_association";
}
use of uk.ac.ebi.spot.goci.curation.model.MappingDetails in project goci by EBISPOT.
the class MappingDetailsServiceTest method testCreateMappingSummaryForStudyWithNoAssociations.
@Test
public void testCreateMappingSummaryForStudyWithNoAssociations() {
// Stubbing association repository
when(associationRepository.findByStudyId(STU_NO_ASS.getId())).thenReturn(Collections.EMPTY_LIST);
MappingDetails mappingDetails = mappingDetailsService.createMappingSummary(STU_NO_ASS);
verify(associationRepository, times(1)).findByStudyId(STU_NO_ASS.getId());
assertThat(mappingDetails).isInstanceOf(MappingDetails.class);
assertThat(mappingDetails).hasFieldOrPropertyWithValue("mappingDate", null);
assertThat(mappingDetails).hasFieldOrPropertyWithValue("performer", null);
}
use of uk.ac.ebi.spot.goci.curation.model.MappingDetails in project goci by EBISPOT.
the class MappingDetailsServiceTest method testCreateMappingSummaryForStudyWithAssociationsWithCuratorMapping.
@Test
public void testCreateMappingSummaryForStudyWithAssociationsWithCuratorMapping() {
// Stubbing association repository
when(associationRepository.findByStudyId(STU_CURATOR_MAPPING.getId())).thenReturn(Arrays.asList(ASS3, ASS4));
MappingDetails mappingDetails = mappingDetailsService.createMappingSummary(STU_CURATOR_MAPPING);
verify(associationRepository, times(1)).findByStudyId(STU_CURATOR_MAPPING.getId());
assertThat(mappingDetails).isInstanceOf(MappingDetails.class);
assertThat(mappingDetails).hasFieldOrPropertyWithValue("mappingDate", null);
assertThat(mappingDetails).hasFieldOrPropertyWithValue("performer", null);
}
Aggregations