use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityConfigServiceBean method resetUserConfig.
@Override
@SneakyThrows
public /**
* {@inheritDoc}
*/
String resetUserConfig(ActivityConfigDTO resetConfig, String userConfig) throws ServiceException {
ActivityConfigDTO usmUserConfig = getConfiguration(userConfig);
ActivityConfigDTO mergedConfig = PreferenceConfigMapper.INSTANCE.resetUserPreference(usmUserConfig, resetConfig);
return getJson(mergedConfig);
}
use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getTargetActivityConfigDTO.
public static ActivityConfigDTO getTargetActivityConfigDTO() {
ActivityConfigDTO activityConfigDTO = new ActivityConfigDTO();
FishingActivityConfigDTO fishingActivityConfig = new FishingActivityConfigDTO();
SummaryReportDTO summaryReport = new SummaryReportDTO();
summaryReport.setValues(Arrays.asList("Report1", "Report2", "Report3", "Report3", "Report4"));
summaryReport.setOrder(Arrays.asList("Report1", "Report2", "Report3", "Report3", "Report4"));
fishingActivityConfig.setSummaryReport(summaryReport);
activityConfigDTO.setFishingActivityConfig(fishingActivityConfig);
return activityConfigDTO;
}
use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class PreferenceConfigMapperTest method testMergeUserPreference.
@Test
public void testMergeUserPreference() {
ActivityConfigDTO merged = PreferenceConfigMapper.INSTANCE.mergeUserPreference(getTargetActivityConfigDTO(), getSourceActivityConfigDTO());
assertEquals(getSourceActivityConfigDTO().getFishingActivityConfig().getSummaryReport().getOrder(), merged.getFishingActivityConfig().getSummaryReport().getOrder());
assertEquals(getSourceActivityConfigDTO().getFishingActivityConfig().getSummaryReport().getValues(), merged.getFishingActivityConfig().getSummaryReport().getValues());
}
use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class PreferenceConfigMapperTest method testResetUserPreference.
@Test
public void testResetUserPreference() {
ActivityConfigDTO updated = PreferenceConfigMapper.INSTANCE.resetUserPreference(getTargetActivityConfigDTO(), getSourceActivityConfigDTO());
assertNotNull(updated.getFishingActivityConfig());
assertNull(updated.getFishingActivityConfig().getSummaryReport());
}
use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityConfigServiceBeanTest method testGetUserConfig.
@Test
public void testGetUserConfig() throws Exception {
ActivityConfigDTO userConfigDto = preferenceConfigService.getUserConfig(userConfig, adminConfig);
ActivityConfigDTO admin = getConfiguration(adminConfig);
ActivityConfigDTO user = getConfiguration(userConfig);
assertEquals(user.getFishingActivityConfig().getSummaryReport().getValues(), userConfigDto.getFishingActivityConfig().getSummaryReport().getValues());
assertEquals(user.getFishingActivityConfig().getSummaryReport().getOrder(), userConfigDto.getFishingActivityConfig().getSummaryReport().getOrder());
}
Aggregations