Skip to content

Commit edeab8f

Browse files
author
Caitlin Bales (MSFT)
committed
Use class resources for Planner instead of test resources
Planner takes some time to set up and tear down resources such as tasks and buckets, so we'll reuse the same items for each test in the suite.
1 parent 798206b commit edeab8f

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/test/java/com/microsoft/graph/functional/PlannerTests.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import com.google.gson.JsonElement;
66
import com.google.gson.JsonObject;
77
import com.google.gson.JsonPrimitive;
8-
import com.microsoft.graph.requests.extensions.IOnenoteRequestBuilder;
9-
import com.microsoft.graph.requests.extensions.IPlannerAssignedToTaskBoardTaskFormatRequest;
108
import com.microsoft.graph.requests.extensions.IPlannerBucketRequest;
119
import com.microsoft.graph.requests.extensions.IPlannerPlanDetailsRequest;
1210
import com.microsoft.graph.requests.extensions.IPlannerRequestBuilder;
@@ -28,26 +26,28 @@
2826
import com.microsoft.graph.serializer.AdditionalDataManager;
2927

3028
import org.junit.After;
29+
import org.junit.AfterClass;
3130
import org.junit.Before;
31+
import org.junit.BeforeClass;
3232
import org.junit.Ignore;
3333
import org.junit.Test;
3434
import static org.junit.Assert.*;
3535

3636
import java.util.Calendar;
3737
import java.util.UUID;
3838

39-
@Ignore
39+
//@Ignore
4040
public class PlannerTests {
41-
private TestBase testBase;
41+
private static TestBase testBase;
4242
// For now, you must specify a specific plan ID since the test cannot
4343
// clean up after itself
44-
private String planId = "ebJ1qqxlQUCwR4Osxm6TzWUAGpq6";
45-
private PlannerBucket planBucket;
46-
private PlannerTask planTask;
47-
private IPlannerRequestBuilder prb;
44+
private static String planId = "ebJ1qqxlQUCwR4Osxm6TzWUAGpq6";
45+
private static PlannerBucket planBucket;
46+
private static PlannerTask planTask;
47+
private static IPlannerRequestBuilder prb;
4848

49-
@Before
50-
public void setUp() {
49+
@BeforeClass
50+
public static void setUp() {
5151
testBase = new TestBase();
5252
prb = testBase.graphClient.planner();
5353

@@ -411,8 +411,8 @@ public void testDeleteBucket() {
411411
req.delete();
412412
}
413413

414-
@After
415-
public void tearDown() throws InterruptedException {
414+
@AfterClass
415+
public static void tearDown() throws InterruptedException {
416416

417417
Thread.sleep(4000);
418418

@@ -434,7 +434,7 @@ public void tearDown() throws InterruptedException {
434434
// planReq.delete();
435435
}
436436

437-
public String getEtag(JsonObject obj) {
437+
public static String getEtag(JsonObject obj) {
438438
String etag = obj.get("@odata.etag").toString();
439439
etag = etag.substring(1, etag.length()-1);
440440
etag = etag.replace("\\", "");;

0 commit comments

Comments
 (0)