use of com.microsoft.graph.requests.PlannerBucketRequest in project msgraph-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.PlannerBucketRequest in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testDeleteBucket.
@Test
public void testDeleteBucket() {
PlannerBucket newBucket = new PlannerBucket();
newBucket.name = "Delete Me";
newBucket.planId = planId;
PlannerBucket createdBucket = testBase.graphClient.planner().buckets().buildRequest().post(newBucket);
PlannerBucketRequest req = testBase.graphClient.planner().buckets(createdBucket.id).buildRequest();
req.addHeader("If-Match", createdBucket.additionalDataManager().get("@odata.etag").getAsString());
req.delete();
}
use of com.microsoft.graph.requests.PlannerBucketRequest in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateBucket.
@Test
public void testUpdateBucket() {
PlannerBucket patchBucket = new PlannerBucket();
patchBucket.name = "RenamedBucket";
PlannerBucketRequest req = prb.buckets(planBucket.id).buildRequest();
req.addHeader("If-Match", planBucket.additionalDataManager().get("@odata.etag").getAsString());
req.patch(patchBucket);
PlannerBucket updatedBucket = prb.buckets(planBucket.id).buildRequest().get();
assertEquals(patchBucket.name, updatedBucket.name);
patchBucket.name = "Test Bucket";
PlannerBucketRequest req2 = testBase.graphClient.planner().buckets(planBucket.id).buildRequest();
req2.addHeader("If-Match", updatedBucket.additionalDataManager().get("@odata.etag").getAsString());
req2.patch(patchBucket);
}
use of com.microsoft.graph.requests.PlannerBucketRequest 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.PlannerBucketRequest in project msgraph-beta-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateBucket.
@Test
public void testUpdateBucket() {
PlannerBucket patchBucket = new PlannerBucket();
patchBucket.name = "RenamedBucket";
PlannerBucketRequest req = prb.buckets(planBucket.id).buildRequest();
req.addHeader("If-Match", planBucket.additionalDataManager().get("@odata.etag").getAsString());
req.patch(patchBucket);
PlannerBucket updatedBucket = prb.buckets(planBucket.id).buildRequest().get();
assertEquals(patchBucket.name, updatedBucket.name);
patchBucket.name = "Test Bucket";
PlannerBucketRequest req2 = testBase.graphClient.planner().buckets(planBucket.id).buildRequest();
req2.addHeader("If-Match", updatedBucket.additionalDataManager().get("@odata.etag").getAsString());
req2.patch(patchBucket);
}
Aggregations