WorkspacePathResolver { public Path getWorkspacePath() { String workspace = env.getProperty("workspace"); if (workspace == null) { return Paths.get(env.getProperty("user.home"), ".bonita"); } return Paths.get(workspace); }  Path getWorkspacePath(); Path getTemporaryWorkspacePath(); Path getPagesRepositoryPath(); Path getWidgetsRepositoryPath(); Path getTmpPagesRepositoryPath();  }
@Test public void should_resolve_workspace_path_by_getting_system_property() throws Exception { Path expectedWorkspacePath = Paths.get("someUserDefinedDirectory"); when(env.getProperty(WORKSPACE_KEY)).thenReturn(expectedWorkspacePath.toString()); assertThat(workspacePathResolver.getWorkspacePath()).isEqualTo(expectedWorkspacePath); }
@Test public void should_have_a_default_value_if_property_is_not_set() throws Exception { when(env.getProperty("user.home")).thenReturn(System.getProperty("user.home")); assertThat(workspacePathResolver.getWorkspacePath()) .isEqualTo(Paths.get(System.getProperty("user.home") + "/.bonita")); }