コード例 #1
0
  @Test
  public void testCreateOnePost() throws Exception {
    postIndexRepository.save(post1);

    Post actualPost = postIndexRepository.findOne(post1.getId());
    PostSearchAssert.assertEquals(post1, actualPost);
  }
コード例 #2
0
  @Test
  public void testCreateMultiplePosts() throws Exception {
    List<Post> expected = Arrays.asList(post1, post2);
    List<Post> actual = new ArrayList<Post>();
    postIndexRepository.save(expected);

    for (Post post : postIndexRepository.findAll()) {
      actual.add(post);
    }

    PostSearchAssert.assertEquals(actual, expected);
  }
コード例 #3
0
 @Test
 public void testGetNullSuggestion() throws Exception {
   String result = suggestService.getMostLikelySuggestions("apple phone");
   PostSearchAssert.assertEquals(result, null);
 }
コード例 #4
0
 @Test
 public void testGetMostLikelySuggestions() throws Exception {
   String result = suggestService.getMostLikelySuggestions("aple juize");
   PostSearchAssert.assertEquals(result, "apple juice");
 }