use of com.microsoft.graph.requests.PlannerTaskRequest in project msgraph-beta-sdk-java by microsoftgraph.
the class PlannerTests method tearDown.
@AfterEach
public void tearDown() throws InterruptedException {
Thread.sleep(4000);
// This may have updated since we last saw it
PlannerTask task = testBase.graphClient.planner().tasks(planTask.id).buildRequest().get();
PlannerTaskRequest taskReq = testBase.graphClient.planner().tasks(planTask.id).buildRequest();
taskReq.addHeader("If-Match", task.additionalDataManager().get("@odata.etag").getAsString());
taskReq.delete();
PlannerBucket bucket = testBase.graphClient.planner().buckets(planBucket.id).buildRequest().get();
PlannerBucketRequest bucketReq = testBase.graphClient.planner().buckets(planBucket.id).buildRequest();
bucketReq.addHeader("If-Match", bucket.additionalDataManager().get("@odata.etag").getAsString());
bucketReq.delete();
// Fails with 403 Forbidden
// PlannerPlan plan = testBase.graphClient.getPlanner().getPlans(planId).buildRequest().get();
// IPlannerPlanRequest planReq = testBase.graphClient.getPlanner().getPlans(planId).buildRequest();
// planReq.addHeader("If-Match", getEtag(plan.getRawObject()));
// planReq.delete();
}
use of com.microsoft.graph.requests.PlannerTaskRequest in project msgraph-beta-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateTaskCompletion.
@Test
public void testUpdateTaskCompletion() throws InterruptedException {
PlannerTask task = new PlannerTask();
task.percentComplete = 50;
PlannerTaskRequest req = prb.tasks(planTask.id).buildRequest();
req.addHeader("If-Match", planTask.additionalDataManager().get("@odata.etag").getAsString());
req.patch(task);
Thread.sleep(4000);
PlannerTask updatedTask = prb.tasks(planTask.id).buildRequest().get();
assertEquals(task.percentComplete, updatedTask.percentComplete);
}
use of com.microsoft.graph.requests.PlannerTaskRequest in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateTaskCompletion.
@Test
public void testUpdateTaskCompletion() throws InterruptedException {
PlannerTask task = new PlannerTask();
task.percentComplete = 50;
PlannerTaskRequest req = prb.tasks(planTask.id).buildRequest();
req.addHeader("If-Match", planTask.additionalDataManager().get("@odata.etag").getAsString());
req.patch(task);
Thread.sleep(4000);
PlannerTask updatedTask = prb.tasks(planTask.id).buildRequest().get();
assertEquals(task.percentComplete, updatedTask.percentComplete);
}
use of com.microsoft.graph.requests.PlannerTaskRequest in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testDeleteTask.
@Test
public void testDeleteTask() {
PlannerTask newTask = new PlannerTask();
newTask.title = "Delete Me";
newTask.planId = planId;
newTask.bucketId = planBucket.id;
PlannerTask task = prb.tasks().buildRequest().post(newTask);
PlannerTaskRequest req = testBase.graphClient.planner().tasks(task.id).buildRequest();
req.addHeader("If-Match", task.additionalDataManager().get("@odata.etag").getAsString());
req.delete();
}
use of com.microsoft.graph.requests.PlannerTaskRequest in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateTaskStartDate.
@Test
public void testUpdateTaskStartDate() throws InterruptedException {
PlannerTask task = new PlannerTask();
task.startDateTime = OffsetDateTime.now();
PlannerTaskRequest req = prb.tasks(planTask.id).buildRequest();
req.addHeader("If-Match", planTask.additionalDataManager().get("@odata.etag").getAsString());
req.patch(task);
Thread.sleep(2000);
PlannerTask updatedTask = prb.tasks(planTask.id).buildRequest().get();
updatedTask = prb.tasks(planTask.id).buildRequest().get();
assertEquals(task.startDateTime, updatedTask.startDateTime);
}
Aggregations