Skip to content

Commit a5a1628

Browse files
committed
Fix test
1 parent 8b0860f commit a5a1628

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
}

src/test/java/eu/openanalytics/containerproxy/test/proxy/TestIntegrationOnKube.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff 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

src/test/java/eu/openanalytics/containerproxy/test/proxy/TestProxyService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
import javax.inject.Inject;
2626

27+
import eu.openanalytics.containerproxy.service.UserService;
2728
import org.junit.Test;
2829
import org.junit.runner.RunWith;
2930
import 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 {

0 commit comments

Comments
 (0)