|
13 | 13 | import java.sql.Statement;
|
14 | 14 | import java.util.Properties;
|
15 | 15 |
|
16 |
| -import org.apache.commons.io.IOUtils; |
17 | 16 | import org.apache.commons.lang.RandomStringUtils;
|
18 |
| -import org.apache.http.client.methods.CloseableHttpResponse; |
19 |
| -import org.apache.http.client.methods.HttpPost; |
20 |
| -import org.apache.http.client.protocol.HttpClientContext; |
21 |
| -import org.apache.http.entity.BasicHttpEntity; |
22 |
| -import org.apache.http.impl.client.HttpClients; |
23 | 17 | import org.apache.shiro.authc.credential.DefaultPasswordService;
|
24 | 18 | import org.apache.shiro.config.Ini;
|
25 | 19 | import org.apache.stanbol.commons.testing.jarexec.JarExecutor;
|
@@ -105,16 +99,16 @@ public static String getServerBaseUrl() {
|
105 | 99 | return serverBaseUrl;
|
106 | 100 | }
|
107 | 101 |
|
108 |
| - public static CloseableHttpResponse authenticate(String username, String password, HttpClientContext httpClientContext) throws Exception { |
109 |
| - log.trace("Authenticating {}", username); |
110 |
| - HttpPost post = new HttpPost(BasilTestServer.getServerBaseUrl() + "/basil/auth/login"); |
111 |
| - post.addHeader("Content-type", "application/json"); |
112 |
| - BasicHttpEntity e = new BasicHttpEntity(); |
113 |
| - e.setContent(IOUtils.toInputStream("{username: \"" + username + "\", password: \"" |
114 |
| - + password + "\"}")); |
115 |
| - post.setEntity(e); |
116 |
| - return HttpClients.createDefault().execute(post, httpClientContext); |
117 |
| - } |
| 102 | +// public static CloseableHttpResponse authenticate(String username, String password, HttpClientContext httpClientContext) throws Exception { |
| 103 | +// log.trace("Authenticating {}", username); |
| 104 | +// HttpPost post = new HttpPost(BasilTestServer.getServerBaseUrl() + "/basil/auth/login"); |
| 105 | +// post.addHeader("Content-type", "application/json"); |
| 106 | +// BasicHttpEntity e = new BasicHttpEntity(); |
| 107 | +// e.setContent(IOUtils.toInputStream("{username: \"" + username + "\", password: \"" |
| 108 | +// + password + "\"}")); |
| 109 | +// post.setEntity(e); |
| 110 | +// return HttpClients.createDefault().execute(post, httpClientContext); |
| 111 | +// } |
118 | 112 |
|
119 | 113 | private static String createTestDb() throws Exception {
|
120 | 114 | log.info("Creating test db (once only)");
|
|
0 commit comments