Search in sources :

Example 1 with MReportData

use of com.evolveum.midpoint.repo.sqale.qmodel.report.MReportData in project midpoint by Evolveum.

the class SqaleRepoAddDeleteObjectTest method test816ReportData.

@Test
public void test816ReportData() throws Exception {
    OperationResult result = createOperationResult();
    given("report data");
    String objectName = "report-data" + getTestNumber();
    UUID reportOid = UUID.randomUUID();
    QName reportRelation = QName.valueOf("{https://random.org/ns}report-rel");
    ReportDataType report = new ReportDataType(prismContext).name(objectName).reportRef(reportOid.toString(), ReportType.COMPLEX_TYPE, reportRelation);
    when("adding it to the repository");
    repositoryService.addObject(report.asPrismObject(), null, result);
    then("it is stored and relevant attributes are in columns");
    assertThatOperationResult(result).isSuccess();
    MReportData row = selectObjectByOid(QReportData.class, report.getOid());
    assertThat(row.reportRefTargetOid).isEqualTo(reportOid);
    assertThat(row.reportRefTargetType).isEqualTo(MObjectType.REPORT);
    assertCachedUri(row.reportRefRelationId, reportRelation);
}
Also used : QName(javax.xml.namespace.QName) MReportData(com.evolveum.midpoint.repo.sqale.qmodel.report.MReportData) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) UUID(java.util.UUID) Test(org.testng.annotations.Test) SqaleRepoBaseTest(com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)

Aggregations

PolyString (com.evolveum.midpoint.prism.polystring.PolyString)1 SqaleRepoBaseTest (com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)1 MReportData (com.evolveum.midpoint.repo.sqale.qmodel.report.MReportData)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 UUID (java.util.UUID)1 QName (javax.xml.namespace.QName)1 Test (org.testng.annotations.Test)1