don't depend on ant tasks in tests
Original commit: elastic/x-pack-elasticsearch@ebbc490a2e
This commit is contained in:
parent
9380b5c050
commit
3543d7874b
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
package org.elasticsearch.integration;
|
||||
|
||||
import com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import org.apache.http.impl.client.CloseableHttpClient;
|
||||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.elasticsearch.http.HttpServerTransport;
|
||||
|
@ -44,19 +45,19 @@ public abstract class AbstractPrivilegeTests extends ShieldIntegrationTest {
|
|||
}
|
||||
|
||||
protected void assertAccessIsAllowed(String user, String method, String uri, String body) throws IOException {
|
||||
assertAccessIsAllowed(user, method, uri, body, Maps.newHashMap());
|
||||
assertAccessIsAllowed(user, method, uri, body, Maps.<String,String>newHashMap());
|
||||
}
|
||||
|
||||
protected void assertAccessIsAllowed(String user, String method, String uri) throws IOException {
|
||||
assertAccessIsAllowed(user, method, uri, null, Maps.newHashMap());
|
||||
assertAccessIsAllowed(user, method, uri, null, Maps.<String,String>newHashMap());
|
||||
}
|
||||
|
||||
protected void assertAccessIsDenied(String user, String method, String uri, String body) throws IOException {
|
||||
assertAccessIsDenied(user, method, uri, body, Maps.newHashMap());
|
||||
assertAccessIsDenied(user, method, uri, body, Maps.<String,String>newHashMap());
|
||||
}
|
||||
|
||||
protected void assertAccessIsDenied(String user, String method, String uri) throws IOException {
|
||||
assertAccessIsDenied(user, method, uri, null, Maps.newHashMap());
|
||||
assertAccessIsDenied(user, method, uri, null, Maps.<String,String>newHashMap());
|
||||
}
|
||||
|
||||
protected void assertAccessIsDenied(String user, String method, String uri, String body, Map<String, String> params) throws IOException {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
package org.elasticsearch.integration;
|
||||
|
||||
import com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.node.Node;
|
||||
|
@ -320,7 +320,7 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTests {
|
|||
|
||||
@Test
|
||||
public void testThatUnknownUserIsRejectedProperly() throws Exception {
|
||||
HttpResponse response = executeRequest("idonotexist", "GET", "/", null, Maps.newHashMap());
|
||||
HttpResponse response = executeRequest("idonotexist", "GET", "/", null, Maps.<String,String>newHashMap());
|
||||
assertThat(response.getStatusCode(), is(401));
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
*/
|
||||
package org.elasticsearch.shield.authc.support;
|
||||
|
||||
import com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.base.Charsets;
|
||||
import org.elasticsearch.test.ElasticsearchTestCase;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
public class SecuredStringTests extends ElasticsearchTestCase {
|
||||
|
@ -91,7 +92,7 @@ public class SecuredStringTests extends ElasticsearchTestCase {
|
|||
String password = "эластичный поиск-弾性検索";
|
||||
SecuredString securePass = new SecuredString(password.toCharArray());
|
||||
byte[] utf8 = securePass.utf8Bytes();
|
||||
String password2 = new String(utf8, Charsets.UTF_8);
|
||||
String password2 = new String(utf8, StandardCharsets.UTF_8);
|
||||
assertThat(password2, equalTo(password));
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
*/
|
||||
package org.elasticsearch.shield.transport;
|
||||
|
||||
import com.carrotsearch.ant.tasks.junit4.dependencies.com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||
import org.elasticsearch.common.transport.TransportAddress;
|
||||
|
|
Loading…
Reference in New Issue