use of com.enonic.xp.node.NodeComparison in project xp by enonic.
the class ResolveSyncWorkResultMapper method serialize.
@Override
public void serialize(final MapGenerator gen) {
gen.array("diff");
for (final NodeComparison entry : result.getNodeComparisons()) {
gen.map();
gen.value("id", entry.getNodeId());
gen.value("status", entry.getCompareStatus().toString());
gen.end();
}
gen.end();
}
use of com.enonic.xp.node.NodeComparison in project xp by enonic.
the class PushNodeHandlerTest method testExampleWithChildren.
@Test
public void testExampleWithChildren() {
Mockito.when(nodeService.resolveSyncWork(Mockito.isA(SyncWorkResolverParams.class))).thenReturn(ResolveSyncWorkResult.create().add(new NodeComparison(createEntry("a"), createEntry("a"), CompareStatus.NEW)).add(new NodeComparison(createEntry("b", "a/b"), createEntry("b", "a/b"), CompareStatus.NEW)).add(new NodeComparison(createEntry("c", "a/b/c"), createEntry("c", "a/b/c"), CompareStatus.NEW)).build());
Mockito.when(nodeService.push(Mockito.eq(NodeIds.create().add(NodeId.from("a")).add(NodeId.from("b")).add(NodeId.from("c")).build()), Mockito.eq(Branch.from("otherBranch")))).thenReturn(PushNodesResult.create().addSuccess(createEntry("a")).addSuccess(createEntry("b")).addFailed(createEntry("c"), PushNodesResult.Reason.ACCESS_DENIED).build());
runScript("/lib/xp/examples/node/push-4.js");
}
Aggregations