Skip to content

Commit 46332d8

Browse files
Migrate tests to JUnit5 (#117)
1 parent 144c093 commit 46332d8

File tree

6 files changed

+159
-182
lines changed

6 files changed

+159
-182
lines changed

pom.xml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,6 @@
124124
</dependency>
125125

126126
<!-- Test dependencies -->
127-
<dependency>
128-
<groupId>junit</groupId>
129-
<artifactId>junit</artifactId>
130-
<scope>test</scope>
131-
</dependency>
132-
<dependency>
133-
<groupId>org.junit.vintage</groupId>
134-
<artifactId>junit-vintage-engine</artifactId>
135-
<scope>test</scope>
136-
</dependency>
137127
<dependency>
138128
<groupId>org.springframework.boot</groupId>
139129
<artifactId>spring-boot-starter-test</artifactId>

src/main/java/org/gridsuite/gateway/endpoints/EndPointElementServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import org.springframework.http.HttpMethod;
1010

11-
import java.util.*;
11+
import java.util.Set;
1212

1313
import static org.springframework.http.HttpMethod.*;
1414

src/main/java/org/gridsuite/gateway/filters/TokenValidatorGlobalPreFilter.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.springframework.beans.factory.annotation.Value;
2626
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
2727
import org.springframework.core.Ordered;
28+
import org.springframework.http.HttpHeaders;
2829
import org.springframework.http.HttpStatus;
2930
import org.springframework.http.server.reactive.ServerHttpRequest;
3031
import org.springframework.stereotype.Component;
@@ -38,6 +39,7 @@
3839
import java.util.concurrent.ConcurrentHashMap;
3940

4041
import static org.gridsuite.gateway.GatewayConfig.HEADER_USER_ID;
42+
4143
//TODO add client_id
4244
//import static org.gridsuite.gateway.GatewayConfig.HEADER_CLIENT_ID;
4345

@@ -74,7 +76,7 @@ public int getOrder() {
7476
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
7577
LOGGER.debug("Filter : {}", getClass().getSimpleName());
7678
ServerHttpRequest req = exchange.getRequest();
77-
List<String> ls = req.getHeaders().get("Authorization");
79+
List<String> ls = req.getHeaders().get(HttpHeaders.AUTHORIZATION);
7880
List<String> queryls = req.getQueryParams().get("access_token");
7981

8082
if (ls == null && queryls == null) {

src/main/java/org/gridsuite/gateway/services/UserAdminService.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
package org.gridsuite.gateway.services;
88

99
import org.gridsuite.gateway.ServiceURIsConfig;
10-
import org.springframework.beans.factory.annotation.Autowired;
1110
import org.springframework.stereotype.Service;
1211
import org.springframework.web.reactive.function.client.WebClient;
1312
import reactor.core.publisher.Mono;
@@ -26,7 +25,6 @@ public class UserAdminService {
2625

2726
private final WebClient webClient;
2827

29-
@Autowired
3028
public UserAdminService(ServiceURIsConfig servicesURIsConfig, WebClient.Builder webClientBuilder) {
3129
this.webClient = webClientBuilder.baseUrl(servicesURIsConfig.getUserAdminServerBaseUri()).build();
3230
}

0 commit comments

Comments
 (0)