Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 8758a6a

Browse files
authored
test dependencies update (#290)
* updating test dependencies
1 parent e193093 commit 8758a6a

3 files changed

Lines changed: 29 additions & 67 deletions

File tree

pom.xml

Lines changed: 23 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,29 @@
9595

9696
<!-- test dependencies -->
9797
<dependency>
98-
<groupId>org.testng</groupId>
99-
<artifactId>testng</artifactId>
100-
<version>6.8.8</version>
101-
<scope>test</scope>
102-
</dependency>
103-
<dependency>
104-
<groupId>org.powermock</groupId>
105-
<artifactId>powermock-module-testng</artifactId>
106-
<version>1.6.5</version>
107-
<scope>test</scope>
108-
</dependency>
109-
<dependency>
110-
<groupId>org.powermock</groupId>
111-
<artifactId>powermock-api-easymock</artifactId>
112-
<version>1.6.5</version>
113-
<scope>test</scope>
114-
</dependency>
115-
<dependency>
116-
<groupId>org.easymock</groupId>
117-
<artifactId>easymock</artifactId>
118-
<version>3.4</version>
119-
<scope>test</scope>
120-
</dependency>
121-
<dependency>
122-
<groupId>net.sourceforge.cobertura</groupId>
123-
<artifactId>cobertura</artifactId>
124-
<version>2.0.3</version>
125-
<scope>test</scope>
126-
<exclusions>
127-
<exclusion>
128-
<groupId>com.sun</groupId>
129-
<artifactId>tools</artifactId>
130-
</exclusion>
131-
</exclusions>
132-
</dependency>
98+
<groupId>org.testng</groupId>
99+
<artifactId>testng</artifactId>
100+
<version>7.1.0</version>
101+
<scope>test</scope>
102+
</dependency>
103+
<dependency>
104+
<groupId>org.powermock</groupId>
105+
<artifactId>powermock-module-testng</artifactId>
106+
<version>2.0.0</version>
107+
<scope>test</scope>
108+
</dependency>
109+
<dependency>
110+
<groupId>org.powermock</groupId>
111+
<artifactId>powermock-api-easymock</artifactId>
112+
<version>2.0.0</version>
113+
<scope>test</scope>
114+
</dependency>
115+
<dependency>
116+
<groupId>org.easymock</groupId>
117+
<artifactId>easymock</artifactId>
118+
<version>4.0.2</version>
119+
<scope>test</scope>
120+
</dependency>
133121
</dependencies>
134122

135123
<!-- force https -->
@@ -183,31 +171,6 @@
183171
<target>1.7</target>
184172
</configuration>
185173
</plugin>
186-
<plugin>
187-
<groupId>org.codehaus.mojo</groupId>
188-
<artifactId>cobertura-maven-plugin</artifactId>
189-
<version>2.6</version>
190-
<configuration>
191-
<instrumentation>
192-
<excludes>
193-
<exclude>*/*Test.class</exclude>
194-
</excludes>
195-
</instrumentation>
196-
<formats>
197-
<format>xml</format>
198-
<format>html</format>
199-
</formats>
200-
</configuration>
201-
<dependencies>
202-
<dependency>
203-
<groupId>com.sun</groupId>
204-
<artifactId>tools</artifactId>
205-
<version>1.6</version>
206-
<scope>system</scope>
207-
<systemPath>${tools-jar}</systemPath>
208-
</dependency>
209-
</dependencies>
210-
</plugin>
211174
<plugin>
212175
<groupId>org.apache.maven.plugins</groupId>
213176
<artifactId>maven-javadoc-plugin</artifactId>

src/test/java/com/microsoft/aad/adal4j/AdalOAuthRequestTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import static org.testng.Assert.assertNotNull;
2727

28+
import java.io.ByteArrayInputStream;
2829
import java.io.IOException;
2930
import java.io.InputStream;
3031
import java.net.HttpURLConnection;
@@ -33,7 +34,6 @@
3334

3435
import com.nimbusds.oauth2.sdk.http.HTTPRequest.Method;
3536
import com.nimbusds.oauth2.sdk.http.HTTPResponse;
36-
import org.apache.tools.ant.filters.StringInputStream;
3737
import org.easymock.EasyMock;
3838
import org.powermock.api.easymock.PowerMock;
3939
import org.powermock.core.classloader.annotations.PrepareForTest;
@@ -139,7 +139,9 @@ public void testCreateResponseFor404() throws Exception {
139139
.createMock(HttpURLConnection.class);
140140
EasyMock.expect(conn.getResponseCode()).andReturn(404);
141141
EasyMock.expect(conn.getErrorStream()).andReturn(null);
142-
InputStream stream = new StringInputStream("stream");
142+
143+
InputStream stream = new ByteArrayInputStream( "stream".getBytes() );
144+
143145
EasyMock.expect(conn.getInputStream()).andReturn(stream);
144146
PowerMock.replay(conn);
145147
final String response = Whitebox.invokeMethod(request,

src/test/java/com/microsoft/aad/adal4j/HttpHelperTest.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424
package com.microsoft.aad.adal4j;
2525

2626
import javax.net.ssl.HttpsURLConnection;
27-
import java.io.IOException;
27+
import java.io.ByteArrayInputStream;
2828
import java.io.InputStream;
2929
import java.io.StringReader;
3030
import java.net.URL;
3131

32-
import org.apache.tools.ant.util.ReaderInputStream;
3332
import org.easymock.EasyMock;
3433
import org.powermock.api.easymock.PowerMock;
3534
import org.testng.annotations.Test;
@@ -50,9 +49,7 @@ public void testReadResponseFromConnection_ResponseCodeNot200()
5049
EasyMock.expect(connection.getResponseCode()).andReturn(403).times(2);
5150
EasyMock.expect(connection.getURL()).andReturn(new URL("https://some.url"));
5251

53-
String testInput = "error info";
54-
StringReader reader = new StringReader(testInput);
55-
InputStream is = new ReaderInputStream(reader);
52+
InputStream is = new ByteArrayInputStream( "error info".getBytes() );
5653

5754
EasyMock.expect(connection.getErrorStream()).andReturn(is).times(1);
5855

0 commit comments

Comments
 (0)