View Javadoc
1   package org.oxerr.spring.cache.redis.scored.spring.boot.autoconfigure;
2   
3   import static org.junit.jupiter.api.Assertions.assertEquals;
4   
5   import org.junit.jupiter.api.Test;
6   import org.oxerr.spring.cache.redis.scored.score.resolver.DefaultScoreResolver;
7   
8   class DefaultScoreResolverTest {
9   
10  	private final DefaultScoreResolver resolver = new DefaultScoreResolver();
11  
12  	@Test
13  	void testResolveScore() {
14  		assertEquals(1, this.resolver.resolveScore(new ScoredAccount()).get().longValue());
15  		assertEquals(1, this.resolver.resolveScore(new VersionedAccount()).get().longValue());
16  		assertEquals(1, this.resolver.resolveScore(new SpringDataVersionedAccount()).get().longValue());
17  	}
18  
19  }
20  
21  class ScoredAccount {
22  
23  	@org.oxerr.spring.cache.redis.scored.score.resolver.annotated.annotation.Score
24  	private long version = 1L;
25  
26  }
27  
28  class VersionedAccount {
29  
30  	@javax.persistence.Version
31  	private long version = 1L;
32  
33  }
34  
35  class SpringDataVersionedAccount {
36  
37  	@org.springframework.data.annotation.Version
38  	private long version = 1L;
39  
40  }