Search in sources :

Example 11 with ActivityConfigDTO

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);
}
Also used : ActivityConfigDTO(eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 12 with ActivityConfigDTO

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);
}
Also used : ActivityConfigDTO(eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO) Test(org.junit.Test)

Example 13 with ActivityConfigDTO

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());
}
Also used : ActivityConfigDTO(eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO) Test(org.junit.Test)

Aggregations

ActivityConfigDTO (eu.europa.ec.fisheries.ers.service.dto.config.ActivityConfigDTO)13 Test (org.junit.Test)7 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 FishingActivityConfigDTO (eu.europa.ec.fisheries.ers.service.dto.config.FishingActivityConfigDTO)2 SummaryReportDTO (eu.europa.ec.fisheries.ers.service.dto.config.SummaryReportDTO)2 MapperUtil.getSourceActivityConfigDTO (eu.europa.ec.fisheries.ers.service.util.MapperUtil.getSourceActivityConfigDTO)2 MapperUtil.getTargetActivityConfigDTO (eu.europa.ec.fisheries.ers.service.util.MapperUtil.getTargetActivityConfigDTO)2 SneakyThrows (lombok.SneakyThrows)2