Search in sources :

Example 16 with ServiceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType in project midpoint by Evolveum.

the class SqaleRepoSearchTest method test911SearchByOidLowerThan.

// Following OID tests use services in one cost center, only OID conditions are of interest.
@Test
public void test911SearchByOidLowerThan() throws SchemaException {
    when("searching for objects with OID lower than");
    OperationResult operationResult = createOperationResult();
    SearchResultList<ServiceType> result = repositorySearchObjects(ServiceType.class, prismContext.queryFor(ServiceType.class).item(ServiceType.F_COST_CENTER).eq("OIDTEST").and().item(PrismConstants.T_ID).lt("00000000-1000-0000-0000-000000000000").build(), operationResult);
    then("user with OID lower than specified are returned");
    assertThatOperationResult(operationResult).isSuccess();
    assertThat(result).extracting(o -> o.getOid()).containsExactlyInAnyOrder();
}
Also used : QFocus(com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus) XmlTypeConverter.createXMLGregorianCalendar(com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) T_PARENT(com.evolveum.midpoint.prism.PrismConstants.T_PARENT) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest) F_VALID_FROM(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_FROM) OperationResultStatus(com.evolveum.midpoint.schema.result.OperationResultStatus) BigDecimal(java.math.BigDecimal) DOMUtil(com.evolveum.midpoint.util.DOMUtil) Assert(org.testng.Assert) F_ACTIVATION(com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType.F_ACTIVATION) ObjectTypeUtil(com.evolveum.midpoint.schema.util.ObjectTypeUtil) TestUtil(com.evolveum.midpoint.test.util.TestUtil) Assertions(org.assertj.core.api.Assertions) BigInteger(java.math.BigInteger) RepositoryService(com.evolveum.midpoint.repo.api.RepositoryService) MObjectType(com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) QAssignmentHolder(com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder) QObject(com.evolveum.midpoint.repo.sqale.qmodel.object.QObject) BeforeClass(org.testng.annotations.BeforeClass) ORG_DEFAULT(com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT) MiscUtil(com.evolveum.midpoint.util.MiscUtil) UUID(java.util.UUID) F_VALID_TO(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_TO) Instant(java.time.Instant) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) MiscUtil.asXMLGregorianCalendar(com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar) PolyStringItemFilterProcessor(com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor) List(java.util.List) ItemName(com.evolveum.midpoint.prism.path.ItemName) SchemaService(com.evolveum.midpoint.schema.SchemaService) SearchResultList(com.evolveum.midpoint.schema.SearchResultList) F_ASSIGNMENT(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType.F_ASSIGNMENT) SystemException(com.evolveum.midpoint.util.exception.SystemException) MObject(com.evolveum.midpoint.repo.sqale.qmodel.object.MObject) T_OBJECT_REFERENCE(com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE) QName(javax.xml.namespace.QName) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Example 17 with ServiceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType in project midpoint by Evolveum.

the class RService method toJAXB.

@Override
public ServiceType toJAXB(PrismContext prismContext, Collection<SelectorOptions<GetOperationOptions>> options) throws DtoTranslationException {
    ServiceType object = new ServiceType();
    RService.copyToJAXB(this, object, prismContext, options);
    RUtil.revive(object, prismContext);
    return object;
}
Also used : ServiceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType)

Example 18 with ServiceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType in project UVMS-ExchangeModule-APP by UnionVMS.

the class MapperTest method testEntityAndModelToEntity.

@Test
public void testEntityAndModelToEntity() throws ExchangeDaoException, ExchangeDaoMappingException {
    Integer id = 1;
    Service entity = MockData.getEntity(id);
    ServiceType service = MockData.getModel(1);
    CapabilityListType capabilityListType = MockData.getCapabilityList();
    SettingListType settingListType = MockData.getSettingList();
    // mockDaoToEntity();
    Service result = mapper.toServiceEntity(entity, service, capabilityListType, settingListType, "TEST");
    assertSame(entity.getName(), result.getName());
    assertSame(entity.getServiceClassName(), result.getServiceClassName());
}
Also used : CapabilityListType(eu.europa.ec.fisheries.schema.exchange.service.v1.CapabilityListType) ServiceType(eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceType) Service(eu.europa.ec.fisheries.uvms.exchange.entity.serviceregistry.Service) SettingListType(eu.europa.ec.fisheries.schema.exchange.service.v1.SettingListType) Test(org.junit.Test)

Example 19 with ServiceType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ServiceType in project midpoint by Evolveum.

the class SqaleRepoSearchTest method test915SearchByUpperCaseOidPrefixGoe.

