|
21 | 21 | import org.woehlke.twitterwall.oodm.entities.*; |
22 | 22 | import org.woehlke.twitterwall.oodm.entities.transients.Object2Entity; |
23 | 23 |
|
| 24 | +import java.util.Set; |
| 25 | + |
24 | 26 | import static org.woehlke.twitterwall.frontend.controller.common.ControllerHelper.FIRST_PAGE_NUMBER; |
25 | 27 |
|
26 | 28 | @RunWith(SpringRunner.class) |
@@ -326,29 +328,35 @@ public void findAllUser2Media() throws Exception { |
326 | 328 |
|
327 | 329 |
|
328 | 330 | //@Commit |
329 | | - @Ignore |
| 331 | + //@Ignore |
330 | 332 | @Test |
331 | 333 | public void findAllUser2Mentiong() throws Exception { |
332 | 334 | String msg = "findAllUser2Mentiong: "; |
333 | 335 | int page=1; |
334 | 336 | int size=10; |
335 | 337 | Pageable pageRequest = new PageRequest(page,size); |
336 | 338 | Page<Object2Entity> foundPage = userService.findAllUser2Mentiong(pageRequest); |
337 | | - if(foundPage.getTotalElements()>0){ |
338 | | - for(Object2Entity object2Entity:foundPage.getContent()){ |
339 | | - long objectId = object2Entity.getObjectId(); |
340 | | - String objectInfo = object2Entity.getObjectInfo(); |
341 | | - long entityId = object2Entity.getEntityId(); |
342 | | - String entityInfo = object2Entity.getObjectInfo(); |
343 | | - User userPers = userService.findById(objectId); |
344 | | - Mention mentionPers = mentionService.findById(entityId); |
345 | | - Assert.assertNotNull(msg,userPers); |
346 | | - Assert.assertNotNull(msg,mentionPers); |
347 | | - Assert.assertNull(objectInfo); |
348 | | - Assert.assertNull(entityInfo); |
349 | | - boolean ok = userPers.getEntities().getMentions().contains(mentionPers); |
350 | | - Assert.assertTrue(msg,ok); |
351 | | - } |
| 339 | + for(Object2Entity object2Entity:foundPage.getContent()){ |
| 340 | + long objectId = object2Entity.getObjectId(); |
| 341 | + log.info(msg+" objectId: "+objectId); |
| 342 | + String objectInfo = object2Entity.getObjectInfo(); |
| 343 | + log.info(msg+" objectInfo: "+objectInfo); |
| 344 | + long entityId = object2Entity.getEntityId(); |
| 345 | + log.info(msg+" entityId: "+entityId); |
| 346 | + String entityInfo = object2Entity.getObjectInfo(); |
| 347 | + log.info(msg+" entityInfo: "+entityInfo); |
| 348 | + User userPers = userService.findById(objectId); |
| 349 | + log.info(msg+" userPers: "+userPers); |
| 350 | + Mention mentionPers = mentionService.findById(entityId); |
| 351 | + log.info(msg+" mentionPers: "+mentionPers); |
| 352 | + Assert.assertNotNull(msg+" userPers: ",userPers); |
| 353 | + Assert.assertNotNull(msg+" mentionPers: ",mentionPers); |
| 354 | + Assert.assertNull(msg+" objectInfo: " ,objectInfo); |
| 355 | + Assert.assertNull(msg+" entityInfo: ",entityInfo); |
| 356 | + Set<Mention> mentions = userPers.getEntities().getMentions(); |
| 357 | + Assert.assertTrue(msg,mentions.size()>0); |
| 358 | + boolean ok = mentions.contains(mentionPers); |
| 359 | + Assert.assertTrue(msg,ok); |
352 | 360 | } |
353 | 361 | } |
354 | 362 |
|
|
0 commit comments