@@ -110,16 +110,13 @@ void shouldHaveExpectedRequiredPermissions() {
110
110
111
111
@ Test
112
112
void shouldThrowIllegalStateExceptionOnUnknownNode () throws Exception {
113
- when (env .getGraphQlContext ()).thenReturn (graphCtx );
114
- when (auth .validateHttpHeader (Mockito .any (), Mockito .any (), Mockito .any ()))
115
- .thenReturn (CompletableFuture .completedFuture (true ));
116
-
117
113
UnknownNode source = Mockito .mock (UnknownNode .class );
118
114
119
115
when (env .getSource ()).thenReturn (source );
120
116
121
117
IllegalStateException ex =
122
- Assertions .assertThrows (IllegalStateException .class , () -> fetcher .get (env ));
118
+ Assertions .assertThrows (
119
+ IllegalStateException .class , () -> fetcher .getAuthenticated (env ));
123
120
MatcherAssert .assertThat (ex .getMessage (), Matchers .equalTo (source .getClass ().toString ()));
124
121
}
125
122
@@ -130,16 +127,14 @@ void shouldReturnSource() throws Exception {
130
127
HttpServerRequest req = Mockito .mock (HttpServerRequest .class );
131
128
when (ctx .request ()).thenReturn (req );
132
129
when (req .headers ()).thenReturn (MultiMap .caseInsensitiveMultiMap ());
133
- when (auth .validateHttpHeader (Mockito .any (), Mockito .any (), Mockito .any ()))
134
- .thenReturn (CompletableFuture .completedFuture (true ));
135
130
136
131
TargetNode source = Mockito .mock (TargetNode .class );
137
132
ServiceRef sr = new ServiceRef ("id1" , URI .create ("uri1" ), "alias1" );
138
133
when (source .getTarget ()).thenReturn (sr );
139
134
140
135
when (env .getSource ()).thenReturn (source );
141
136
142
- List <TargetNode > nodes = fetcher .get (env );
137
+ List <TargetNode > nodes = fetcher .getAuthenticated (env );
143
138
144
139
MatcherAssert .assertThat (nodes , Matchers .notNullValue ());
145
140
MatcherAssert .assertThat (nodes , Matchers .contains (source ));
@@ -155,7 +150,6 @@ void shouldReturnTargetNodes() throws Exception {
155
150
DataFetchingEnvironmentImpl .newDataFetchingEnvironment (
156
151
Mockito .any (DataFetchingEnvironment .class )))
157
152
.thenReturn (builder );
158
- when (env .getGraphQlContext ()).thenReturn (graphCtx );
159
153
when (graphCtx .get (RoutingContext .class )).thenReturn (ctx );
160
154
HttpServerRequest req = Mockito .mock (HttpServerRequest .class );
161
155
when (ctx .request ()).thenReturn (req );
@@ -213,7 +207,7 @@ void shouldReturnTargetNodes() throws Exception {
213
207
orphanNode ,
214
208
orphanNode );
215
209
216
- List <TargetNode > nodes = fetcher .get (env );
210
+ List <TargetNode > nodes = fetcher .getAuthenticated (env );
217
211
218
212
MatcherAssert .assertThat (nodes , Matchers .notNullValue ());
219
213
MatcherAssert .assertThat (
@@ -235,7 +229,6 @@ void shouldReturnTargetNodeFiltered() throws Exception {
235
229
staticFilter
236
230
.when (() -> FilterInput .from (Mockito .any (DataFetchingEnvironment .class )))
237
231
.thenReturn (filter );
238
- when (env .getGraphQlContext ()).thenReturn (graphCtx );
239
232
when (graphCtx .get (RoutingContext .class )).thenReturn (ctx );
240
233
HttpServerRequest req = Mockito .mock (HttpServerRequest .class );
241
234
when (ctx .request ()).thenReturn (req );
@@ -304,7 +297,7 @@ void shouldReturnTargetNodeFiltered() throws Exception {
304
297
orphanNode ,
305
298
orphanNode );
306
299
307
- List <TargetNode > nodes = fetcher .get (env );
300
+ List <TargetNode > nodes = fetcher .getAuthenticated (env );
308
301
309
302
MatcherAssert .assertThat (nodes , Matchers .notNullValue ());
310
303
MatcherAssert .assertThat (nodes , Matchers .containsInAnyOrder (orphanNode ));
0 commit comments