@Test
public void test915SearchByUpperCaseOidPrefixGoe() throws SchemaException {
    when("searching for objects with upper-case OID prefix greater than or equal");
    OperationResult operationResult = createOperationResult();
    SearchResultList<ServiceType> result = repositorySearchObjects(ServiceType.class, prismContext.queryFor(ServiceType.class).item(ServiceType.F_COST_CENTER).eq("OIDTEST").and().item(PrismConstants.T_ID).ge("FF").build(), operationResult);
    then("user with OID greater than or equal to specified prefix ignoring case are returned");
    assertThatOperationResult(operationResult).isSuccess();
    assertThat(result).extracting(o -> o.getOid()).containsExactlyInAnyOrder("ff000000-0000-0000-0000-000000000000", "ffffffff-ffff-ffff-ffff-ffffffffffff");
}
Also used : QFocus(com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus) XmlTypeConverter.createXMLGregorianCalendar(com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) T_PARENT(com.evolveum.midpoint.prism.PrismConstants.T_PARENT) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest) F_VALID_FROM(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_FROM) OperationResultStatus(com.evolveum.midpoint.schema.result.OperationResultStatus) BigDecimal(java.math.BigDecimal) DOMUtil(com.evolveum.midpoint.util.DOMUtil) Assert(org.testng.Assert) F_ACTIVATION(com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType.F_ACTIVATION) ObjectTypeUtil(com.evolveum.midpoint.schema.util.ObjectTypeUtil) TestUtil(com.evolveum.midpoint.test.util.TestUtil) Assertions(org.assertj.core.api.Assertions) BigInteger(java.math.BigInteger) RepositoryService(com.evolveum.midpoint.repo.api.RepositoryService) MObjectType(com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) QAssignmentHolder(com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder) QObject(com.evolveum.midpoint.repo.sqale.qmodel.object.QObject) BeforeClass(org.testng.annotations.BeforeClass) ORG_DEFAULT(com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT) MiscUtil(com.evolveum.midpoint.util.MiscUtil) UUID(java.util.UUID) F_VALID_TO(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType.F_VALID_TO) Instant(java.time.Instant) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) MiscUtil.asXMLGregorianCalendar(com.evolveum.midpoint.util.MiscUtil.asXMLGregorianCalendar) PolyStringItemFilterProcessor(com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor) List(java.util.List) ItemName(com.evolveum.midpoint.prism.path.ItemName) SchemaService(com.evolveum.midpoint.schema.SchemaService) SearchResultList(com.evolveum.midpoint.schema.SearchResultList) F_ASSIGNMENT(com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentHolderType.F_ASSIGNMENT) SystemException(com.evolveum.midpoint.util.exception.SystemException) MObject(com.evolveum.midpoint.repo.sqale.qmodel.object.MObject) T_OBJECT_REFERENCE(com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE) QName(javax.xml.namespace.QName) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Aggregations

ServiceType (eu.europa.ec.fisheries.schema.exchange.service.v1.ServiceType)7 com.evolveum.midpoint.prism (com.evolveum.midpoint.prism)6 T_OBJECT_REFERENCE (com.evolveum.midpoint.prism.PrismConstants.T_OBJECT_REFERENCE)6 T_PARENT (com.evolveum.midpoint.prism.PrismConstants.T_PARENT)6 ItemName (com.evolveum.midpoint.prism.path.ItemName)6 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)6 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)6 XmlTypeConverter.createXMLGregorianCalendar (com.evolveum.midpoint.prism.xml.XmlTypeConverter.createXMLGregorianCalendar)6 RepositoryService (com.evolveum.midpoint.repo.api.RepositoryService)6 SqaleRepoBaseTest (com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)6 QFocus (com.evolveum.midpoint.repo.sqale.qmodel.focus.QFocus)6 MObject (com.evolveum.midpoint.repo.sqale.qmodel.object.MObject)6 MObjectType (com.evolveum.midpoint.repo.sqale.qmodel.object.MObjectType)6 QAssignmentHolder (com.evolveum.midpoint.repo.sqale.qmodel.object.QAssignmentHolder)6 QObject (com.evolveum.midpoint.repo.sqale.qmodel.object.QObject)6 PolyStringItemFilterProcessor (com.evolveum.midpoint.repo.sqlbase.filtering.item.PolyStringItemFilterProcessor)6 SchemaService (com.evolveum.midpoint.schema.SchemaService)6 SearchResultList (com.evolveum.midpoint.schema.SearchResultList)6 SchemaConstants (com.evolveum.midpoint.schema.constants.SchemaConstants)6 ORG_DEFAULT (com.evolveum.midpoint.schema.constants.SchemaConstants.ORG_DEFAULT)6