use of com.microsoft.graph.models.extensions.PlannerBucket in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method setUp.
@BeforeClass
public static void setUp() {
testBase = new TestBase();
prb = testBase.graphClient.planner();
PlannerBucket newBucket = new PlannerBucket();
newBucket.name = "Test Bucket";
newBucket.planId = planId;
planBucket = prb.buckets().buildRequest().post(newBucket);
PlannerTask newTask = new PlannerTask();
newTask.title = "Test Task";
newTask.planId = planId;
newTask.bucketId = planBucket.id;
planTask = prb.tasks().buildRequest().post(newTask);
}
use of com.microsoft.graph.models.extensions.PlannerBucket 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);
IPlannerBucketRequest req = testBase.graphClient.planner().buckets(createdBucket.id).buildRequest();
req.addHeader("If-Match", createdBucket.etag);
req.delete();
}
use of com.microsoft.graph.models.extensions.PlannerBucket in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method tearDown.
@AfterClass
public static 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();
IPlannerTaskRequest taskReq = testBase.graphClient.planner().tasks(planTask.id).buildRequest();
taskReq.addHeader("If-Match", task.etag);
taskReq.delete();
PlannerBucket bucket = testBase.graphClient.planner().buckets(planBucket.id).buildRequest().get();
IPlannerBucketRequest bucketReq = testBase.graphClient.planner().buckets(planBucket.id).buildRequest();
bucketReq.addHeader("If-Match", bucket.etag);
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.models.extensions.PlannerBucket in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateBucket.
@Test
public void testUpdateBucket() {
PlannerBucket patchBucket = new PlannerBucket();
patchBucket.name = "RenamedBucket";
IPlannerBucketRequest req = prb.buckets(planBucket.id).buildRequest();
req.addHeader("If-Match", planBucket.etag);
req.patch(patchBucket);
PlannerBucket updatedBucket = prb.buckets(planBucket.id).buildRequest().get();
assertEquals(patchBucket.name, updatedBucket.name);
patchBucket.name = "Test Bucket";
IPlannerBucketRequest req2 = testBase.graphClient.planner().buckets(planBucket.id).buildRequest();
req2.addHeader("If-Match", updatedBucket.etag);
req2.patch(patchBucket);
}
use of com.microsoft.graph.models.extensions.PlannerBucket in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testCreateBucket.
@Test
public void testCreateBucket() {
PlannerBucket newBucket = new PlannerBucket();
newBucket.name = "Create Bucket Test";
newBucket.planId = planId;
PlannerBucket createdBucket = prb.buckets().buildRequest().post(newBucket);
assertEquals(newBucket.name, createdBucket.name);
}
Aggregations