WorkspacePathResolver { public Path getWidgetsRepositoryPath() { return getRepositoryPath(WIDGETS_DEFAULT_DIRECTORY, env.getProperty("repository.widgets")); }  Path getWorkspacePath(); Path getTemporaryWorkspacePath(); Path getPagesRepositoryPath(); Path getWidgetsRepositoryPath(); Path getTmpPagesRepositoryPath();  }
@Test public void should_retrieve_widgets_repository_path_from_environment_variable() throws Exception { when(env.getProperty("repository.widgets")).thenReturn("/path/to/widgets"); assertThat(workspacePathResolver.getWidgetsRepositoryPath()).isEqualTo(Paths.get("/path/to/widgets")); }
@Test public void should_resolve_widgets_repository_path() throws Exception { when(env.getProperty("user.home")).thenReturn(System.getProperty("user.home")); assertThat(workspacePathResolver.getWidgetsRepositoryPath()) .isEqualTo(Paths.get(System.getProperty("user.home") + "/.bonita/widgets")); }