use of org.forgerock.openam.tokens.TokenType in project OpenAM by OpenRock.
the class TokenOperationsStoreTest method getMinimumOperationsPerPeriodForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet.
@Test
public void getMinimumOperationsPerPeriodForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet() {
//Given
TokenType tokenType = TokenType.OAUTH;
CTSOperation operation = CTSOperation.CREATE;
//When
long result = tokenOperationsStore.getMinimumOperationsPerPeriod(tokenType, operation);
//Then
assertEquals(result, 0L);
}
use of org.forgerock.openam.tokens.TokenType in project OpenAM by OpenRock.
the class TokenOperationsStoreTest method getOperationsCumulativeCountForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet.
@Test
public void getOperationsCumulativeCountForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet() {
//Given
TokenType tokenType = TokenType.OAUTH;
CTSOperation operation = CTSOperation.CREATE;
//When
long result = tokenOperationsStore.getOperationsCumulativeCount(tokenType, operation);
//Then
assertEquals(result, 0L);
}
use of org.forgerock.openam.tokens.TokenType in project OpenAM by OpenRock.
the class TokenOperationsStoreTest method getAverageOperationsPerPeriodForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet.
@Test
public void getAverageOperationsPerPeriodForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet() {
//Given
TokenType tokenType = TokenType.OAUTH;
CTSOperation operation = CTSOperation.CREATE;
//When
double result = tokenOperationsStore.getAverageOperationsPerPeriod(tokenType, operation);
//Then
assertEquals(result, 0D);
}
use of org.forgerock.openam.tokens.TokenType in project OpenAM by OpenRock.
the class TokenOperationsStoreTest method shouldGetMaximumOperationsPerPeriodForSpecificTokenType.
@Test
public void shouldGetMaximumOperationsPerPeriodForSpecificTokenType() {
//Given
TokenType tokenType = TokenType.OAUTH;
CTSOperation operation = CTSOperation.CREATE;
OperationStore typeOperationStore = mock(OperationStore.class);
tokenOperations.put(TokenType.OAUTH, typeOperationStore);
given(typeOperationStore.getMaxRate(operation)).willReturn(1L);
//When
long result = tokenOperationsStore.getMaximumOperationsPerPeriod(tokenType, operation);
//Then
assertEquals(result, 1L);
}
use of org.forgerock.openam.tokens.TokenType in project OpenAM by OpenRock.
the class TokenOperationsStoreTest method getMaximumOperationsPerPeriodForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet.
@Test
public void getMaximumOperationsPerPeriodForSpecificTokenTypeShouldReturnZeroIfTokenTypeNotSet() {
//Given
TokenType tokenType = TokenType.OAUTH;
CTSOperation operation = CTSOperation.CREATE;
//When
long result = tokenOperationsStore.getMaximumOperationsPerPeriod(tokenType, operation);
//Then
assertEquals(result, 0L);
}
Aggregations