use of io.gravitee.rest.api.model.settings.ConsoleSettingsEntity in project gravitee-management-rest-api by gravitee-io.
the class ConsoleSettingsResourceTest method shouldCallSaveMethod.
@Test
public void shouldCallSaveMethod() {
ConsoleSettingsEntity config = new ConsoleSettingsEntity();
config.setMaintenance(new Maintenance());
when(parameterService.findAsBoolean(Key.MAINTENANCE_MODE_ENABLED, GraviteeContext.getCurrentOrganization(), ParameterReferenceType.ORGANIZATION)).thenReturn(false);
final Response response = orgTarget().request().post(Entity.json(config));
assertEquals(response.readEntity(String.class), OK_200, response.getStatus());
verify(configService).save(any(ConsoleSettingsEntity.class));
}
use of io.gravitee.rest.api.model.settings.ConsoleSettingsEntity in project gravitee-management-rest-api by gravitee-io.
the class ConfigurationResourceTest method shouldGetConfiguration.
@Test
public void shouldGetConfiguration() {
resetAllMocks();
PortalSettingsEntity portalConfigEntity = new PortalSettingsEntity();
ConsoleSettingsEntity consoleSettingsEntity = new ConsoleSettingsEntity();
doReturn(portalConfigEntity).when(configService).getPortalSettings();
doReturn(consoleSettingsEntity).when(configService).getConsoleSettings();
final Response response = target().request().get();
assertEquals(HttpStatusCode.OK_200, response.getStatus());
Mockito.verify(configMapper).convert(portalConfigEntity, consoleSettingsEntity);
Mockito.verify(configService).getPortalSettings();
Mockito.verify(configService).getConsoleSettings();
}
Aggregations