1010import org .springframework .data .domain .Page ;
1111import org .springframework .data .domain .PageRequest ;
1212import org .springframework .data .domain .Pageable ;
13- import org .springframework .test .annotation .Commit ;
1413import org .springframework .test .context .junit4 .SpringRunner ;
15- import org .springframework .transaction .annotation .Propagation ;
16- import org .springframework .transaction .annotation .Transactional ;
1714import org .woehlke .twitterwall .conf .properties .TestdataProperties ;
1815import org .woehlke .twitterwall .oodm .entities .HashTag ;
1916import org .woehlke .twitterwall .oodm .entities .transients .HashTagCounted ;
20- import org .woehlke .twitterwall .oodm .entities .transients .HashTagOverviewPaged ;
2117
2218@ RunWith (SpringRunner .class )
2319@ SpringBootTest (webEnvironment = SpringBootTest .WebEnvironment .NONE )
24- //@Transactional(propagation= Propagation.REQUIRES_NEW,readOnly=false)
2520public class HashTagServiceTest {
2621
2722 private static final Logger log = LoggerFactory .getLogger (HashTagServiceTest .class );
2823
2924 @ Autowired
3025 private HashTagService hashTagService ;
3126
32- //TODO: #198 https://github.com/phasenraum2010/twitterwall2/issues/198
3327 @ Autowired
3428 private TestdataProperties testdataProperties ;
3529
3630
37- //@Commit
3831 @ Test
3932 public void areDependenciesLoaded () throws Exception {
4033 Assert .assertNotNull (hashTagService );
4134 Assert .assertNotNull (testdataProperties );
4235 }
4336
44- //@Commit
4537 @ Test
4638 public void fetchTestData () throws Exception {
4739 String msg = "fetchTestData: " ;
@@ -59,7 +51,6 @@ public void fetchTestData() throws Exception {
5951 }
6052 }
6153
62- //@Commit
6354 @ Test
6455 public void findByText () throws Exception {
6556 String msg = "findByText: " ;
@@ -77,36 +68,14 @@ public void findByText() throws Exception {
7768 }
7869
7970 /**
80- *
8171 * @throws Exception
8272 *
8373 * @see org.woehlke.twitterwall.oodm.entities.HashTag
8474 * @see org.woehlke.twitterwall.oodm.entities.parts.Entities
8575 * @see org.woehlke.twitterwall.oodm.entities.transients.mapper.CountAllTweets2HashTagsRowMapper#SQL_COUNT_ALL_TWEET_2_HASHTAG
86- * @see org.woehlke.twitterwall.oodm.entities.transients.mapper.CountAllUsers2HashTagsRowMapper#SQL_COUNT_ALL_USER_2_HASHTAG
87- * @see org.woehlke.twitterwall.oodm.entities.transients.HashTagOverviewPaged
8876 * @see org.woehlke.twitterwall.oodm.repositories.custom.impl.HashTagRepositoryImpl#countAllTweet2HashTag(Pageable)
89- * @see org.woehlke.twitterwall.oodm.repositories.custom.impl.HashTagRepositoryImpl#countAllUser2HashTag(Pageable)
90- * @see org.woehlke.twitterwall.oodm.service.impl.HashTagServiceImpl#getHashTagOverview(Pageable, Pageable)
77+ * @see org.woehlke.twitterwall.oodm.service.impl.HashTagServiceImpl#getHashTagsTweets(Pageable)
9178 */
92- @ Test
93- public void getHashTagOverview () throws Exception {
94- String msg = "getHashTagOverview: " ;
95- int page =1 ;
96- int size =30 ;
97- Pageable pageRequestTweets = new PageRequest (page ,size );
98- Pageable pageRequestUsers = new PageRequest (page ,size );
99- HashTagOverviewPaged overview = hashTagService .getHashTagOverview (pageRequestTweets ,pageRequestUsers );
100- Page <HashTagCounted > hashTagsTweets = overview .getHashTagsTweets ();
101- Page <HashTagCounted > hashTagsUsers = overview .getHashTagsUsers ();
102- for (HashTagCounted counted :hashTagsTweets ){
103- log .info (msg +" hashTagsTweets: " +counted .getText ());
104- }
105- for (HashTagCounted counted :hashTagsUsers ){
106- log .info (msg +" hashTagsUsers: " +counted .getText ());
107- }
108- }
109-
11079 @ Test
11180 public void getHashTagsTweets () throws Exception {
11281 String msg = "getHashTagsTweets: " ;
@@ -119,6 +88,15 @@ public void getHashTagsTweets() throws Exception {
11988 }
12089 }
12190
91+ /**
92+ * @throws Exception
93+ *
94+ * @see org.woehlke.twitterwall.oodm.entities.HashTag
95+ * @see org.woehlke.twitterwall.oodm.entities.parts.Entities
96+ * @see org.woehlke.twitterwall.oodm.entities.transients.mapper.CountAllUsers2HashTagsRowMapper#SQL_COUNT_ALL_USER_2_HASHTAG
97+ * @see org.woehlke.twitterwall.oodm.repositories.custom.impl.HashTagRepositoryImpl#countAllUser2HashTag(Pageable)
98+ * @see org.woehlke.twitterwall.oodm.service.impl.HashTagServiceImpl#getHashTagsUsers(Pageable)
99+ */
122100 @ Test
123101 public void getHashTagsUsers () throws Exception {
124102 String msg = "getHashTagsUsers: " ;
0 commit comments