/**
 * Copyright (C) 2015 The Gravitee team (http://gravitee.io)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.gravitee.management.service;

import io.gravitee.management.service.impl.IdGeneratorImpl;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

/**
 * @author David BRASSELY (brasseld at gmail.com)
 */
@RunWith(MockitoJUnitRunner.class)
public class IdGeneratorTest {

    @Test
    public void shouldGenerateCorrectId() {
        IdGenerator generator = new IdGeneratorImpl();

        String id = generator.generate("My  API");
        Assert.assertEquals("My-API", id);
    }

    @Test
    public void shouldGenerateCorrectId2() {
        IdGenerator generator = new IdGeneratorImpl();

        String id = generator.generate("My  API?123");
        Assert.assertEquals("My-API-123", id);
    }

    @Test
    public void shouldGenerateCorrectId3() {
        IdGenerator generator = new IdGeneratorImpl();

        String id = generator.generate("My  API#?=123");
        Assert.assertEquals("My-API-123", id);
    }

    @Test
    public void shouldGenerateCorrectId4() {
        IdGenerator generator = new IdGeneratorImpl();

        String id = generator.generate("My  API#?=");
        Assert.assertEquals("My-API-", id);
    }
}

@@ -1846,11 +1846,224 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void shouldGenerateCorrectId5() %7B%0A        IdGenerator generator = new IdGeneratorImpl();%0A%0A        String id = generator.generate(%22%C3%A9ererer%22);%0A        Assert.assertEquals(%22-ererer%22, id);%0A    %7D
 %0A%7D%0A

Add UT for accent