Search in sources :

Example 1 with UpdateEntryPointEntity

use of io.gravitee.rest.api.model.UpdateEntryPointEntity in project gravitee-management-rest-api by gravitee-io.

the class EntrypointServiceTest method shouldNotUpdate.

@Test(expected = EntrypointNotFoundException.class)
public void shouldNotUpdate() {
    final UpdateEntryPointEntity entrypoint = new UpdateEntryPointEntity();
    entrypoint.setId(UNKNOWN_ID);
    entrypointService.update(entrypoint, REFERENCE_ID, REFERENCE_TYPE);
}
Also used : UpdateEntryPointEntity(io.gravitee.rest.api.model.UpdateEntryPointEntity) Test(org.junit.Test)

Example 2 with UpdateEntryPointEntity

use of io.gravitee.rest.api.model.UpdateEntryPointEntity in project gravitee-management-rest-api by gravitee-io.

the class EntrypointServiceTest method shouldUpdate.

@Test
public void shouldUpdate() {
    final UpdateEntryPointEntity entrypoint = new UpdateEntryPointEntity();
    entrypoint.setId(ID);
    entrypoint.setValue(NEW_VALUE);
    entrypoint.setTags(NEW_TAGS);
    final EntrypointEntity entrypointEntity = entrypointService.update(entrypoint, REFERENCE_ID, REFERENCE_TYPE);
    assertEquals(ID, entrypointEntity.getId());
    assertEquals(NEW_VALUE, entrypointEntity.getValue());
    assertNotNull(entrypointEntity.getTags());
    assertEquals(2, entrypointEntity.getTags().length);
}
Also used : UpdateEntryPointEntity(io.gravitee.rest.api.model.UpdateEntryPointEntity) EntrypointEntity(io.gravitee.rest.api.model.EntrypointEntity) Test(org.junit.Test)

Example 3 with UpdateEntryPointEntity

use of io.gravitee.rest.api.model.UpdateEntryPointEntity in project gravitee-management-rest-api by gravitee-io.

the class EntrypointServiceTest method shouldUpdateWithSameTags.

@Test
public void shouldUpdateWithSameTags() throws Exception {
    final UpdateEntryPointEntity entrypoint = new UpdateEntryPointEntity();
    entrypoint.setId(ID);
    entrypoint.setValue(NEW_VALUE);
    entrypoint.setTags(TAGS);
    final EntrypointEntity entrypointEntity = entrypointService.update(entrypoint, REFERENCE_ID, REFERENCE_TYPE);
    assertEquals(ID, entrypointEntity.getId());
    assertEquals(NEW_VALUE, entrypointEntity.getValue());
    assertNotNull(entrypointEntity.getTags());
    assertEquals(2, entrypointEntity.getTags().length);
}
Also used : UpdateEntryPointEntity(io.gravitee.rest.api.model.UpdateEntryPointEntity) EntrypointEntity(io.gravitee.rest.api.model.EntrypointEntity) Test(org.junit.Test)

Aggregations

UpdateEntryPointEntity (io.gravitee.rest.api.model.UpdateEntryPointEntity)3 Test (org.junit.Test)3 EntrypointEntity (io.gravitee.rest.api.model.EntrypointEntity)2