Search in sources :

Example 1 with ModelFactory

use of org.xwiki.rest.internal.ModelFactory in project xwiki-platform by xwiki.

the class InstalledExtensionIndexTest method executeJob.

private void executeJob(String jobType, Request jobRequest) throws Exception {
    JobRequest request = AbstractTest.componentManager.<ModelFactory>getInstance(ModelFactory.class).toRestJobRequest(jobRequest);
    Map<String, Object[]> queryParameters = new HashMap<>();
    queryParameters.put("jobType", new Object[] { jobType });
    queryParameters.put("async", new Object[] { false });
    TestUtils.assertStatusCodes(getUtil().rest().executePut(JobsResource.class, request, queryParameters), true, TestUtils.STATUS_OK);
}
Also used : JobsResource(org.xwiki.rest.resources.job.JobsResource) JobRequest(org.xwiki.rest.model.jaxb.JobRequest) HashMap(java.util.HashMap) ModelFactory(org.xwiki.rest.internal.ModelFactory)

Aggregations

HashMap (java.util.HashMap)1 ModelFactory (org.xwiki.rest.internal.ModelFactory)1 JobRequest (org.xwiki.rest.model.jaxb.JobRequest)1 JobsResource (org.xwiki.rest.resources.job.JobsResource)1