Search in sources :

Example 11 with DictionaryEntity

use of io.gravitee.rest.api.model.configuration.dictionary.DictionaryEntity in project gravitee-management-rest-api by gravitee-io.

the class DictionaryManagerTest method shouldNotStartAlreadyStarted.

@Test
public void shouldNotStartAlreadyStarted() {
    final DictionaryProviderEntity provider = new DictionaryProviderEntity();
    provider.setConfiguration(JsonNodeFactory.instance.nullNode());
    final DictionaryEntity dictionary = new DictionaryEntity();
    dictionary.setUpdatedAt(new Date());
    dictionary.setProvider(provider);
    dictionary.setId(DICTIONARY_ID);
    when(dictionaryService.findById(DICTIONARY_ID)).thenReturn(dictionary);
    cut.start(DICTIONARY_ID);
    verify(eventManager, times(1)).publishEvent(eq(DictionaryEvent.START), eq(dictionary));
    cut.start(DICTIONARY_ID);
    verifyNoMoreInteractions(eventManager);
}
Also used : DictionaryEntity(io.gravitee.rest.api.model.configuration.dictionary.DictionaryEntity) DictionaryProviderEntity(io.gravitee.rest.api.model.configuration.dictionary.DictionaryProviderEntity) Date(java.util.Date) Test(org.junit.Test)

Aggregations

DictionaryEntity (io.gravitee.rest.api.model.configuration.dictionary.DictionaryEntity)11 Test (org.junit.Test)6 DictionaryProviderEntity (io.gravitee.rest.api.model.configuration.dictionary.DictionaryProviderEntity)3 Date (java.util.Date)3 Permissions (io.gravitee.rest.api.management.rest.security.Permissions)2 DictionaryTriggerEntity (io.gravitee.rest.api.model.configuration.dictionary.DictionaryTriggerEntity)2 NewDictionaryEntity (io.gravitee.rest.api.model.configuration.dictionary.NewDictionaryEntity)2 UpdateDictionaryEntity (io.gravitee.rest.api.model.configuration.dictionary.UpdateDictionaryEntity)2 Response (javax.ws.rs.core.Response)2