use of org.forgerock.openam.cts.CoreTokenConfig in project OpenAM by OpenRock.
the class TokenStrategyFactoryTest method shouldReturnAttributeCompression.
@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);
}
use of org.forgerock.openam.cts.CoreTokenConfig in project OpenAM by OpenRock.
the class TokenStrategyFactoryTest method shouldReturnAttributeCompressionBeforeGzipCompression.
@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);
}
use of org.forgerock.openam.cts.CoreTokenConfig in project OpenAM by OpenRock.
the class SessionAdapterTest method setup.
@BeforeMethod
public void setup() {
tokenIdFactory = mock(TokenIdFactory.class);
coreTokenConfig = mock(CoreTokenConfig.class);
jsonSerialisation = mock(JSONSerialisation.class);
blobUtils = new TokenBlobUtils();
adapter = new SessionAdapter(tokenIdFactory, coreTokenConfig, jsonSerialisation, blobUtils);
}
use of org.forgerock.openam.cts.CoreTokenConfig in project OpenAM by OpenRock.
the class TokenStrategyFactoryTest method shouldReturnMultipleStrategies.
@Test
public void shouldReturnMultipleStrategies() {
// Given
CoreTokenConfig config = mock(CoreTokenConfig.class);
given(config.isTokenEncrypted()).willReturn(true);
given(config.isTokenCompressed()).willReturn(true);
// When
Collection<BlobStrategy> strategies = factory.getStrategies(config);
// Then
assertThat(strategies).contains(compression, encryption);
}
use of org.forgerock.openam.cts.CoreTokenConfig in project OpenAM by OpenRock.
the class TokenStrategyFactoryTest method shouldReturnEncryption.
@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);
}
Aggregations