Skip to content

Commit

Permalink
Add isolated annotation and junit-platform properties file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Moary Chen committed Jun 21, 2021
1 parent 61ff332 commit 679a8cd
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.spring.autoconfigure.aad.AADAuthenticationProperties;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfiguration;
import org.springframework.boot.test.context.FilteredClassLoader;
Expand All @@ -24,6 +25,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

@Isolated
public class AADResourceServerClientConfigurationTest {

@EnableWebSecurity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import org.hamcrest.Matcher;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
import org.springframework.boot.test.context.runner.WebApplicationContextRunner;
import org.springframework.http.HttpEntity;
Expand All @@ -23,6 +24,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;

@Isolated
public class AADOAuth2AuthorizationCodeGrantRequestEntityConverterTest {

private AADWebAppClientRegistrationRepository clientRepo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.azure.spring.aad.AADAuthorizationServerEndpoints;
import com.azure.spring.autoconfigure.aad.AADAuthenticationProperties;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;
import org.springframework.security.oauth2.client.registration.ClientRegistration;
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
Expand All @@ -25,6 +26,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

@Isolated
public class AADWebAppConfigurationTest {

@Test
Expand Down Expand Up @@ -74,7 +76,7 @@ public void clientRegistered() {
azure.getProviderDetails().getAuthorizationUri());
assertEquals(endpoints.tokenEndpoint(), azure.getProviderDetails().getTokenUri());
assertEquals(endpoints.jwkSetEndpoint(), azure.getProviderDetails().getJwkSetUri());
assertEquals("{baseUrl}/login/oauth2/code/", azure.getRedirectUriTemplate());
assertEquals("{baseUrl}/login/oauth2/code/", azure.getRedirectUri());
assertDefaultScopes(azure, "openid", "profile");
});
}
Expand Down Expand Up @@ -146,8 +148,6 @@ public void clientWithClientCredentialsPermissions() {
.run(context -> {
AADWebAppClientRegistrationRepository repo =
context.getBean(AADWebAppClientRegistrationRepository.class);
ClientRegistration azure = repo.findByRegistrationId("azure");
ClientRegistration graph = repo.findByRegistrationId("graph");

assertEquals(repo.findByRegistrationId("azure").getAuthorizationGrantType(),
AuthorizationGrantType.AUTHORIZATION_CODE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package com.azure.spring.aad.webapp;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;
import org.springframework.boot.test.context.assertj.AssertableWebApplicationContext;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
Expand All @@ -24,6 +25,7 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

@Isolated
public class AuthorizedClientRepoTest {

private ClientRegistration azure;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;
import org.springframework.boot.context.properties.ConfigurationPropertiesBindException;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.context.properties.bind.validation.BindValidationException;
Expand All @@ -18,6 +19,7 @@

import static org.assertj.core.api.Assertions.assertThat;

@Isolated
public class CosmosPropertiesTest {

@Test
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
junit.jupiter.execution.parallel.enabled = true
junit.jupiter.execution.parallel.mode.default = concurrent
junit.jupiter.execution.parallel.mode.classes.default = concurrent

0 comments on commit 679a8cd

Please sign in to comment.