Skip to content

Commit

Permalink
Update ReleaseMessageServiceWithCacheTest.java
Browse files Browse the repository at this point in the history
propose fix
  • Loading branch information
plzdoo authored Apr 16, 2022
1 parent 3a5f02c commit fe5d2c1
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import com.ctrip.framework.apollo.biz.repository.ReleaseMessageRepository;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -151,14 +150,15 @@ public void testWhenReleaseMsgSizeBiggerThan500() throws Exception {
assertNotNull(latestReleaseMsg);
assertEquals(501, latestReleaseMsg.getId());
assertEquals(antherMsgContent, latestReleaseMsg.getMessage());


List<String> msgContentList = Arrays.asList(someMsgContent, antherMsgContent);
List<ReleaseMessage> latestReleaseMsgGroupByMsgContent =
releaseMessageServiceWithCache
.findLatestReleaseMessagesGroupByMessages(Sets.newHashSet(someMsgContent, antherMsgContent));
.findLatestReleaseMessagesGroupByMessages(Sets.newLinkedHashSet(msgContentList));

assertEquals(2, latestReleaseMsgGroupByMsgContent.size());
Assert.assertTrue(500 == latestReleaseMsgGroupByMsgContent.get(0).getId() || 501 == latestReleaseMsgGroupByMsgContent.get(0).getId());
Assert.assertTrue(500 == latestReleaseMsgGroupByMsgContent.get(1).getId() || 501 == latestReleaseMsgGroupByMsgContent.get(1).getId());
assertEquals(500, latestReleaseMsgGroupByMsgContent.get(0).getId());
assertEquals(501, latestReleaseMsgGroupByMsgContent.get(1).getId());
}

@Test
Expand Down

0 comments on commit fe5d2c1

Please sign in to comment.