@Test
  public void voteChangeAndTimeout() throws Exception {
    // do 5 votes
    vote();
    // change mind, vote for another restaurant
    doVote(RESTAURANT_A_NAME, "qqq");
    Restaurant restA = restaurantRepository.findByRestaurantName(RESTAURANT_A_NAME);
    Restaurant restB = restaurantRepository.findByRestaurantName(RESTAURANT_B_NAME);

    checkResults(restA, restB);

    // time-up
    ((MockTimeService) timeService).setTime(15, 00);

    mockMvc
        .perform(
            put("/vote/vote-by-name/" + RESTAURANT_B_NAME)
                .contentType(MediaType.APPLICATION_JSON)
                .with(httpBasic("zzz", "")))
        .andExpect(status().isNotFound());

    // check nothing was changed
    checkResults(restA, restB);
  }
 @Before
 public void setup() throws Exception {
   this.mockMvc = webAppContextSetup(webApplicationContext).apply(springSecurity()).build();
   restaurantRepository.deleteAll();
   ((MockTimeService) timeService).setTime(10, 00);
 }