use of eu.europa.ec.fisheries.schema.config.types.v1.SettingType in project UVMS-ExchangeModule-APP by UnionVMS.
the class PluginServiceBean method putConfigSettingsInAMap.
private Map<String, SettingType> putConfigSettingsInAMap(List<eu.europa.ec.fisheries.schema.config.types.v1.SettingType> settings) {
Map<String, SettingType> settingTypeMap = new HashMap<>();
if (settings != null && !settings.isEmpty()) {
for (eu.europa.ec.fisheries.schema.config.types.v1.SettingType configSettingType : settings) {
SettingType type = new SettingType();
type.setKey(configSettingType.getKey());
type.setValue(configSettingType.getValue());
settingTypeMap.put(configSettingType.getKey(), type);
}
}
return settingTypeMap;
}
use of eu.europa.ec.fisheries.schema.config.types.v1.SettingType in project UVMS-ExchangeModule-APP by UnionVMS.
the class ServiceMapper method toModel.
public static SettingType toModel(ServiceSetting entity) {
SettingType type = new SettingType();
type.setKey(entity.getSetting());
type.setValue(entity.getValue());
return type;
}
use of eu.europa.ec.fisheries.schema.config.types.v1.SettingType in project UVMS-Docker by UnionVMS.
the class SettingsRestIT method createTestSettingType.
/**
* Creates the test setting type.
*
* @return the setting type
* @throws Exception the exception
*/
private SettingType createTestSettingType() throws Exception {
SettingsCreateQuery settingsCreateQuery = new SettingsCreateQuery();
settingsCreateQuery.setModuleName("audit");
SettingType settingType = new SettingType();
settingType.setDescription("SettingsRestIt" + UUID.randomUUID().toString());
settingType.setGlobal(false);
settingType.setKey("audit.key.SettingsRestIt." + UUID.randomUUID().toString());
settingType.setValue(UUID.randomUUID().toString());
settingsCreateQuery.setSetting(settingType);
final HttpResponse response = Request.Post(getBaseUrl() + "config/rest/settings").setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).bodyByteArray(writeValueAsString(settingsCreateQuery).getBytes()).execute().returnResponse();
Map<String, Object> dataMap = checkSuccessResponseReturnMap(response);
settingType.setId(Long.valueOf("" + dataMap.get("id")));
return settingType;
}
use of eu.europa.ec.fisheries.schema.config.types.v1.SettingType in project UVMS-Docker by UnionVMS.
the class SettingsRestIT method createTest.
/**
* Creates the test.
*
* @throws Exception the exception
*/
@Test
public void createTest() throws Exception {
SettingType settingType = createTestSettingType();
assertNotNull(settingType);
}
use of eu.europa.ec.fisheries.schema.config.types.v1.SettingType in project UVMS-Docker by UnionVMS.
the class SettingsRestIT method deleteTest.
/**
* Delete test.
*
* @throws Exception the exception
*/
@Test
public void deleteTest() throws Exception {
SettingType settingType = createTestSettingType();
assertNotNull(settingType);
final HttpResponse response = Request.Delete(getBaseUrl() + "config/rest/settings/" + settingType.getId()).setHeader("Content-Type", "application/json").setHeader("Authorization", getValidJwtToken()).execute().returnResponse();
Map<String, Object> dataMap = checkSuccessResponseReturnMap(response);
}
Aggregations