@@ -0,0 +1,1468 @@
+package org.corpus_tools.annis.gui;%0A%0Aimport static org.junit.Assert.assertNotNull;%0Aimport static org.junit.Assert.assertNull;%0A%0Aimport com.github.mvysny.kaributesting.v8.MockVaadin;%0Aimport com.vaadin.spring.internal.UIScopeImpl;%0Aimport org.junit.jupiter.api.AfterEach;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.springframework.beans.factory.BeanFactory;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.boot.test.context.SpringBootTest;%0Aimport org.springframework.security.core.Authentication;%0Aimport org.springframework.security.core.context.SecurityContext;%0Aimport org.springframework.test.context.ActiveProfiles;%0Aimport org.springframework.test.context.web.WebAppConfiguration;%0A%0A@SpringBootTest%0A@ActiveProfiles(%7B%22test%22, %22headless%22%7D)%0A@WebAppConfiguration%0Aclass ServiceStarterTest %7B%0A%0A  @Autowired%0A  private BeanFactory beanFactory;%0A%0A  private AnnisUI ui;%0A%0A  @BeforeEach%0A  public void setup() %7B%0A    UIScopeImpl.setBeanStoreRetrievalStrategy(new SingletonBeanStoreRetrievalStrategy());%0A    ui = beanFactory.getBean(AnnisUI.class);%0A    MockVaadin.setup(() -%3E ui);%0A  %7D%0A%0A  @AfterEach%0A  public void tearDown() %7B%0A    MockVaadin.tearDown();%0A  %7D%0A%0A  @Test%0A  void testDesktopAuthNotConfigured() %7B%0A    assertNull(ui.getLastAccessToken());%0A    SecurityContext ctx = ui.getSecurityContext();%0A    assertNotNull(ctx);%0A    Authentication auth = ctx.getAuthentication();%0A    assertNull(auth);%0A  %7D%0A%0A%7D%0A

Test when in non-desktop mode, that the access token is not set