Skip to content

Commit 4e29015

Browse files
committed
- upgrades to junit 5 + upgrades dependencies
1 parent add85a3 commit 4e29015

21 files changed

+136
-134
lines changed

build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ java {
2222
withJavadocJar()
2323
}
2424

25+
test {
26+
useJUnitPlatform()
27+
}
28+
2529
sourceSets {
2630
main {
2731
java {

docs/upgrade-to-v3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ As the connection configuration evolved over time, the connection configuration
128128
### Dependencies upgrade
129129

130130
- OkHttpClient has been upgraded from 3.X to 4.9.0.
131-
- Google Guava has been upgraded from 20 to 29.
131+
- Google Guava has been upgraded from 20 to 30.
132132

133133
No action needs to be taken unless the project has a direct reference to an older version of those libraries, in which case the references need to be upgraded to match the versions listed here.
134134

gradle/dependencies.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
dependencies {
2-
implementation 'com.google.guava:guava:29.0-jre'
2+
implementation 'com.google.guava:guava:30.1-jre'
33

44
// Use JUnit test framework
5-
testImplementation 'junit:junit:4.13.1'
6-
testImplementation 'org.mockito:mockito-inline:3.6.0'
5+
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
6+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
7+
testImplementation 'org.mockito:mockito-inline:3.7.7'
78

89
api 'com.google.code.gson:gson:2.8.6'
910

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
<groupId>com.microsoft.graph</groupId>
1010
<artifactId>microsoft-graph</artifactId>
11-
<version>2.3.0</version>
11+
<version>3.0.0</version>
1212
<packaging>pom</packaging>
1313

1414
<dependencies>
1515
<dependency>
1616
<groupId>com.google.guava</groupId>
1717
<artifactId>guava</artifactId>
18-
<version>29.0-jre</version>
18+
<version>30.1-jre</version>
1919
</dependency>
2020
<dependency>
2121
<groupId>com.google.code.gson</groupId>
@@ -30,7 +30,7 @@
3030
<dependency>
3131
<groupId>com.microsoft.graph</groupId>
3232
<artifactId>microsoft-graph-core</artifactId>
33-
<version>1.0.5</version>
33+
<version>2.0.0</version>
3434
</dependency>
3535
</dependencies>
3636
</project>

src/test/java/com/microsoft/graph/conventions/DeltaLinks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.microsoft.graph.conventions;
22

3-
import static org.junit.Assert.assertNotNull;
3+
import static org.junit.jupiter.api.Assertions.assertNotNull;
44

55
import com.microsoft.graph.functional.TestBase;
66
import com.microsoft.graph.http.HttpMethod;
77

8-
import org.junit.Test;
8+
import org.junit.jupiter.api.Test;
99

1010
import okhttp3.Request;
1111

src/test/java/com/microsoft/graph/conventions/ParameterSets.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.microsoft.graph.conventions;
22

3-
import static org.junit.Assert.assertEquals;
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
44

55
import com.microsoft.graph.http.HttpMethod;
66
import com.microsoft.graph.functional.TestBase;
77
import com.microsoft.graph.models.ReportRootGetMailboxUsageStorageParameterSet;
88

9-
import org.junit.Test;
9+
import org.junit.jupiter.api.Test;
1010

1111
import okhttp3.Request;
1212

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.microsoft.graph.functional;
22

3-
import static org.junit.Assert.assertEquals;
4-
import static org.junit.Assert.assertNotNull;
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertNotNull;
55

66
import java.io.IOException;
77

@@ -13,17 +13,17 @@
1313
import com.microsoft.graph.models.User;
1414
import com.microsoft.graph.requests.UserRequest;
1515

16-
import org.junit.Before;
17-
import org.junit.Ignore;
18-
import org.junit.Test;
16+
import org.junit.jupiter.api.BeforeEach;
17+
import org.junit.jupiter.api.Disabled;
18+
import org.junit.jupiter.api.Test;
1919

2020
import okhttp3.MediaType;
2121
import okhttp3.OkHttpClient;
2222
import okhttp3.Request;
2323
import okhttp3.RequestBody;
2424
import okhttp3.Response;
2525

26-
@Ignore
26+
@Disabled
2727
public class BatchTests {
2828
@Test
2929
public void GetsABatchFromRequests() throws IOException{

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.microsoft.graph.functional;
22

3-
import static org.junit.Assert.assertNotNull;
3+
import static org.junit.jupiter.api.Assertions.assertNotNull;
44

55
import java.util.ArrayList;
66
import java.util.List;
77

8-
import org.junit.Before;
9-
import org.junit.Ignore;
10-
import org.junit.Test;
8+
import org.junit.jupiter.api.BeforeEach;
9+
import org.junit.jupiter.api.Disabled;
10+
import org.junit.jupiter.api.Test;
1111

1212
import com.microsoft.graph.models.Calendar;
1313
import com.microsoft.graph.models.Event;
@@ -18,11 +18,11 @@
1818
import com.microsoft.graph.options.Option;
1919
import com.microsoft.graph.options.QueryOption;
2020

21-
@Ignore
21+
@Disabled
2222
public class CalendarTests {
2323
GraphServiceClient graphServiceClient = null;
2424

25-
@Before
25+
@BeforeEach
2626
public void setUp() {
2727
TestBase testBase = new TestBase();
2828
graphServiceClient = testBase.graphClient;

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.microsoft.graph.functional;
22

3-
import static org.junit.Assert.assertEquals;
4-
import static org.junit.Assert.assertNotNull;
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertNotNull;
55

6-
import org.junit.Before;
7-
import org.junit.Ignore;
8-
import org.junit.Test;
6+
import org.junit.jupiter.api.BeforeEach;
7+
import org.junit.jupiter.api.Disabled;
8+
import org.junit.jupiter.api.Test;
99

1010
import com.google.gson.JsonObject;
1111
import com.google.gson.JsonParser;
@@ -17,11 +17,11 @@
1717
/**
1818
* Tests for sending custom requests using the SDK
1919
*/
20-
@Ignore
20+
@Disabled
2121
public class CustomRequestTests {
2222
private TestBase testBase;
2323

24-
@Before
24+
@BeforeEach
2525
public void setUp() {
2626
testBase = new TestBase();
2727
}

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package com.microsoft.graph.functional;
22

3-
import static org.junit.Assert.assertEquals;
4-
import static org.junit.Assert.assertNotNull;
3+
import static org.junit.jupiter.api.Assertions.assertEquals;
4+
import static org.junit.jupiter.api.Assertions.assertNotNull;
5+
import static org.junit.jupiter.api.Assertions.fail;
56

67
import java.util.ArrayList;
78
import java.util.List;
89

9-
import org.junit.Assert;
10-
import org.junit.Before;
11-
import org.junit.Ignore;
12-
import org.junit.Test;
10+
import org.junit.jupiter.api.BeforeEach;
11+
import org.junit.jupiter.api.Disabled;
12+
import org.junit.jupiter.api.Test;
1313

1414
import com.google.gson.JsonPrimitive;
1515
import com.microsoft.graph.models.Extension;
@@ -19,12 +19,12 @@
1919
import com.microsoft.graph.requests.GroupDeltaCollectionPage;
2020
import com.microsoft.graph.models.GroupDeltaParameterSet;
2121

22-
@Ignore
22+
@Disabled
2323
public class ODataTests {
2424

2525
private TestBase testBase;
2626

27-
@Before
27+
@BeforeEach
2828
public void setUp() {
2929
testBase = new TestBase();
3030

@@ -97,10 +97,10 @@ public void testSchemaExtensions() {
9797
}
9898
}
9999
if (!foundUpdatedProperty) {
100-
Assert.fail("Patch failed on Schema Extension");
100+
fail("Patch failed on Schema Extension");
101101
}
102102
} catch (Exception e) {
103-
Assert.fail("Patch failed on Schema Extension");
103+
fail("Patch failed on Schema Extension");
104104
} finally {
105105
testBase.graphClient.schemaExtensions(newExtension.id).buildRequest().delete();
106106
}

0 commit comments

Comments
 (0)