WorkbenchRepositoryEventListener implements RepositoryEventListener { protected Path getTargetPath(String fileName, String branchName, String target) { if(branchName == null || branchName.trim().length() < 1) { branchName = "master"; } return PathFactory.newPath(fileName, "default: }  @PostConstruct void init(); @Override void onServiceTaskAdded(RepoData service); @Override void onServiceTaskEnabled(RepoData service); @Override void onServiceTaskDisabled(RepoData service); @Override void onServiceTaskInstalled(RepoData service, String target, List<String> parameters, String branchName); @Override void onServiceTaskUninstalled(RepoData service, String target, String branchName);  }
@Test public void testGetTargetForNullBranch() { WorkbenchRepositoryEventListener listener = new WorkbenchRepositoryEventListener(); Path path = listener.getTargetPath("pom.xml", null, "testTarget"); assertNotNull(path); assertEquals("default: }
@Test public void testGetTargetForEmptyBranch() { WorkbenchRepositoryEventListener listener = new WorkbenchRepositoryEventListener(); Path path = listener.getTargetPath("pom.xml", "", "testTarget"); assertNotNull(path); assertEquals("default: }
@Test public void testGetTargetPathForBranch() { WorkbenchRepositoryEventListener listener = new WorkbenchRepositoryEventListener(); Path path = listener.getTargetPath("pom.xml", "testBranchName", "testTarget"); assertNotNull(path); assertEquals("default: }