|
|
|
@ -15,13 +15,18 @@ |
|
|
|
*/ |
|
|
|
package org.thingsboard.server.service.entitiy.dashboard; |
|
|
|
|
|
|
|
import org.junit.After; |
|
|
|
import org.junit.Test; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.mock.web.MockHttpServletResponse; |
|
|
|
import org.springframework.test.context.TestPropertySource; |
|
|
|
import org.thingsboard.common.util.JacksonUtil; |
|
|
|
import org.thingsboard.server.common.data.Dashboard; |
|
|
|
import org.thingsboard.server.controller.AbstractControllerTest; |
|
|
|
import org.thingsboard.server.dao.service.DaoSqlTest; |
|
|
|
import org.thingsboard.server.dao.sql.resource.TbResourceRepository; |
|
|
|
import org.thingsboard.server.dao.sql.widget.WidgetTypeRepository; |
|
|
|
import org.thingsboard.server.dao.sql.widget.WidgetsBundleRepository; |
|
|
|
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
@ -35,6 +40,20 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. |
|
|
|
}) |
|
|
|
public class DashboardSyncServiceTest extends AbstractControllerTest { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WidgetTypeRepository widgetTypeRepository; |
|
|
|
@Autowired |
|
|
|
private WidgetsBundleRepository widgetsBundleRepository; |
|
|
|
@Autowired |
|
|
|
private TbResourceRepository resourceRepository; |
|
|
|
|
|
|
|
@After |
|
|
|
public void after() throws Exception { |
|
|
|
widgetsBundleRepository.deleteAll(); |
|
|
|
widgetTypeRepository.deleteAll(); |
|
|
|
resourceRepository.deleteAll(); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testGatewaysDashboardSync() throws Exception { |
|
|
|
loginTenantAdmin(); |
|
|
|
|