File tree Expand file tree Collapse file tree
src/test/java/eu/openanalytics/containerproxy/test/proxy Expand file tree Collapse file tree 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 {
699699 });
700700 }
701701
702- public static class MockedUserService extends UserService {
703- public String getCurrentUserId () {
704- return "jack" ;
705- }
706- }
707702
708703 public static class TestConfiguration {
709704 @ Bean
Original file line number Diff line number Diff line change 2424
2525import javax .inject .Inject ;
2626
27+ import eu .openanalytics .containerproxy .service .UserService ;
2728import org .junit .Test ;
2829import org .junit .runner .RunWith ;
2930import org .springframework .boot .test .context .SpringBootTest ;
@@ -68,6 +69,12 @@ public static class TestConfiguration {
6869 public ProxyMappingManager mappingManager () {
6970 return new NoopMappingManager ();
7071 }
72+
73+ @ Bean
74+ @ Primary
75+ public UserService mockedUserService () {
76+ return new MockedUserService ();
77+ }
7178 }
7279
7380 public static class NoopMappingManager extends ProxyMappingManager {
You can’t perform that action at this time.
0 commit comments