use of com.evolveum.midpoint.repo.sqale.qmodel.connector.MConnector in project midpoint by Evolveum.
the class SqaleRepoAddDeleteObjectTest method test811Connector.
@Test
public void test811Connector() throws Exception {
OperationResult result = createOperationResult();
given("connector");
String objectName = "conn" + getTestNumber();
UUID connectorHostOid = UUID.randomUUID();
QName connectorHostRelation = QName.valueOf("{https://random.org/ns}conn-host-rel");
ConnectorType connector = new ConnectorType(prismContext).name(objectName).connectorBundle("com.connector.package").connectorType("ConnectorTypeClass").connectorVersion("1.2.3").framework(SchemaConstants.UCF_FRAMEWORK_URI_BUILTIN).connectorHostRef(connectorHostOid.toString(), ConnectorHostType.COMPLEX_TYPE, connectorHostRelation).targetSystemType("type1").targetSystemType("type2");
when("adding it to the repository");
repositoryService.addObject(connector.asPrismObject(), null, result);
then("it is stored and relevant attributes are in columns");
assertThatOperationResult(result).isSuccess();
MConnector row = selectObjectByOid(QConnector.class, connector.getOid());
assertThat(row.connectorBundle).isEqualTo("com.connector.package");
assertThat(row.connectorType).isEqualTo("ConnectorTypeClass");
assertThat(row.connectorVersion).isEqualTo("1.2.3");
assertCachedUri(row.frameworkId, SchemaConstants.UCF_FRAMEWORK_URI_BUILTIN);
assertThat(row.connectorHostRefTargetOid).isEqualTo(connectorHostOid);
assertThat(row.connectorHostRefTargetType).isEqualTo(MObjectType.CONNECTOR_HOST);
assertCachedUri(row.connectorHostRefRelationId, connectorHostRelation);
assertThat(resolveCachedUriIds(row.targetSystemTypes)).containsExactlyInAnyOrder("type1", "type2");
}
use of com.evolveum.midpoint.repo.sqale.qmodel.connector.MConnector in project midpoint by Evolveum.
the class SqaleRepoAddDeleteObjectTest method test812ConnectorWithNullConnectorHost.
@Test
public void test812ConnectorWithNullConnectorHost() throws Exception {
OperationResult result = createOperationResult();
given("connector with no connector host reference");
String objectName = "conn" + getTestNumber();
ConnectorType connector = new ConnectorType(prismContext).name(objectName).connectorBundle("com.connector.package").connectorType("ConnectorTypeClass").connectorVersion("1.2.3").framework(SchemaConstants.UCF_FRAMEWORK_URI_BUILTIN);
when("adding it to the repository");
repositoryService.addObject(connector.asPrismObject(), null, result);
then("it is stored and with null connection host reference");
assertThatOperationResult(result).isSuccess();
MConnector row = selectObjectByOid(QConnector.class, connector.getOid());
assertThat(row.connectorHostRefTargetOid).isNull();
}
Aggregations