@@ -0,0 +1,3047 @@
+package de.kopis.timeclicker.controllers;%0A%0Aimport de.kopis.timeclicker.utils.TimeclickerEntityFactory;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.test.context.junit4.SpringRunner;%0Aimport org.springframework.test.web.servlet.MockMvc;%0Aimport org.springframework.test.web.servlet.request.MockMvcRequestBuilders;%0Aimport org.springframework.test.web.servlet.result.MockMvcResultMatchers;%0A%0Aimport java.time.Instant;%0Aimport java.time.temporal.ChronoUnit;%0Aimport java.util.Date;%0A%0Aimport com.google.appengine.api.datastore.DatastoreService;%0Aimport com.google.appengine.api.datastore.DatastoreServiceFactory;%0Aimport com.google.appengine.api.datastore.Entity;%0Aimport com.google.appengine.api.users.User;%0Aimport com.google.appengine.api.users.UserService;%0Aimport com.google.appengine.api.users.UserServiceFactory;%0Aimport com.google.appengine.repackaged.com.google.common.collect.ImmutableMap;%0Aimport com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;%0Aimport com.google.appengine.tools.development.testing.LocalServiceTestHelper;%0Aimport com.google.appengine.tools.development.testing.LocalUserServiceTestConfig;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0A%0A@RunWith(SpringRunner.class)%0A@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)%0A@AutoConfigureMockMvc%0Apublic class ChartControllerTest %7B%0A  @Autowired%0A  private MockMvc client;%0A%0A  private final LocalServiceTestHelper helper = new LocalServiceTestHelper(%0A      new LocalUserServiceTestConfig(),%0A      new LocalDatastoreServiceTestConfig());%0A%0A%0A  @Before%0A  public void setUp() %7B%0A    helper%0A        .setEnvEmail(%22tester@localhost.localdomain%22)%0A        .setEnvAuthDomain(%22localhost.localdomain%22)%0A        .setEnvIsLoggedIn(true)%0A        // necessary to set the user ID, otherwise it is NULL%0A        .setEnvAttributes(ImmutableMap.of(%22com.google.appengine.api.users.UserService.user_id_key%22, %22123%22))%0A        .setUp();%0A%0A    // create an entry%0A    final DatastoreService ds = DatastoreServiceFactory.getDatastoreService();%0A    final UserService userService = UserServiceFactory.getUserService();%0A    User currentUser = userService.getCurrentUser();%0A    final Entity entry = TimeclickerEntityFactory.createTimeEntryEntity(currentUser);%0A    entry.setProperty(%22start%22, Date.from(Instant.now().minus(1, ChronoUnit.MINUTES)));%0A    ds.put(entry);%0A  %7D%0A%0A  @After%0A  public void tearDown() %7B%0A    helper.tearDown();%0A  %7D%0A%0A  @Test%0A  public void getWeeklyChart() throws Exception %7B%0A    client.perform(MockMvcRequestBuilders.get(%22/charts/weekly%22))%0A        .andExpect(MockMvcResultMatchers.status().is2xxSuccessful());%0A  %7D%0A%0A  @Test%0A  public void getDailyChart() throws Exception %7B%0A    client.perform(MockMvcRequestBuilders.get(%22/charts/daily%22))%0A        .andExpect(MockMvcResultMatchers.status().is2xxSuccessful());%0A  %7D%0A%7D

Add first draft of ChartControllerTest - not really doing something