use of com.microsoft.graph.models.PlannerAssignment in project msgraph-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateTask.
// https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/plannerAssignments
@Test
public void testUpdateTask() throws InterruptedException {
PlannerTask task = new PlannerTask();
User me = testBase.graphClient.me().buildRequest().get();
PlannerAssignment assignment = new PlannerAssignment();
assignment.orderHint = " !";
PlannerAssignments a2 = new PlannerAssignments();
a2.put(me.id, assignment);
task.assignments = a2;
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();
JsonElement createdAssignment = updatedTask.additionalDataManager().get("assignments").getAsJsonObject().get(me.id);
assertNotNull(createdAssignment);
}
use of com.microsoft.graph.models.PlannerAssignment in project msgraph-beta-sdk-java by microsoftgraph.
the class AdditionalDataTests method testHashMapChildAnnotationData.
@Test
public void testHashMapChildAnnotationData() {
PlannerTask task = new PlannerTask();
task.assignments = new PlannerAssignments();
PlannerAssignment assignment = new PlannerAssignment();
assignment.orderHint = "!";
assignment.additionalDataManager().put("additionalData", new JsonPrimitive("additionalValue"));
task.assignments.put("id", assignment);
String serializedObject = serializer.serializeObject(task);
assertEquals("{\"assignments\":{\"id\":{\"orderHint\":\"!\",\"additionalData\":\"additionalValue\"}}}", serializedObject);
}
use of com.microsoft.graph.models.PlannerAssignment in project msgraph-sdk-java by microsoftgraph.
the class AdditionalDataTests method testHashMapChildAnnotationData.
@Test
public void testHashMapChildAnnotationData() {
PlannerTask task = new PlannerTask();
task.assignments = new PlannerAssignments();
PlannerAssignment assignment = new PlannerAssignment();
assignment.orderHint = "!";
assignment.additionalDataManager().put("additionalData", new JsonPrimitive("additionalValue"));
task.assignments.put("id", assignment);
String serializedObject = serializer.serializeObject(task);
assertEquals("{\"assignments\":{\"id\":{\"orderHint\":\"!\",\"additionalData\":\"additionalValue\"}}}", serializedObject);
}
use of com.microsoft.graph.models.PlannerAssignment in project msgraph-beta-sdk-java by microsoftgraph.
the class PlannerTests method testUpdateTask.
// https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/plannerAssignments
@Test
public void testUpdateTask() throws InterruptedException {
PlannerTask task = new PlannerTask();
User me = testBase.graphClient.me().buildRequest().get();
PlannerAssignment assignment = new PlannerAssignment();
assignment.orderHint = " !";
PlannerAssignments a2 = new PlannerAssignments();
a2.put(me.id, assignment);
task.assignments = a2;
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();
JsonElement createdAssignment = updatedTask.additionalDataManager().get("assignments").getAsJsonObject().get(me.id);
assertNotNull(createdAssignment);
}
Aggregations