Revize cf12d561
Přidáno uživatelem Jakub Šmíd před asi 2 roky(ů)
backend/src/test/java/cz/zcu/kiv/backendapi/catalog/CatalogItemServiceImplTest.java | ||
---|---|---|
1 | 1 |
package cz.zcu.kiv.backendapi.catalog; |
2 | 2 |
|
3 |
import cz.zcu.kiv.backendapi.alternativename.AlternativeName;
|
|
3 |
import cz.zcu.kiv.backendapi.alternativename.CatalogItemName;
|
|
4 | 4 |
import cz.zcu.kiv.backendapi.bibliography.Bibliography; |
5 | 5 |
import cz.zcu.kiv.backendapi.country.Country; |
6 | 6 |
import cz.zcu.kiv.backendapi.exception.ApiRequestException; |
... | ... | |
50 | 50 |
|
51 | 51 |
CatalogItem catalogItem = new CatalogItem(); |
52 | 52 |
catalogItem.setName("aaacbbbbbbbaa"); |
53 |
catalogItem.setBibliography(Set.of(new Bibliography("bibl", catalogItem)));
|
|
54 |
catalogItem.setTypes(Set.of(type));
|
|
55 |
catalogItem.setAlternativeNames(Set.of(new AlternativeName("altName", catalogItem)));
|
|
56 |
catalogItem.setCountries(Set.of(new Country("aaaabbaa", catalogItem)));
|
|
57 |
catalogItem.setWrittenForms(Set.of(new WrittenForm("written", catalogItem)));
|
|
53 |
catalogItem.setBibliography(Stream.of(new Bibliography("bibl", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
54 |
catalogItem.setTypes(Stream.of(type).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
55 |
catalogItem.setAllNames(Stream.of(new CatalogItemName("altName", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
56 |
catalogItem.setCountries(Stream.of(new Country("aaaabbaa", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
57 |
catalogItem.setWrittenForms(Stream.of(new WrittenForm("written", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
58 | 58 |
catalogItem.setCertainty(0); |
59 | 59 |
catalogItem.setLatitude(0.1); |
60 | 60 |
catalogItem.setLongitude(0.2); |
61 | 61 |
|
62 | 62 |
CatalogItem catalogItem2 = new CatalogItem(); |
63 | 63 |
catalogItem2.setName("name"); |
64 |
catalogItem2.setBibliography(Set.of(new Bibliography("bibl", catalogItem2)));
|
|
65 |
catalogItem2.setTypes(Set.of(type));
|
|
66 |
catalogItem2.setAlternativeNames(Set.of(new AlternativeName("aaaabbbbbbaa", catalogItem2)));
|
|
67 |
catalogItem2.setCountries(Set.of(new Country("aaaabbcccefaa", catalogItem2)));
|
|
68 |
catalogItem2.setWrittenForms(Set.of(new WrittenForm("written", catalogItem2)));
|
|
64 |
catalogItem2.setBibliography(Stream.of(new Bibliography("bibl", catalogItem2, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
65 |
catalogItem2.setTypes(Stream.of(type).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
66 |
catalogItem2.setAllNames(Stream.of(new CatalogItemName("aaaabbbbbbaa", catalogItem2, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
67 |
catalogItem2.setCountries(Stream.of(new Country("aaaabbcccefaa", catalogItem2, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
68 |
catalogItem2.setWrittenForms(Stream.of(new WrittenForm("written", catalogItem2, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
69 | 69 |
catalogItem2.setCertainty(1); |
70 | 70 |
catalogItem2.setLatitude(1.1); |
71 | 71 |
catalogItem2.setLongitude(1.2); |
... | ... | |
88 | 88 |
// given |
89 | 89 |
CatalogItemDto catalogItemDto = new CatalogItemDto(); |
90 | 90 |
catalogItemDto.setName("name"); |
91 |
catalogItemDto.setBibliography(Stream.of("bibl").collect(Collectors.toSet()));
|
|
92 |
catalogItemDto.setTypes(Stream.of("type").collect(Collectors.toSet()));
|
|
93 |
catalogItemDto.setAlternativeNames(Stream.of("altName").collect(Collectors.toSet()));
|
|
94 |
catalogItemDto.setCountries(Stream.of("country").collect(Collectors.toSet()));
|
|
95 |
catalogItemDto.setWrittenForms(Stream.of("written").collect(Collectors.toSet()));
|
|
91 |
catalogItemDto.setBibliography(Stream.of("bibl").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
92 |
catalogItemDto.setTypes(Stream.of("type").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
93 |
catalogItemDto.setAllNames(Stream.of("altName").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
94 |
catalogItemDto.setCountries(Stream.of("country").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
95 |
catalogItemDto.setWrittenForms(Stream.of("written").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
96 | 96 |
catalogItemDto.setCertainty(0); |
97 | 97 |
catalogItemDto.setLatitude(0.1); |
98 | 98 |
catalogItemDto.setLongitude(0.2); |
... | ... | |
102 | 102 |
|
103 | 103 |
CatalogItem catalogItem = new CatalogItem(); |
104 | 104 |
catalogItem.setName("name"); |
105 |
catalogItem.setBibliography(Stream.of(new Bibliography("bibl", catalogItem)).collect(Collectors.toSet()));
|
|
106 |
catalogItem.setTypes(Stream.of(type).collect(Collectors.toSet()));
|
|
107 |
catalogItem.setAlternativeNames(Stream.of(new AlternativeName("altName", catalogItem), new AlternativeName("name", catalogItem)).collect(Collectors.toSet()));
|
|
108 |
catalogItem.setCountries(Stream.of(new Country("country", catalogItem)).collect(Collectors.toSet()));
|
|
109 |
catalogItem.setWrittenForms(Stream.of(new WrittenForm("written", catalogItem)).collect(Collectors.toSet()));
|
|
105 |
catalogItem.setBibliography(Stream.of(new Bibliography("bibl", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
106 |
catalogItem.setTypes(Stream.of(type).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
107 |
catalogItem.setAllNames(Stream.of(new CatalogItemName("altName", catalogItem, 1), new CatalogItemName("name", catalogItem, 2)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
108 |
catalogItem.setCountries(Stream.of(new Country("country", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
109 |
catalogItem.setWrittenForms(Stream.of(new WrittenForm("written", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
110 | 110 |
catalogItem.setCertainty(0); |
111 | 111 |
catalogItem.setLatitude(0.1); |
112 | 112 |
catalogItem.setLongitude(0.2); |
... | ... | |
129 | 129 |
assertThat(capturedItem.getLongitude()).isEqualTo(catalogItem.getLongitude()); |
130 | 130 |
assertThat(capturedItem.getLatitude()).isEqualTo(catalogItem.getLatitude()); |
131 | 131 |
assertThat(capturedItem.getCertainty()).isEqualTo(catalogItem.getCertainty()); |
132 |
assertThat(capturedItem.getAlternativeNames().size()).isEqualTo(catalogItem.getAlternativeNames().size());
|
|
132 |
assertThat(capturedItem.getAllNames().size()).isEqualTo(catalogItem.getAllNames().size());
|
|
133 | 133 |
assertThat(capturedItem.getBibliography().size()).isEqualTo(catalogItem.getBibliography().size()); |
134 | 134 |
assertThat(capturedItem.getCountries().size()).isEqualTo(catalogItem.getCountries().size()); |
135 | 135 |
assertThat(capturedItem.getWrittenForms().size()).isEqualTo(catalogItem.getWrittenForms().size()); |
... | ... | |
177 | 177 |
|
178 | 178 |
CatalogItemDto catalogItemDto = new CatalogItemDto(); |
179 | 179 |
catalogItemDto.setName("name"); |
180 |
catalogItemDto.setBibliography(Stream.of("bibl").collect(Collectors.toSet()));
|
|
181 |
catalogItemDto.setTypes(Stream.of("type").collect(Collectors.toSet()));
|
|
182 |
catalogItemDto.setAlternativeNames(Stream.of("altName").collect(Collectors.toSet()));
|
|
183 |
catalogItemDto.setCountries(Stream.of("country").collect(Collectors.toSet()));
|
|
184 |
catalogItemDto.setWrittenForms(Stream.of("written").collect(Collectors.toSet()));
|
|
180 |
catalogItemDto.setBibliography(Stream.of("bibl").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
181 |
catalogItemDto.setTypes(Stream.of("type").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
182 |
catalogItemDto.setAllNames(Stream.of("altName").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
183 |
catalogItemDto.setCountries(Stream.of("country").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
184 |
catalogItemDto.setWrittenForms(Stream.of("written").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
185 | 185 |
catalogItemDto.setCertainty(0); |
186 | 186 |
catalogItemDto.setLatitude(0.1); |
187 | 187 |
catalogItemDto.setLongitude(0.2); |
... | ... | |
193 | 193 |
CatalogItem catalogItem = new CatalogItem(); |
194 | 194 |
catalogItem.setId(id); |
195 | 195 |
catalogItem.setName("name"); |
196 |
catalogItem.setBibliography(Stream.of(new Bibliography("bibl", catalogItem)).collect(Collectors.toSet()));
|
|
197 |
catalogItem.setTypes(Stream.of(type).collect(Collectors.toSet()));
|
|
198 |
catalogItem.setAlternativeNames(Stream.of(new AlternativeName("altName", catalogItem)).collect(Collectors.toSet()));
|
|
199 |
catalogItem.setCountries(Stream.of(new Country("country", catalogItem)).collect(Collectors.toSet()));
|
|
200 |
catalogItem.setWrittenForms(Stream.of(new WrittenForm("written", catalogItem)).collect(Collectors.toSet()));
|
|
196 |
catalogItem.setBibliography(Stream.of(new Bibliography("bibl", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
197 |
catalogItem.setTypes(Stream.of(type).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
198 |
catalogItem.setAllNames(Stream.of(new CatalogItemName("altName", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
199 |
catalogItem.setCountries(Stream.of(new Country("country", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
200 |
catalogItem.setWrittenForms(Stream.of(new WrittenForm("written", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
201 | 201 |
catalogItem.setCertainty(0); |
202 | 202 |
catalogItem.setLatitude(0.1); |
203 | 203 |
catalogItem.setLongitude(0.2); |
... | ... | |
206 | 206 |
CatalogItem oldCatalogItem = new CatalogItem(); |
207 | 207 |
oldCatalogItem.setId(id); |
208 | 208 |
oldCatalogItem.setName("old"); |
209 |
oldCatalogItem.setBibliography(Stream.of(new Bibliography("old", oldCatalogItem)).collect(Collectors.toSet()));
|
|
210 |
oldCatalogItem.setTypes(Stream.of(typeOld).collect(Collectors.toSet()));
|
|
211 |
oldCatalogItem.setAlternativeNames(Stream.of(new AlternativeName("old", oldCatalogItem)).collect(Collectors.toSet()));
|
|
212 |
oldCatalogItem.setCountries(Stream.of(new Country("old", oldCatalogItem)).collect(Collectors.toSet()));
|
|
213 |
oldCatalogItem.setWrittenForms(Stream.of(new WrittenForm("old", catalogItem)).collect(Collectors.toSet()));
|
|
209 |
oldCatalogItem.setBibliography(Stream.of(new Bibliography("old", oldCatalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
210 |
oldCatalogItem.setTypes(Stream.of(typeOld).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
211 |
oldCatalogItem.setAllNames(Stream.of(new CatalogItemName("old", oldCatalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
212 |
oldCatalogItem.setCountries(Stream.of(new Country("old", oldCatalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
213 |
oldCatalogItem.setWrittenForms(Stream.of(new WrittenForm("old", catalogItem, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
214 | 214 |
oldCatalogItem.setCertainty(10); |
215 | 215 |
oldCatalogItem.setLatitude(10.1); |
216 | 216 |
oldCatalogItem.setLongitude(10.2); |
... | ... | |
236 | 236 |
assertThat(capturedCatalogItem.getLatitude()).isEqualTo(catalogItem.getLatitude()); |
237 | 237 |
assertThat(capturedCatalogItem.getLongitude()).isEqualTo(catalogItem.getLongitude()); |
238 | 238 |
assertThat(capturedCatalogItem.getDescription()).isEqualTo(catalogItem.getDescription()); |
239 |
assertThat(capturedCatalogItem.getTypes().stream().map(Type::getType).collect(Collectors.toSet())).isEqualTo(catalogItem.getTypes().stream().map(Type::getType).collect(Collectors.toSet()));
|
|
240 |
Set<String> alternativeNamesEntity = catalogItem.getAlternativeNames().stream().map(AlternativeName::getName).collect(Collectors.toSet());
|
|
239 |
assertThat(capturedCatalogItem.getTypes().stream().map(Type::getType).collect(Collectors.toSet())).isEqualTo(catalogItem.getTypes().stream().map(Type::getType).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
240 |
Set<String> alternativeNamesEntity = catalogItem.getAllNames().stream().map(CatalogItemName::getName).collect(Collectors.toCollection(LinkedHashSet::new));
|
|
241 | 241 |
alternativeNamesEntity.add(catalogItem.getName()); |
242 |
assertThat(capturedCatalogItem.getAlternativeNames().stream().map(AlternativeName::getName).collect(Collectors.toSet())).isEqualTo(alternativeNamesEntity);
|
|
243 |
assertThat(capturedCatalogItem.getCountries().stream().map(Country::getName).collect(Collectors.toSet())).isEqualTo(catalogItem.getCountries().stream().map(Country::getName).collect(Collectors.toSet()));
|
|
244 |
assertThat(capturedCatalogItem.getBibliography().stream().map(Bibliography::getSource).collect(Collectors.toSet())).isEqualTo(catalogItem.getBibliography().stream().map(Bibliography::getSource).collect(Collectors.toSet()));
|
|
245 |
assertThat(capturedCatalogItem.getWrittenForms().stream().map(WrittenForm::getForm).collect(Collectors.toSet())).isEqualTo(catalogItem.getWrittenForms().stream().map(WrittenForm::getForm).collect(Collectors.toSet()));
|
|
242 |
assertThat(capturedCatalogItem.getAllNames().stream().map(CatalogItemName::getName).collect(Collectors.toSet())).isEqualTo(alternativeNamesEntity);
|
|
243 |
assertThat(capturedCatalogItem.getCountries().stream().map(Country::getName).collect(Collectors.toSet())).isEqualTo(catalogItem.getCountries().stream().map(Country::getName).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
244 |
assertThat(capturedCatalogItem.getBibliography().stream().map(Bibliography::getSource).collect(Collectors.toSet())).isEqualTo(catalogItem.getBibliography().stream().map(Bibliography::getSource).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
245 |
assertThat(capturedCatalogItem.getWrittenForms().stream().map(WrittenForm::getForm).collect(Collectors.toSet())).isEqualTo(catalogItem.getWrittenForms().stream().map(WrittenForm::getForm).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
246 | 246 |
} |
247 | 247 |
|
248 | 248 |
@Test |
... | ... | |
252 | 252 |
|
253 | 253 |
CatalogItemDto catalogItemDto = new CatalogItemDto(); |
254 | 254 |
catalogItemDto.setName("name"); |
255 |
catalogItemDto.setBibliography(Set.of("bibl"));
|
|
256 |
catalogItemDto.setTypes(Set.of("type"));
|
|
257 |
catalogItemDto.setAlternativeNames(Set.of("altName"));
|
|
258 |
catalogItemDto.setCountries(Set.of("country"));
|
|
259 |
catalogItemDto.setWrittenForms(Set.of("written"));
|
|
255 |
catalogItemDto.setBibliography(Stream.of("bibl").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
256 |
catalogItemDto.setTypes(Stream.of("type").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
257 |
catalogItemDto.setAllNames(Stream.of("altName").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
258 |
catalogItemDto.setCountries(Stream.of("country").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
259 |
catalogItemDto.setWrittenForms(Stream.of("written").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
260 | 260 |
catalogItemDto.setCertainty(0); |
261 | 261 |
catalogItemDto.setLatitude(0.1); |
262 | 262 |
catalogItemDto.setLongitude(0.2); |
... | ... | |
300 | 300 |
} |
301 | 301 |
|
302 | 302 |
|
303 |
|
|
304 | 303 |
@Test |
305 | 304 |
void testSearchedTest() { |
306 | 305 |
// given |
307 |
String text = "The city of Azbar was found in first century near the ocean. " + |
|
308 |
"⌈U-re-me-re⌉, another town, was found " + |
|
309 |
"in 1956. The location of Huga and Duga is not known, but it was probably near Puga.";
|
|
310 |
String highlightedText = "The <b>city</b> of <span style='color:green'>Azbar</span> was found in first century near the <b>ocean</b>. " + |
|
311 |
"⌈<span style='color:green'>U-re-me-re</span>⌉, another town, was found " + |
|
312 |
"in 1956. The location of <span style='color:red'>Huga</span> and <span style='color:red'>Duga</span> is not known, but it was probably near Puga.";
|
|
306 |
String text = "The city of Azbar was found in first century near the ocean. " +
|
|
307 |
"⌈U-re-me-re⌉, another town , was found " +
|
|
308 |
"in 1956.\nThe location of Huga and Duga is not known, but it was probably near Puga.";
|
|
309 |
String highlightedText = "The <b>city</b> of <span style='color:green'>Azbar</span> was found in first century near the <b>ocean</b>. " +
|
|
310 |
"⌈<span style='color:green'>U-re-me-re</span>⌉, another town , was found " +
|
|
311 |
"in 1956.\nThe location of <span style='color:red'>Huga</span> and <span style='color:red'>Duga</span> is not known, but it was probably near Puga.";
|
|
313 | 312 |
|
314 | 313 |
CatalogItem catalogItem1 = new CatalogItem(); |
315 |
catalogItem1.setAlternativeNames(Stream.of(new AlternativeName("Azbar", catalogItem1)).collect(Collectors.toSet()));
|
|
314 |
catalogItem1.setAllNames(Stream.of(new CatalogItemName("Azbar", catalogItem1, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
316 | 315 |
catalogItem1.setLatitude(5.0); |
317 | 316 |
catalogItem1.setLongitude(5.0); |
318 | 317 |
|
319 | 318 |
CatalogItem catalogItem2 = new CatalogItem(); |
320 |
catalogItem2.setAlternativeNames(Stream.of(new AlternativeName("Azbar", catalogItem2), new AlternativeName("Azbarasdf", catalogItem2)).collect(Collectors.toSet()));
|
|
319 |
catalogItem2.setAllNames(Stream.of(new CatalogItemName("Azbar", catalogItem2, 1), new CatalogItemName("Azbarasdf", catalogItem2, 2)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
321 | 320 |
catalogItem2.setLatitude(null); |
322 | 321 |
catalogItem2.setLongitude(null); |
323 | 322 |
|
324 | 323 |
CatalogItem catalogItem3 = new CatalogItem(); |
325 |
catalogItem3.setAlternativeNames(Stream.of(new AlternativeName("U-re-me-re", catalogItem3)).collect(Collectors.toSet()));
|
|
324 |
catalogItem3.setAllNames(Stream.of(new CatalogItemName("U-re-me-re", catalogItem3, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
326 | 325 |
catalogItem3.setLatitude(55.0); |
327 | 326 |
catalogItem3.setLongitude(68.0); |
328 | 327 |
|
329 | 328 |
CatalogItem catalogItem4 = new CatalogItem(); |
330 |
catalogItem4.setAlternativeNames(Stream.of(new AlternativeName("Huga", catalogItem4)).collect(Collectors.toSet()));
|
|
329 |
catalogItem4.setAllNames(Stream.of(new CatalogItemName("Huga", catalogItem4, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
331 | 330 |
catalogItem4.setLatitude(null); |
332 | 331 |
catalogItem4.setLongitude(null); |
333 | 332 |
|
334 | 333 |
CatalogItem catalogItem5 = new CatalogItem(); |
335 |
catalogItem5.setAlternativeNames(Stream.of(new AlternativeName("Huga", catalogItem5), new AlternativeName("Hugaa", catalogItem5)).collect(Collectors.toSet()));
|
|
334 |
catalogItem5.setAllNames(Stream.of(new CatalogItemName("Huga", catalogItem5, 1), new CatalogItemName("Hugaa", catalogItem5, 2)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
336 | 335 |
catalogItem5.setLatitude(null); |
337 | 336 |
catalogItem5.setLongitude(null); |
338 | 337 |
|
339 | 338 |
CatalogItem catalogItem6 = new CatalogItem(); |
340 |
catalogItem6.setAlternativeNames(Stream.of(new AlternativeName("Duga", catalogItem6)).collect(Collectors.toSet()));
|
|
339 |
catalogItem6.setAllNames(Stream.of(new CatalogItemName("Duga", catalogItem6, 1)).collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
341 | 340 |
catalogItem6.setLatitude(null); |
342 | 341 |
catalogItem6.setLongitude(null); |
343 | 342 |
|
344 | 343 |
CatalogItemDto catalogItemDto1 = new CatalogItemDto(); |
345 | 344 |
catalogItemDto1.setId(catalogItem1.getId()); |
346 |
catalogItemDto1.setAlternativeNames(Stream.of("Azbar").collect(Collectors.toSet()));
|
|
345 |
catalogItemDto1.setAllNames(Stream.of("Azbar").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
347 | 346 |
catalogItemDto1.setLatitude(5.0); |
348 | 347 |
catalogItemDto1.setLongitude(5.0); |
349 | 348 |
|
350 | 349 |
CatalogItemDto catalogItemDto2 = new CatalogItemDto(); |
351 | 350 |
catalogItemDto2.setId(catalogItem2.getId()); |
352 |
catalogItemDto2.setAlternativeNames(Stream.of("Azbar", "Azbarasdf").collect(Collectors.toSet()));
|
|
351 |
catalogItemDto2.setAllNames(Stream.of("Azbar", "Azbarasdf").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
353 | 352 |
catalogItemDto2.setLatitude(null); |
354 | 353 |
catalogItemDto2.setLongitude(null); |
355 | 354 |
|
356 | 355 |
CatalogItemDto catalogItemDto3 = new CatalogItemDto(); |
357 | 356 |
catalogItemDto3.setId(catalogItem3.getId()); |
358 |
catalogItemDto3.setAlternativeNames(Stream.of("U-re-me-re").collect(Collectors.toSet()));
|
|
357 |
catalogItemDto3.setAllNames(Stream.of("U-re-me-re").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
359 | 358 |
catalogItemDto3.setLatitude(55.0); |
360 | 359 |
catalogItemDto3.setLongitude(68.0); |
361 | 360 |
|
362 | 361 |
CatalogItemDto catalogItemDto4 = new CatalogItemDto(); |
363 | 362 |
catalogItemDto4.setId(catalogItem4.getId()); |
364 |
catalogItemDto4.setAlternativeNames(Stream.of("Huga").collect(Collectors.toSet()));
|
|
363 |
catalogItemDto4.setAllNames(Stream.of("Huga").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
365 | 364 |
catalogItemDto4.setLatitude(null); |
366 | 365 |
catalogItemDto4.setLongitude(null); |
367 | 366 |
|
368 | 367 |
CatalogItemDto catalogItemDto5 = new CatalogItemDto(); |
369 | 368 |
catalogItemDto5.setId(catalogItem5.getId()); |
370 |
catalogItemDto5.setAlternativeNames(Stream.of("Huga", "Hugaa").collect(Collectors.toSet()));
|
|
369 |
catalogItemDto5.setAllNames(Stream.of("Huga", "Hugaa").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
371 | 370 |
catalogItemDto5.setLatitude(null); |
372 | 371 |
catalogItemDto5.setLongitude(null); |
373 | 372 |
|
374 | 373 |
CatalogItemDto catalogItemDto6 = new CatalogItemDto(); |
375 | 374 |
catalogItemDto6.setId(catalogItem6.getId()); |
376 |
catalogItemDto6.setAlternativeNames(Stream.of("Duga").collect(Collectors.toSet()));
|
|
375 |
catalogItemDto6.setAllNames(Stream.of("Duga").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
377 | 376 |
catalogItemDto6.setLatitude(null); |
378 | 377 |
catalogItemDto6.setLongitude(null); |
379 | 378 |
|
380 | 379 |
|
381 |
given(typeService.getAllTypesAsString()).willReturn(Stream.of("city", "ocean").collect(Collectors.toSet()));
|
|
380 |
given(typeService.getAllTypesAsString()).willReturn(Stream.of("city", "ocean").collect(Collectors.toCollection(LinkedHashSet::new)));
|
|
382 | 381 |
given(catalogItemRepository.getItemsByName(anyString())).willReturn(Collections.emptyList()); |
383 | 382 |
given(catalogItemRepository.getItemsByName("Azbar")).willReturn(Stream.of(catalogItem1, catalogItem2).collect(Collectors.toList())); |
384 | 383 |
given(catalogItemRepository.getItemsByName("U-re-me-re")).willReturn(Stream.of(catalogItem3).collect(Collectors.toList())); |
Také k dispozici: Unified diff
Catalog change
- one-to-many associations now persist order
- text for search persists separators
re #9751
re #9754