void () { TaskRepository repository = new YouTrackRepository(new YouTrackRepositoryType()); repository.setShared(true); myTaskManager.setRepositories(Collections.singletonList(repository)); TaskProjectConfiguration configuration = getProject().getService(TaskProjectConfiguration.class); TaskProjectConfiguration state = configuration.getState(); assertNotNull(state); assertEquals(1, state.servers.size()); Element element = XmlSerializer.serialize(state); configuration.servers.clear(); myTaskManager.setRepositories(Collections.emptyList()); configuration.loadState(XmlSerializer.deserialize(element, TaskProjectConfiguration.class)); assertEquals(1, state.servers.size()); myTaskManager.callProjectOpened(); TaskRepository[] repositories = myTaskManager.getAllRepositories(); assertEquals(1, repositories.length); assertTrue(repositories[0].isShared()); }