code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
@Test // DATAES-628 public void shouldReturnTypedValueLong() { Document document = Document.create().append("string", "value").append("bool", true).append("int", 43) .append("long", 42L); assertThat(document.getLong("long")).isEqualTo(42); assertThat(document.getLongOrDefault("not-set", 44)).isEqualTo(44);...
Unit tests for {@link Document}. @author Mark Paluch
shouldReturnTypedValueLong
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
Apache-2.0
@Test // DATAES-628 public void shouldApplyTransformer() { Document document = Document.create(); document.setId("value"); assertThat(document.transform(Document::getId)).isEqualTo("value"); }
Unit tests for {@link Document}. @author Mark Paluch
shouldApplyTransformer
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
Apache-2.0
@Test // DATAES-628 public void shouldSetId() { Document document = Document.create(); assertThat(document.hasId()).isFalse(); assertThatIllegalStateException().isThrownBy(document::getId); document.setId("foo"); assertThat(document.getId()).isEqualTo("foo"); }
Unit tests for {@link Document}. @author Mark Paluch
shouldSetId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
Apache-2.0
@Test // DATAES-628 public void shouldSetVersion() { Document document = Document.create(); assertThat(document.hasVersion()).isFalse(); assertThatIllegalStateException().isThrownBy(document::getVersion); document.setVersion(14); assertThat(document.getVersion()).isEqualTo(14); }
Unit tests for {@link Document}. @author Mark Paluch
shouldSetVersion
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
Apache-2.0
@Test // DATAES-628 public void shouldRenderToString() { Document document = Document.from(Collections.singletonMap("key", "value")); document.setId("123"); document.setVersion(42); assertThat(document).hasToString("MapDocument@123#42 {\"key\":\"value\"}"); }
Unit tests for {@link Document}. @author Mark Paluch
shouldRenderToString
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/DocumentUnitTests.java
Apache-2.0
@Test @DisplayName("should have the connection info injected") void shouldHaveTheConnectionInfoInjected(ClusterConnectionInfo clusterConnectionInfo) { assertThat(clusterConnectionInfo).isNotNull(); }
Testing the setup and parameter injection of the CusterConnectionInfo. @author Peter-Josef Meisch
shouldHaveTheConnectionInfoInjected
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/JUnit5ClusterConnectionTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/JUnit5ClusterConnectionTests.java
Apache-2.0
@Test @DisplayName("should have an ElasticsearchTemplate") void shouldHaveAElasticsearchTemplate() { assertThat(elasticsearchOperations).isNotNull().isInstanceOf(ElasticsearchTemplate.class); }
class demonstrating the setup of a JUnit 5 test in Spring Data Elasticsearch that uses the new rest client. The ContextConfiguration must include the {@link ElasticsearchTemplateConfiguration} class. @author Peter-Josef Meisch @since 4.4
shouldHaveAElasticsearchTemplate
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/JUnit5SampleElasticsearchTemplateTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleElasticsearchTemplateTests.java
Apache-2.0
@Test @DisplayName("should have an ReactiveElasticsearchTemplate") void shouldHaveAElasticsearchTemplate() { assertThat(elasticsearchOperations).isNotNull().isInstanceOf(ReactiveElasticsearchTemplate.class); }
class demonstrating the setup of a reactive JUnit 5 test in Spring Data Elasticsearch that uses the new rest client. The ContextConfiguration must include the {@link ReactiveElasticsearchTemplateConfiguration} class. @author Peter-Josef Meisch @since 4.4
shouldHaveAElasticsearchTemplate
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/JUnit5SampleReactiveELCTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/JUnit5SampleReactiveELCTests.java
Apache-2.0
@BeforeEach public void before() { indexNameProvider.increment(); entityClasses.stream().map(operations::indexOps).forEach(IndexOperations::createWithMapping); }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
before
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test @Order(java.lang.Integer.MAX_VALUE) void cleanup() { operations.indexOps(IndexCoordinates.of(indexNameProvider.getPrefix() + "*")).delete(); }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
cleanup
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test public void shouldIndexInitialLevelNestedObject() { List<Car> cars = new ArrayList<>(); Car saturn = new Car(); saturn.setName("Saturn"); saturn.setModel("SL"); Car subaru = new Car(); subaru.setName("Subaru"); subaru.setModel("Imprezza"); Car ford = new Car(); ford.setName("Ford"); ford....
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
shouldIndexInitialLevelNestedObject
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test public void shouldIndexMultipleLevelNestedObject() { // given List<IndexQuery> indexQueries = createPerson(); // when operations.bulkIndex(indexQueries, PersonMultipleLevelNested.class); // then PersonMultipleLevelNested personIndexed = operations.get("1", PersonMultipleLevelNested.class); asser...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
shouldIndexMultipleLevelNestedObject
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test public void shouldIndexMultipleLevelNestedObjectWithIncludeInParent() { // given List<IndexQuery> indexQueries = createPerson(); // when operations.bulkIndex(indexQueries, PersonMultipleLevelNested.class); // then Map<String, Object> mapping = operations.indexOps(PersonMultipleLevelNested.class).g...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
shouldIndexMultipleLevelNestedObjectWithIncludeInParent
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test public void shouldSearchUsingNestedQueryOnMultipleLevelNestedObject() { // given List<IndexQuery> indexQueries = createPerson(); // when operations.bulkIndex(indexQueries, PersonMultipleLevelNested.class); // then Query searchQuery = getNestedQuery2(); SearchHits<PersonMultipleLevelNested> pers...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
shouldSearchUsingNestedQueryOnMultipleLevelNestedObject
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
private List<IndexQuery> createPerson() { PersonMultipleLevelNested person1 = new PersonMultipleLevelNested(); person1.setId("1"); person1.setName("name"); Car saturn = new Car(); saturn.setName("Saturn"); saturn.setModel("SL"); Car subaru = new Car(); subaru.setName("Subaru"); subaru.setModel("Im...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
createPerson
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test public void shouldSearchBooksForPersonInitialLevelNestedType() { // given var foo = getPerson(); Car car = new Car(); car.setName("Saturn"); car.setModel("Imprezza"); Person bar = new Person(); bar.setId("2"); bar.setName("Bar"); bar.setCar(Collections.singletonList(car)); List<IndexQuery...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
shouldSearchBooksForPersonInitialLevelNestedType
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
private static Person getPerson() { List<Car> cars = new ArrayList<>(); Car saturn = new Car(); saturn.setName("Saturn"); saturn.setModel("SL"); Car subaru = new Car(); subaru.setName("Subaru"); subaru.setModel("Imprezza"); Car ford = new Car(); ford.setName("Ford"); ford.setModel("Focus"); ca...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getPerson
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test // DATAES-73 public void shouldIndexAndSearchMapAsNestedType() { // given Book book1 = new Book(); Book book2 = new Book(); book1.setId(nextIdAsString()); book1.setName("testBook1"); book2.setId(nextIdAsString()); book2.setName("testBook2"); Map<Integer, Collection<String>> map1 = new HashMap...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
shouldIndexAndSearchMapAsNestedType
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test // #2952 @DisplayName("should handle null and empty field parameters in the mapping process") void shouldSupportMappingNullAndEmptyFieldParameter() { // Given operations.indexOps(MultiFieldWithNullEmptyParameters.class).createWithMapping(); List<IndexQuery> indexQueries = new ArrayList<>(); MultiFieldWi...
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
shouldSupportMappingNullAndEmptyFieldParameter
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getId() { return id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setId(@Nullable String id) { this.id = id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getName() { return name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setName(@Nullable String name) { this.name = name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public Author getAuthor() { return author; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getAuthor
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setAuthor(@Nullable Author author) { this.author = author; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setAuthor
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public Map<Integer, Collection<String>> getBuckets() { return buckets; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getBuckets
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setBuckets(@Nullable Map<Integer, Collection<String>> buckets) { this.buckets = buckets; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setBuckets
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getDescription() { return description; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getDescription
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setDescription(@Nullable String description) { this.description = description; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setDescription
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getId() { return id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setId(@Nullable String id) { this.id = id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getName() { return name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setName(@Nullable String name) { this.name = name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public List<Car> getCar() { return car; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getCar
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setCar(@Nullable List<Car> car) { this.car = car; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setCar
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public List<Book> getBooks() { return books; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getBooks
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setBooks(@Nullable List<Book> books) { this.books = books; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setBooks
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getName() { return name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setName(String name) { this.name = name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getModel() { return model; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getModel
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setModel(String model) { this.model = model; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setModel
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getId() { return id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setId(@Nullable String id) { this.id = id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getName() { return name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setName(@Nullable String name) { this.name = name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public List<GirlFriend> getGirlFriends() { return girlFriends; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getGirlFriends
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setGirlFriends(@Nullable List<GirlFriend> girlFriends) { this.girlFriends = girlFriends; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setGirlFriends
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public List<Car> getCars() { return cars; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getCars
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setCars(@Nullable List<Car> cars) { this.cars = cars; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setCars
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public List<Car> getBestCars() { return bestCars; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getBestCars
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setBestCars(@Nullable List<Car> bestCars) { this.bestCars = bestCars; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setBestCars
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getName() { return name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setName(@Nullable String name) { this.name = name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getType() { return type; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getType
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setType(@Nullable String type) { this.type = type; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setType
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public List<Car> getCars() { return cars; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getCars
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setCars(@Nullable List<Car> cars) { this.cars = cars; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setCars
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getId() { return id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setId(@Nullable String id) { this.id = id; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setId
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Nullable public String getName() { return name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public void setName(@Nullable String name) { this.name = name; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
setName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public List<String> getEmptyField() { if (emptyField == null) { emptyField = new ArrayList<>(); } return emptyField; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getEmptyField
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
public List<String> getFieldWithInner() { if (fieldWithInner == null) { fieldWithInner = new ArrayList<>(); } return fieldWithInner; }
@author Rizwan Idrees @author Mohsin Husen @author Artur Konczak @author Peter-Josef Meisch @author Mark Paluch
getFieldWithInner
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/NestedObjectIntegrationTests.java
Apache-2.0
@Test // DATAES-488 public void shouldCreateSimpleConfiguration() { ClientConfiguration clientConfiguration = ClientConfiguration.create("localhost:9200"); assertThat(clientConfiguration.getEndpoints()).containsOnly(InetSocketAddress.createUnresolved("localhost", 9200)); }
Unit tests for {@link ClientConfiguration}. @author Mark Paluch @author Peter-Josef Meisch @author Huw Ayling-Miller @author Henrique Amaral
shouldCreateSimpleConfiguration
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
Apache-2.0
@Test // DATAES-488, DATAES-504, DATAES-650, DATAES-700 public void shouldCreateCustomizedConfiguration() { HttpHeaders headers = new HttpHeaders(); headers.set("foo", "bar"); ClientConfiguration clientConfiguration = ClientConfiguration.builder() // .connectedTo("foo", "bar") // .usingSsl(true) // ...
Unit tests for {@link ClientConfiguration}. @author Mark Paluch @author Peter-Josef Meisch @author Huw Ayling-Miller @author Henrique Amaral
shouldCreateCustomizedConfiguration
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
Apache-2.0
@Test // DATAES-488, DATAES-504 public void shouldCreateSslConfiguration() { SSLContext sslContext = mock(SSLContext.class); ClientConfiguration clientConfiguration = ClientConfiguration.builder() // .connectedTo("foo", "bar") // .usingSsl(sslContext) // .build(); assertThat(clientConfiguration.ge...
Unit tests for {@link ClientConfiguration}. @author Mark Paluch @author Peter-Josef Meisch @author Huw Ayling-Miller @author Henrique Amaral
shouldCreateSslConfiguration
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
Apache-2.0
@Test // DATAES-607 public void shouldAddBasicAuthenticationHeaderWhenNoHeadersAreSet() { String username = "secretUser"; String password = "secretPassword"; ClientConfiguration clientConfiguration = ClientConfiguration.builder() // .connectedTo("foo", "bar") // .withBasicAuth(username, password) // ...
Unit tests for {@link ClientConfiguration}. @author Mark Paluch @author Peter-Josef Meisch @author Huw Ayling-Miller @author Henrique Amaral
shouldAddBasicAuthenticationHeaderWhenNoHeadersAreSet
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
Apache-2.0
@Test // DATAES-607 public void shouldAddBasicAuthenticationHeaderAndKeepHeaders() { String username = "secretUser"; String password = "secretPassword"; HttpHeaders defaultHeaders = new HttpHeaders(); defaultHeaders.set("foo", "bar"); ClientConfiguration clientConfiguration = ClientConfiguration.builder()...
Unit tests for {@link ClientConfiguration}. @author Mark Paluch @author Peter-Josef Meisch @author Huw Ayling-Miller @author Henrique Amaral
shouldAddBasicAuthenticationHeaderAndKeepHeaders
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
Apache-2.0
@Test // DATAES-673 public void shouldCreateSslConfigurationWithHostnameVerifier() { SSLContext sslContext = mock(SSLContext.class); ClientConfiguration clientConfiguration = ClientConfiguration.builder() // .connectedTo("foo", "bar") // .usingSsl(sslContext, NoopHostnameVerifier.INSTANCE) // .build(...
Unit tests for {@link ClientConfiguration}. @author Mark Paluch @author Peter-Josef Meisch @author Huw Ayling-Miller @author Henrique Amaral
shouldCreateSslConfigurationWithHostnameVerifier
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
Apache-2.0
@Test // #1885 @DisplayName("should use configured client configurer") void shouldUseConfiguredClientConfigurer() { AtomicInteger callCounter = new AtomicInteger(); ClientConfiguration clientConfiguration = ClientConfiguration.builder() // .connectedTo("foo", "bar") // .withClientConfigurer(clientConfig...
Unit tests for {@link ClientConfiguration}. @author Mark Paluch @author Peter-Josef Meisch @author Huw Ayling-Miller @author Henrique Amaral
shouldUseConfiguredClientConfigurer
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/ClientConfigurationUnitTests.java
Apache-2.0
@Test public void testFromStringWellFormed() { // Well-formed inputs. checkFromStringCase("pivotal.io", 80, "pivotal.io", 80, false); checkFromStringCase("pivotal.io", 80, "pivotal.io", 80, false); checkFromStringCase("192.0.2.1", 82, "192.0.2.1", 82, false); checkFromStringCase("[2001::1]", 84, "2001::1", 8...
Unit tests for {@link InetSocketAddressParser}. @author Mark Paluch
testFromStringWellFormed
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
Apache-2.0
@Test public void testFromStringBadDefaultPort() { // Well-formed strings with bad default ports. checkFromStringCase("gmail.com:81", -1, "gmail.com", 81, true); checkFromStringCase("192.0.2.2:83", -1, "192.0.2.2", 83, true); checkFromStringCase("[2001::2]:85", -1, "2001::2", 85, true); checkFromStringCase("...
Unit tests for {@link InetSocketAddressParser}. @author Mark Paluch
testFromStringBadDefaultPort
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
Apache-2.0
@Test public void testFromStringUnusedDefaultPort() { // Default port, but unused. checkFromStringCase("gmail.com:81", 77, "gmail.com", 81, true); checkFromStringCase("192.0.2.2:83", 77, "192.0.2.2", 83, true); checkFromStringCase("[2001::2]:85", 77, "2001::2", 85, true); }
Unit tests for {@link InetSocketAddressParser}. @author Mark Paluch
testFromStringUnusedDefaultPort
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
Apache-2.0
@Test public void testFromStringBadPort() { // Out-of-range ports. checkFromStringCase("pivotal.io:65536", 1, null, 99, false); checkFromStringCase("pivotal.io:9999999999", 1, null, 99, false); // Invalid port parts. checkFromStringCase("pivotal.io:port", 1, null, 99, false); checkFromStringCase("pivotal.i...
Unit tests for {@link InetSocketAddressParser}. @author Mark Paluch
testFromStringBadPort
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
Apache-2.0
@Test public void testFromStringUnparseableNonsense() { // Some nonsense that causes parse failures. checkFromStringCase("[goo.gl]", 1, null, 99, false); checkFromStringCase("[goo.gl]:80", 1, null, 99, false); checkFromStringCase("[", 1, null, 99, false); checkFromStringCase("[]:", 1, null, 99, false); che...
Unit tests for {@link InetSocketAddressParser}. @author Mark Paluch
testFromStringUnparseableNonsense
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
Apache-2.0
@Test public void testFromStringParseableNonsense() { // Examples of nonsense that gets through. checkFromStringCase("[[:]]", 86, "[:]", 86, false); checkFromStringCase("x:y:z", 87, "x:y:z", 87, false); checkFromStringCase("", 88, "", 88, false); checkFromStringCase(":", 99, "", 99, false); checkFromString...
Unit tests for {@link InetSocketAddressParser}. @author Mark Paluch
testFromStringParseableNonsense
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
Apache-2.0
private static void checkFromStringCase(String hpString, int defaultPort, String expectHost, int expectPort, boolean expectHasExplicitPort) { InetSocketAddress hp; try { hp = InetSocketAddressParser.parse(hpString, defaultPort); } catch (IllegalArgumentException e) { // Make sure we expected this. as...
Unit tests for {@link InetSocketAddressParser}. @author Mark Paluch
checkFromStringCase
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/InetSocketAddressParserUnitTests.java
Apache-2.0
@ParameterizedTest(name = "{0}") // DATAES-700 @MethodSource("clientUnderTestFactorySource") @DisplayName("should use configured proxy") void shouldUseConfiguredProxy(ClientUnderTestFactory clientUnderTestFactory, Hoverfly hoverfly) throws IOException { wireMockServer(server -> { // wiremock is the dummy serv...
We need hoverfly for testing the reactive code to use a proxy. Wiremock cannot intercept the proxy calls as WebClient uses HTTP CONNECT on proxy requests which wiremock does not support. <br/> Note: since 5.0 we do not use the WebClient for the reactive code anymore, so this might be handled with two wiremocks, but the...
shouldUseConfiguredProxy
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@ParameterizedTest(name = "{0}") // DATAES-801, DATAES-588 @MethodSource("clientUnderTestFactorySource") @DisplayName("should configure client and set all required headers") void shouldConfigureClientAndSetAllRequiredHeaders(ClientUnderTestFactory clientUnderTestFactory) { wireMockServer(server -> { HttpHeade...
We need hoverfly for testing the reactive code to use a proxy. Wiremock cannot intercept the proxy calls as WebClient uses HTTP CONNECT on proxy requests which wiremock does not support. <br/> Note: since 5.0 we do not use the WebClient for the reactive code anymore, so this might be handled with two wiremocks, but the...
shouldConfigureClientAndSetAllRequiredHeaders
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@ParameterizedTest // #2088 @MethodSource("clientUnderTestFactorySource") @DisplayName("should set compatibility headers") void shouldSetCompatibilityHeaders(ClientUnderTestFactory clientUnderTestFactory) { wireMockServer(server -> { String urlPattern = "^/index/_doc/42(\\?.*)?$"; stubFor(put(urlMatching(u...
We need hoverfly for testing the reactive code to use a proxy. Wiremock cannot intercept the proxy calls as WebClient uses HTTP CONNECT on proxy requests which wiremock does not support. <br/> Note: since 5.0 we do not use the WebClient for the reactive code anymore, so this might be handled with two wiremocks, but the...
shouldSetCompatibilityHeaders
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
private StubMapping stubForElasticsearchVersionCheck() { return stubFor(get(urlEqualTo("/")) // .willReturn(okJson(""" { "cluster_name": "docker-cluster", "cluster_uuid": "nKasrfHjRo6ge0eBmMUuAQ", "name": "c1a6e517d001", "tagline": "You Know, for Search", "v...
We need hoverfly for testing the reactive code to use a proxy. Wiremock cannot intercept the proxy calls as WebClient uses HTTP CONNECT on proxy requests which wiremock does not support. <br/> Note: since 5.0 we do not use the WebClient for the reactive code anymore, so this might be handled with two wiremocks, but the...
stubForElasticsearchVersionCheck
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
private StubMapping stubForHead() { return stubFor(head(urlEqualTo("/")) // .willReturn(ok() // .withHeader("X-Elastic-Product", "Elasticsearch"))); }
We need hoverfly for testing the reactive code to use a proxy. Wiremock cannot intercept the proxy calls as WebClient uses HTTP CONNECT on proxy requests which wiremock does not support. <br/> Note: since 5.0 we do not use the WebClient for the reactive code anymore, so this might be handled with two wiremocks, but the...
stubForHead
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override default void accept(WireMockServer wiremockConsumer) { try { acceptThrows(wiremockConsumer); } catch (final Exception e) { throw new RuntimeException(e); } }
Consumer extension that catches checked exceptions and wraps them in a RuntimeException.
accept
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
private void wireMockServer(WiremockConsumer consumer) { WireMockServer wireMockServer = new WireMockServer(options() // .dynamicPort() // .usingFilesUnderDirectory("src/test/resources/wiremock-mappings")); // needed, otherwise Wiremock goes to // test/resources/mappings try { wireMockServer.start(); ...
starts a Wiremock server and calls consumer with the server as argument. Stops the server after consumer execution. Before the consumer ids called the {@link #stubForHead()} and {@link #stubForElasticsearchVersionCheck()} are registered. @param consumer the consumer
wireMockServer
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override public String toString() { return getDisplayName(); }
base class to create {@link ClientUnderTest} implementations.
toString
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
protected Integer getExpectedRestClientConfigCalls() { return 0; }
base class to create {@link ClientUnderTest} implementations.
getExpectedRestClientConfigCalls
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override protected String getDisplayName() { return "ElasticsearchClient"; }
{@link ClientUnderTestFactory} implementation for the {@link co.elastic.clients.elasticsearch.ElasticsearchClient}.
getDisplayName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override protected Integer getExpectedRestClientConfigCalls() { return 1; }
{@link ClientUnderTestFactory} implementation for the {@link co.elastic.clients.elasticsearch.ElasticsearchClient}.
getExpectedRestClientConfigCalls
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override ClientUnderTest create(ClientConfiguration clientConfiguration) { ElasticsearchClient client = ElasticsearchClients.createImperative(clientConfiguration); return new ClientUnderTest() { @Override public boolean ping() throws Exception { return client.ping().value(); } @Override ...
{@link ClientUnderTestFactory} implementation for the {@link co.elastic.clients.elasticsearch.ElasticsearchClient}.
create
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override public boolean ping() throws Exception { return client.ping().value(); }
{@link ClientUnderTestFactory} implementation for the {@link co.elastic.clients.elasticsearch.ElasticsearchClient}.
ping
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override public boolean usesInitialRequest() { return false; }
{@link ClientUnderTestFactory} implementation for the {@link co.elastic.clients.elasticsearch.ElasticsearchClient}.
usesInitialRequest
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override public <T> void index(T entity) throws IOException { client.index(ir -> ir.index("index").id("42").document(entity)); }
{@link ClientUnderTestFactory} implementation for the {@link co.elastic.clients.elasticsearch.ElasticsearchClient}.
index
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override protected String getDisplayName() { return "ReactiveElasticsearchClient (ELC based)"; }
{@link ClientUnderTestFactory} implementation for the {@link ReactiveElasticsearchClient}.
getDisplayName
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override protected Integer getExpectedRestClientConfigCalls() { return 1; }
{@link ClientUnderTestFactory} implementation for the {@link ReactiveElasticsearchClient}.
getExpectedRestClientConfigCalls
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override ClientUnderTest create(ClientConfiguration clientConfiguration) { ReactiveElasticsearchClient client = ElasticsearchClients.createReactive(clientConfiguration); return new ClientUnderTest() { @Override public boolean ping() throws Exception { return Boolean.TRUE.equals(client.ping().map(...
{@link ClientUnderTestFactory} implementation for the {@link ReactiveElasticsearchClient}.
create
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override public boolean ping() throws Exception { return Boolean.TRUE.equals(client.ping().map(BooleanResponse::value).block()); }
{@link ClientUnderTestFactory} implementation for the {@link ReactiveElasticsearchClient}.
ping
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override public boolean usesInitialRequest() { return false; }
{@link ClientUnderTestFactory} implementation for the {@link ReactiveElasticsearchClient}.
usesInitialRequest
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@Override public <T> void index(T entity) throws IOException { client.index(ir -> ir.index("index").id("42").document(entity)).block(); }
{@link ClientUnderTestFactory} implementation for the {@link ReactiveElasticsearchClient}.
index
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
static Stream<ClientUnderTestFactory> clientUnderTestFactorySource() { return Stream.of( // new ELCUnderTestFactory(), // new ReactiveELCUnderTestFactory()); }
Provides the factories to use in the parameterized tests @return stream of factories
clientUnderTestFactorySource
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/RestClientsTest.java
Apache-2.0
@BeforeEach void setUp() { SimpleElasticsearchMappingContext mappingContext = new SimpleElasticsearchMappingContext(); mappingContext.setInitialEntitySet(Collections.singleton(Person.class)); mappingContext.afterPropertiesSet(); mappingElasticsearchConverter = new MappingElasticsearchConverter(mappingContext,...
Tests for the mapping of {@link CriteriaQuery} by a {@link MappingElasticsearchConverter}. In the same package as {@link org.springframework.data.elasticsearch.client.elc.CriteriaQueryProcessor} as this is needed to get the String representation to assert. @author Peter-Josef Meisch @author Sascha Woo @author vdisk
setUp
java
spring-projects/spring-data-elasticsearch
src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/src/test/java/org/springframework/data/elasticsearch/client/elc/CriteriaQueryMappingUnitTests.java
Apache-2.0