Skip to content

Commit 91cc4a2

Browse files
committed
Small unit test fixes
1 parent 3f2ca5f commit 91cc4a2

2 files changed

Lines changed: 1 addition & 18 deletions

File tree

msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/AcquireTokenSilentlyTest.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@
1313
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
1414
import static org.mockito.Mockito.*;
1515

16-
import java.io.IOException;
17-
import java.net.URISyntaxException;
18-
import java.nio.file.Files;
19-
import java.nio.file.Paths;
2016
import java.util.Collections;
2117
import java.util.HashMap;
2218
import java.util.concurrent.CompletableFuture;
@@ -28,7 +24,7 @@
2824
class AcquireTokenSilentlyTest {
2925

3026
Account basicAccount = new Account("home_account_id", "login.windows.net", "username", null);
31-
String cache = readResource("/AAD_cache_data/full_cache.json");
27+
String cache = TestHelper.readResource(this.getClass(), "/AAD_cache_data/full_cache.json");
3228

3329
@Test
3430
void publicAppAcquireTokenSilently_emptyCache_MsalClientException() throws Throwable {
@@ -209,12 +205,4 @@ private void assertRefreshedToken(IAuthenticationResult result, String expectedT
209205
assertEquals(expectedToken, result.accessToken());
210206
assertEquals(expectedReason, result.metadata().cacheRefreshReason());
211207
}
212-
213-
String readResource(String resource) {
214-
try {
215-
return new String(Files.readAllBytes(Paths.get(getClass().getResource(resource).toURI())));
216-
} catch (IOException | URISyntaxException e) {
217-
throw new RuntimeException(e);
218-
}
219-
}
220208
}

msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/TelemetryTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ private class MyTelemetryConsumer {
3232
Consumer<List<HashMap<String, String>>> telemetryConsumer =
3333
(List<HashMap<String, String>> telemetryEvents) -> {
3434
eventsReceived.addAll(telemetryEvents);
35-
System.out.println("Received " + telemetryEvents.size() + " events");
36-
telemetryEvents.forEach(event -> {
37-
System.out.print("Event Name: " + event.get("event_name"));
38-
event.entrySet().forEach(entry -> System.out.println(" " + entry));
39-
});
4035
};
4136
}
4237

0 commit comments

Comments
 (0)