use of eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability in project UVMS-ExchangeModule-APP by UnionVMS.
the class MapperTest method testEntityAndModelToModel.
@Test
public void testEntityAndModelToModel() throws ExchangeDaoException, ExchangeDaoMappingException {
Service entity = MockData.getEntity(1);
List<ServiceCapability> capabilityList = new ArrayList<>();
entity.setServiceCapabilityList(capabilityList);
List<ServiceSetting> settingList = new ArrayList<>();
entity.setServiceSettingList(settingList);
// mockDaoToEntity();
ServiceType result = mapper.toServiceModel(entity);
assertSame(entity.getName(), result.getName());
assertSame(entity.getServiceClassName(), result.getServiceClassName());
}
use of eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability in project UVMS-ExchangeModule-APP by UnionVMS.
the class MapperTest method testEntityToModel.
// private void mockDaoToEntity() throws ExchangeDaoException {
// when(enumDao.getMyEntityEnum(any(MyEntityEnumSource.class))).thenReturn(MyEntityEnum.VALUE_1);
// }
@Test
public void testEntityToModel() throws ExchangeDaoException, ExchangeDaoMappingException {
Integer id = 1;
Service entity = MockData.getEntity(id);
List<ServiceCapability> capabilityList = new ArrayList<>();
entity.setServiceCapabilityList(capabilityList);
List<ServiceSetting> settingList = new ArrayList<>();
entity.setServiceSettingList(settingList);
// mockDaoToEntity();
ServiceType result = mapper.toServiceModel(entity);
assertSame(entity.getName(), result.getName());
assertSame(entity.getServiceClassName(), result.getServiceClassName());
}
use of eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability in project UVMS-ExchangeModule-APP by UnionVMS.
the class ServiceMapper method toCapabilityEntity.
private static ServiceCapability toCapabilityEntity(Service parent, CapabilityType capability, String username) {
ServiceCapability entity = new ServiceCapability();
entity.setService(parent);
entity.setCapability(capability.getType());
entity.setUpdatedBy(username);
entity.setUpdatedTime(DateUtils.nowUTC().toDate());
entity.setValue(capability.getValue());
return entity;
}
use of eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability in project UVMS-ExchangeModule-APP by UnionVMS.
the class DomainModelBeanTest method testCreateModel.
@Ignore
@Test
public void testCreateModel() throws ExchangeModelException, ExchangeDaoException, ExchangeDaoMappingException {
Long id = 1L;
ServiceType serviceType = MockData.getModel(id.intValue());
CapabilityListType capabilityListType = MockData.getCapabilityList();
SettingListType settingListType = MockData.getSettingList();
Service service = new Service();
service.setId(id);
service.setActive(false);
List<ServiceCapability> serviceCapabilityList = new ArrayList<>();
service.setServiceCapabilityList(serviceCapabilityList);
List<ServiceSetting> serviceSettingList = new ArrayList<>();
service.setServiceSettingList(serviceSettingList);
when(dao.getServiceByServiceClassName(any(String.class))).thenReturn(null);
// when(dao.updateService(any(Service.class))).thenReturn(service);
ServiceResponseType result = model.registerService(serviceType, capabilityListType, settingListType, "TEST");
// assertEquals(id.toString(), result.getId());
}
use of eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.ServiceCapability in project UVMS-ExchangeModule-APP by UnionVMS.
the class MockData method getEntityCapabilities.
public static List<ServiceCapability> getEntityCapabilities(Service parent) {
List<ServiceCapability> list = new ArrayList<>();
ServiceCapability capability = new ServiceCapability();
capability.setCapability(CapabilityTypeType.POLLABLE);
capability.setService(parent);
capability.setValue("TRUE");
list.add(capability);
return list;
}
Aggregations