Remove the controller properties for polling time and overdue time and

use the new tenant configuration management, which handle the tenant
specific polling time.

Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
SirWayne
2016-03-14 15:13:51 +01:00
parent 807aaf629c
commit 57c722ea11
3 changed files with 28 additions and 30 deletions

View File

@@ -34,6 +34,7 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
import org.eclipse.hawkbit.repository.model.Target;
import org.eclipse.hawkbit.repository.model.TargetUpdateStatus;
import org.eclipse.hawkbit.rest.resource.JsonBuilder;
import org.eclipse.hawkbit.tenancy.configuration.TenantConfigurationKey;
import org.eclipse.hawkbit.util.IpUtil;
import org.junit.Test;
import org.springframework.hateoas.MediaTypes;
@@ -133,6 +134,19 @@ public class RootControllerTest extends AbstractIntegrationTestWithMongoDB {
.andExpect(status().isMethodNotAllowed());
}
@Test
@Description("Ensures that tenant polling time, which is save in the db, exists.")
public void testModifyGloablPollingTime() throws Exception {
tenantConfigurationManagement.addOrUpdateConfiguration(TenantConfigurationKey.POLLING_TIME_INTERVAL,
"00:02:00");
mvc.perform(get("/{tenant}/controller/v1/4711", tenantAware.getCurrentTenant()))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk())
.andExpect(content().contentType(MediaTypes.HAL_JSON))
.andExpect(jsonPath("$config.polling.sleep", equalTo("00:02:00")));
}
@Test
@Description("Ensures that etag check results in not modified response if provided etag by client is identical to entity in repository.")
public void rootRsNotModified() throws Exception {