Skip to content

Commit bbf4c24

Browse files
authored
DATAES-859 - No randomnumeric in tests.
Original PR: spring-projects#479
1 parent 407c8c6 commit bbf4c24

File tree

12 files changed

+306
-265
lines changed

12 files changed

+306
-265
lines changed

src/test/java/org/springframework/data/elasticsearch/NestedObjectTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
package org.springframework.data.elasticsearch;
1717

18-
import static org.apache.commons.lang.RandomStringUtils.*;
1918
import static org.assertj.core.api.Assertions.*;
2019
import static org.elasticsearch.index.query.QueryBuilders.*;
20+
import static org.springframework.data.elasticsearch.utils.IdGenerator.*;
2121

2222
import lombok.Data;
2323
import lombok.Getter;
@@ -343,10 +343,10 @@ public void shouldIndexAndSearchMapAsNestedType() {
343343
Book book1 = new Book();
344344
Book book2 = new Book();
345345

346-
book1.setId(randomNumeric(5));
346+
book1.setId(nextIdAsString());
347347
book1.setName("testBook1");
348348

349-
book2.setId(randomNumeric(5));
349+
book2.setId(nextIdAsString());
350350
book2.setName("testBook2");
351351

352352
Map<Integer, Collection<String>> map1 = new HashMap<>();

src/test/java/org/springframework/data/elasticsearch/core/ElasticsearchRestTemplateTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
*/
1616
package org.springframework.data.elasticsearch.core;
1717

18-
import static org.apache.commons.lang.RandomStringUtils.*;
1918
import static org.assertj.core.api.Assertions.*;
2019
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
20+
import static org.springframework.data.elasticsearch.utils.IdGenerator.*;
2121

2222
import lombok.Builder;
2323
import lombok.Data;
@@ -67,7 +67,7 @@ public void shouldThrowExceptionIfDocumentDoesNotExistWhileDoingPartialUpdate()
6767
// when
6868
org.springframework.data.elasticsearch.core.document.Document document = org.springframework.data.elasticsearch.core.document.Document
6969
.create();
70-
UpdateQuery updateQuery = UpdateQuery.builder(randomNumeric(5)).withDocument(document).build();
70+
UpdateQuery updateQuery = UpdateQuery.builder(nextIdAsString()).withDocument(document).build();
7171
assertThatThrownBy(() -> operations.update(updateQuery, index))
7272
.isInstanceOf(UncategorizedElasticsearchException.class);
7373
}

0 commit comments

Comments
 (0)