    @SuppressWarnings("unchecked")
    @Test(dataProvider="testUserFrontWithValidTokenData")
    public void testUserFrontWithValidToken(String token, String tag,String q, String[] sort, String[] otherTagsExp) {

        ParkController controller = new ParkController();
        Map<String, Object>[] filteredStbs = new HashMap[1];
        Map<String, Object>[] allStbs = new HashMap[2];
        Map<String, Object> stb1 = new HashMap<String, Object>();
        stb1.put(MetaStb.ID, "sample");
        stb1.put(MetaStb.TAGS, Arrays.asList("tag1"));
        stb1.put(MetaStb.MACADDRESS, "00:00:00:00:00");

        Map<String, Object> stb2 = new HashMap<String, Object>();
        stb2.put(MetaStb.ID, "otherDevice");
        stb2.put(MetaStb.TAGS, Arrays.asList("tag2", "tag3"));
        stb2.put(MetaStb.MACADDRESS, "00:00:00:00:01");

        filteredStbs[0] = stb1;
        allStbs[0] = stb1;
        allStbs[1] = stb2;

        ReflectionTestUtils.setField(controller, "serverUtils", utils);

        ParkService mockService = EasyMock.createMock(ParkService.class);
        if (q == null) {
            EasyMock.expect(mockService.findAll((Pageable) EasyMock.anyObject())).andReturn(allStbs);
        } else {
            EasyMock.expect(mockService.findByKeys((String[]) EasyMock.anyObject(), (Pageable) EasyMock.anyObject())).andReturn(
                    filteredStbs);
            EasyMock.expect(mockService.findAll()).andReturn(allStbs);
        }
        if (tag != null) {
            EasyMock.expect(
                    mockService.findByCriteria(
                        (Criteria) EasyMock.anyObject(),
                        (Pageable) EasyMock.anyObject())).andReturn(
                    filteredStbs);
        }
        EasyMock.replay(mockService);
        ReflectionTestUtils.setField(controller, "service", mockService);
        ReflectionTestUtils.setField(controller, "config", createConfig());

        Integer page = Integer.valueOf(1);
        Integer size = Integer.valueOf(1);
        Boolean asc = Boolean.TRUE;

        try {
            Model model = new BindingAwareModelMap();
            MockHttpSession session = new MockHttpSession();
            Assert.assertEquals("index",
                    controller.userFront(token, tag,q, page, size, asc, sort, model, session));
            Assert.assertEquals(model.asMap().get("search"), q == null ? "" : q);
            String otherTagsJson = (String) model.asMap().get("otherTags");
            String deviceTagsJson = (String) model.asMap().get("deviceTags");
            JsonCerealEngine engine = new JsonCerealEngine();
            List<String> otherTags = engine.readFromString(otherTagsJson, List.class);
            Map<String, List<String>> deviceTags = engine.readFromString(deviceTagsJson, Map.class);

            Assert.assertEquals(otherTags.size(), otherTagsExp.length);
            for (String tags : otherTagsExp) {
                Assert.assertTrue(otherTags.contains(tags));
            }
            Assert.assertEquals(deviceTags.size(), q != null ? 1 : 2);
            Assert.assertTrue(deviceTags.containsKey("sample"));
            Assert.assertTrue(deviceTags.get("sample").contains("tag1"));
        } catch (CerealException e) {

            Assert.fail(e.getMessage());
        }
    }