use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityConfigServiceBeanTest method getConfiguration.
private ActivityConfigDTO getConfiguration(String configString) throws IOException {
if (configString == null || configString.isEmpty()) {
return new ActivityConfigDTO();
}
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
return mapper.readValue(configString, ActivityConfigDTO.class);
}
use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityConfigServiceBeanTest method testSaveAdminConfig.
@Test
public void testSaveAdminConfig() throws Exception {
ActivityConfigDTO adminConfigDto = getConfiguration(adminConfig);
String adminJson = preferenceConfigService.saveAdminConfig(adminConfigDto);
assertEquals(getJson(adminConfigDto), adminJson);
}
use of eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityConfigServiceBeanTest method TestGetAdminConfig.
@Test
public void TestGetAdminConfig() throws Exception {
ActivityConfigDTO source = getConfiguration(adminConfig);
ActivityConfigDTO adminConfigDto = preferenceConfigService.getAdminConfig(adminConfig);
assertEquals(source.getFishingActivityConfig().getSummaryReport().getValues(), adminConfigDto.getFishingActivityConfig().getSummaryReport().getValues());
assertEquals(source.getFishingActivityConfig().getSummaryReport().getOrder(), adminConfigDto.getFishingActivityConfig().getSummaryReport().getOrder());
}
Aggregations