Elasticsearch Securemock

Allows creating mocks in tests without having to grant dangerous permissions to all of your code.

Лицензия

Лицензия

Категории

Категории

Search Прикладные библиотеки Elasticsearch
Группа

Группа

org.elasticsearch
Идентификатор

Идентификатор

securemock
Последняя версия

Последняя версия

1.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

Elasticsearch Securemock
Allows creating mocks in tests without having to grant dangerous permissions to all of your code.
Система контроля версий

Система контроля версий

https://github.com/elastic/securemock

Скачать securemock

Имя Файла Размер
securemock-1.2.pom
securemock-1.2.jar 1 MB
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.elasticsearch/securemock/ -->
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>securemock</artifactId>
    <version>1.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.elasticsearch/securemock/
implementation 'org.elasticsearch:securemock:1.2'
// https://jarcasting.com/artifacts/org.elasticsearch/securemock/
implementation ("org.elasticsearch:securemock:1.2")
'org.elasticsearch:securemock:jar:1.2'
<dependency org="org.elasticsearch" name="securemock" rev="1.2">
  <artifact name="securemock" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.elasticsearch', module='securemock', version='1.2')
)
libraryDependencies += "org.elasticsearch" % "securemock" % "1.2"
[org.elasticsearch/securemock "1.2"]

Зависимости

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11

Модули Проекта

Данный проект не имеет модулей.

securemock

Allows creating mocks in tests without having to grant dangerous permissions to all of your code.

This wraps the mockito api with AccessController blocks. No code changes are needed.

Instead of:

<dependency>
  <groupId>org.mockito</groupId>
  <artifactId>mockito-core</artifactId>
  <version>1.9.5</version>
  <scope>test</scope>
</dependency>
...
grant {
  // give scary permission to all code just for tests
  permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
  permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
  permission java.lang.RuntimePermission "reflectionFactoryAccess";
  permission java.lang.RuntimePermission "accessDeclaredMembers";
  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

You can do:

<dependency>
  <groupId>org.elasticsearch</groupId>
  <artifactId>securemock</artifactId>
  <version>1.2</version>
  <scope>test</scope>
</dependency>
...
grant codeBase "/url/to/securemock.jar" {
  // only allow this jar used in tests to do this
  permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect";
  permission java.lang.RuntimePermission "accessClassInPackage.sun.misc";
  permission java.lang.RuntimePermission "reflectionFactoryAccess";
  permission java.lang.RuntimePermission "accessDeclaredMembers";
  permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};
org.elasticsearch

elastic

Версии библиотеки

Версия
1.2
1.1
1.0