Search in sources :

Example 1 with DefaultLongNumericGenerator

use of org.apereo.cas.util.gen.DefaultLongNumericGenerator in project cas by apereo.

the class DefaultLongNumericGeneratorTests method verifyIncrementWithNoWrap2.

@Test
public void verifyIncrementWithNoWrap2() {
    final DefaultLongNumericGenerator g = new DefaultLongNumericGenerator();
    g.getNextLong();
    assertEquals(1, g.getNextLong());
}
Also used : DefaultLongNumericGenerator(org.apereo.cas.util.gen.DefaultLongNumericGenerator) Test(org.junit.Test)

Example 2 with DefaultLongNumericGenerator

use of org.apereo.cas.util.gen.DefaultLongNumericGenerator in project cas by apereo.

the class DefaultUniqueTicketIdGenerator method setMaxLength.

/**
 * Sets max length of id generation.
 *
 * @param maxLength the max length
 */
public void setMaxLength(final int maxLength) {
    this.randomStringGenerator = new Base64RandomStringGenerator(maxLength);
    this.numericGenerator = new DefaultLongNumericGenerator(1);
}
Also used : DefaultLongNumericGenerator(org.apereo.cas.util.gen.DefaultLongNumericGenerator) Base64RandomStringGenerator(org.apereo.cas.util.gen.Base64RandomStringGenerator)

Aggregations

DefaultLongNumericGenerator (org.apereo.cas.util.gen.DefaultLongNumericGenerator)2 Base64RandomStringGenerator (org.apereo.cas.util.gen.Base64RandomStringGenerator)1 Test (org.junit.Test)1