Commit dd6b4be3 authored by Mingyang Zhu's avatar Mingyang Zhu
Browse files

refactor unit test

parent 0e917e76
......@@ -191,12 +191,12 @@ public class EntitlementsAndCacheServiceImplTest {
// First call, getting groups from entitlements
assertEquals(MEMBER_EMAIL, this.sut.authorize(this.headers, "role2"));
when(this.cache.get("NLdxKQ==")).thenReturn(groups);
when(this.cache.getSuppressException("NLdxKQ==", Optional.of(logger))).thenReturn(groups);
// Second call, getting groups from cache
assertEquals(MEMBER_EMAIL, this.sut.authorize(this.headers, "role2"));
verify(this.entitlementService, times(1)).getGroups();
verify(this.cache, times(2)).get("NLdxKQ==");
verify(this.cache, times(2)).getSuppressException("NLdxKQ==", Optional.of(logger));
verify(this.cache, times(1)).put("NLdxKQ==", groups);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment