use of org.obiba.mica.study.domain.HarmonizationStudy in project mica2 by obiba.
the class DatasetDtosTest method before.
@Before
public void before() {
MicaConfig config = new MicaConfig();
config.setLocales(Arrays.asList(Locale.ENGLISH, Locale.FRENCH));
when(micaConfigService.getConfig()).thenReturn(config);
when(subjectAclService.isPermitted(anyString(), anyString(), anyString())).thenReturn(true);
when(publishedStudyService.findById(anyString())).thenReturn(new HarmonizationStudy());
when(studySummaryDtos.asHarmoStudyDto(anyString())).thenReturn(Mica.StudySummaryDto.newBuilder().setId("123").setPublished(true).build());
when(studySummaryDtos.asDto(anyString())).thenReturn(Mica.StudySummaryDto.newBuilder().setId("123").setPublished(true).build());
when(permissionsDtos.asDto(any(StudyDataset.class))).thenReturn(Mica.PermissionsDto.getDefaultInstance());
when(permissionsDtos.asDto(any(HarmonizationDataset.class))).thenReturn(Mica.PermissionsDto.getDefaultInstance());
}
use of org.obiba.mica.study.domain.HarmonizationStudy in project mica2 by obiba.
the class PublishedStudyResource method getStudyDto.
@GET
@Timed
public Mica.StudyDto getStudyDto(@PathParam("id") String id, @QueryParam("locale") String locale) {
checkAccess(id);
BaseStudy study = getStudy(id, locale);
return study instanceof Study ? dtos.asDto((Study) study) : dtos.asDto((HarmonizationStudy) study);
}
Aggregations