@Test public void shouldReturnEncryption() { // Given CoreTokenConfig config = mock(CoreTokenConfig.class); given(config.isTokenEncrypted()).willReturn(true); // When Collection<BlobStrategy> strategies = factory.getStrategies(config); // Then assertThat(strategies).contains(encryption); }
@Test public void shouldReturnAttributeCompression() { // Given CoreTokenConfig config = mock(CoreTokenConfig.class); given(config.isAttributeNamesCompressed()).willReturn(true); // When Collection<BlobStrategy> strategies = factory.getStrategies(config); // Then assertThat(strategies).contains(attributeCompression); }
@Test public void shouldReturnAttributeCompressionBeforeGzipCompression() { // Given CoreTokenConfig config = mock(CoreTokenConfig.class); given(config.isAttributeNamesCompressed()).willReturn(true); given(config.isTokenCompressed()).willReturn(true); // When List<BlobStrategy> strategies = new ArrayList<BlobStrategy>(factory.getStrategies(config)); // Then assertThat(strategies.get(0)).isEqualTo(attributeCompression); assertThat(strategies.get(1)).isEqualTo(compression); }