Skip to content

Commit

Permalink
MID-8842 ninja - report data processor
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Jul 21, 2023
1 parent 3df1256 commit f10ad62
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.evolveum.midpoint.schema.validator.processor;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.schema.validator.UpgradeObjectProcessor;
import com.evolveum.midpoint.schema.validator.UpgradePhase;
import com.evolveum.midpoint.schema.validator.UpgradePriority;
import com.evolveum.midpoint.schema.validator.UpgradeType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportDataType;

@SuppressWarnings("unused")
public class ReportDataProcessor implements UpgradeObjectProcessor<ReportDataType> {

@Override
public UpgradePhase getPhase() {
return UpgradePhase.AFTER;
}

@Override
public UpgradePriority getPriority() {
return UpgradePriority.OPTIONAL;
}

@Override
public UpgradeType getType() {
return UpgradeType.SEAMLESS;
}

@Override
public boolean isApplicable(PrismObject<?> object, ItemPath path) {
return matchObjectTypeAndPathTemplate(object, path, ReportDataType.class, ReportDataType.F_DATA);
}

@Override
public boolean process(PrismObject<ReportDataType> object, ItemPath path) {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ public void test60TaskLivesync() throws Exception {
});
}

@Test
public void test70ReportData() throws Exception {
testUpgradeValidator("report-data.xml", result -> {
// todo assertts
});
}

private UpgradeValidationItem assertGetItem(UpgradeValidationResult result, String identifier) {
Assertions.assertThat(result).isNotNull();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<reportData xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
oid="0aa33685-8472-4b79-926b-aa23f9812711">
<filePath>/opt/sample.csv</filePath>
<fileFormat>csv</fileFormat>
<reportRef oid="56005636-352d-478e-a3e0-7a7669b93d09"/>
<nodeRef oid="e0195d3f-8a16-4a9e-b4ad-c77393c51cdc"/>
<data>asdf</data>
</reportData>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<reportData xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
oid="0aa33685-8472-4b79-926b-aa23f9812711">
<filePath>/opt/sample.csv</filePath>
<fileFormat>csv</fileFormat>
<reportRef oid="56005636-352d-478e-a3e0-7a7669b93d09"/>
<nodeRef oid="e0195d3f-8a16-4a9e-b4ad-c77393c51cdc"/>
<data>asdf</data>
</reportData>

0 comments on commit f10ad62

Please sign in to comment.