File tree Expand file tree Collapse file tree 3 files changed +36
-5
lines changed
src/test/java/eu/openanalytics/containerproxy/test/proxy Expand file tree Collapse file tree 3 files changed +36
-5
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * ContainerProxy
3
+ *
4
+ * Copyright (C) 2016-2021 Open Analytics
5
+ *
6
+ * ===========================================================================
7
+ *
8
+ * This program is free software: you can redistribute it and/or modify
9
+ * it under the terms of the Apache License as published by
10
+ * The Apache Software Foundation, either version 2 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * Apache License for more details.
17
+ *
18
+ * You should have received a copy of the Apache License
19
+ * along with this program. If not, see <http://www.apache.org/licenses/>
20
+ */
21
+ package eu .openanalytics .containerproxy .test .proxy ;
22
+
23
+ import eu .openanalytics .containerproxy .service .UserService ;
24
+
25
+ public class MockedUserService extends UserService {
26
+ public String getCurrentUserId () {
27
+ return "jack" ;
28
+ }
29
+ }
Original file line number Diff line number Diff line change @@ -699,11 +699,6 @@ public void launchProxyWithExpressionInPatchAndManifests() throws Exception {
699
699
});
700
700
}
701
701
702
- public static class MockedUserService extends UserService {
703
- public String getCurrentUserId () {
704
- return "jack" ;
705
- }
706
- }
707
702
708
703
public static class TestConfiguration {
709
704
@ Bean
Original file line number Diff line number Diff line change 24
24
25
25
import javax .inject .Inject ;
26
26
27
+ import eu .openanalytics .containerproxy .service .UserService ;
27
28
import org .junit .Test ;
28
29
import org .junit .runner .RunWith ;
29
30
import org .springframework .boot .test .context .SpringBootTest ;
@@ -68,6 +69,12 @@ public static class TestConfiguration {
68
69
public ProxyMappingManager mappingManager () {
69
70
return new NoopMappingManager ();
70
71
}
72
+
73
+ @ Bean
74
+ @ Primary
75
+ public UserService mockedUserService () {
76
+ return new MockedUserService ();
77
+ }
71
78
}
72
79
73
80
public static class NoopMappingManager extends ProxyMappingManager {
You can’t perform that action at this time.
0 commit comments