|
12 | 12 | import com.google.common.io.RecursiveDeleteOption;
|
13 | 13 | import com.palantir.websecurity.WebSecurityConfiguration;
|
14 | 14 | import io.dropwizard.db.DataSourceFactory;
|
| 15 | +import io.dropwizard.jetty.HttpConnectorFactory; |
| 16 | +import io.dropwizard.server.DefaultServerFactory; |
15 | 17 | import io.dropwizard.testing.DropwizardTestSupport;
|
16 | 18 | import java.io.IOException;
|
17 | 19 | import java.nio.file.Files;
|
18 | 20 | import java.nio.file.Path;
|
19 | 21 | import java.time.Instant;
|
| 22 | +import java.util.List; |
20 | 23 | import java.util.Map;
|
21 | 24 | import java.util.regex.Matcher;
|
22 | 25 | import java.util.regex.Pattern;
|
@@ -136,7 +139,19 @@ static void startApp() throws Exception {
|
136 | 139 | jophielConfig,
|
137 | 140 | sandalphonConfig,
|
138 | 141 | urielConfig,
|
139 |
| - jerahmeelConfig); |
| 142 | + jerahmeelConfig) { |
| 143 | + { |
| 144 | + DefaultServerFactory serverFactory = (DefaultServerFactory) getServerFactory(); |
| 145 | + |
| 146 | + HttpConnectorFactory appConnector = new HttpConnectorFactory(); |
| 147 | + appConnector.setPort(9090); |
| 148 | + serverFactory.setApplicationConnectors(List.of(appConnector)); |
| 149 | + |
| 150 | + HttpConnectorFactory adminConnector = new HttpConnectorFactory(); |
| 151 | + adminConnector.setPort(9091); |
| 152 | + serverFactory.setAdminConnectors(List.of(adminConnector)); |
| 153 | + } |
| 154 | + }; |
140 | 155 |
|
141 | 156 | support = new DropwizardTestSupport<>(JudgelsServerApplication.class, config);
|
142 | 157 | support.before();
|
@@ -171,9 +186,11 @@ protected static WebTarget createWebTarget() {
|
171 | 186 | }
|
172 | 187 |
|
173 | 188 | protected static <T> T createClient(Class<T> clientClass) {
|
174 |
| - return FeignClients.create( |
175 |
| - clientClass, |
176 |
| - "http://localhost:" + support.getLocalPort()); |
| 189 | + return FeignClients.create(clientClass, getLocalUrl()); |
| 190 | + } |
| 191 | + |
| 192 | + protected static String getLocalUrl() { |
| 193 | + return "http://localhost:" + support.getLocalPort(); |
177 | 194 | }
|
178 | 195 |
|
179 | 196 | protected static void assertPermitted(ThrowingCallable callable) {
|
|
0 commit comments