### Question:
KieService { public T loadContent(Path path) { try { final org.uberfire.java.nio.file.Path ioPath = Paths.convert(path); if (pathResolver.isDotFile(ioPath)) { org.uberfire.java.nio.file.Path ioPrincipleFilePath = pathResolver.resolveMainFilePath(ioPath); if (!ioService.exists(ioPrincipleFilePath)) { ioPrincipleFilePath = ioPath; } final Path principleFilePath = Paths.convert(ioPrincipleFilePath); return constructContent(principleFilePath, overviewLoader.loadOverview(principleFilePath)); } else { return constructContent(path, overviewLoader.loadOverview(path)); } } catch (Exception e) { throw ExceptionUtilities.handleException(e); } }  T loadContent(Path path); String getSource(final Path path);  }### Answer:
@Test public void testBasic() throws Exception { TestModel testModel = kieService.loadContent(Paths.convert(mainFilePath)); assertNotNull(testModel); assertMetadataRequestedForMainFile(); }
@Test public void testProjectName() throws Exception { final KieModule module = mock(KieModule.class); doReturn(module).when(moduleService).resolveModule(any(Path.class)); final WorkspaceProject project = mock(WorkspaceProject.class); doReturn("test name").when(project).getName(); doReturn(project).when(projectService).resolveProject(any(Path.class)); final TestModel testModel = kieService.loadContent(Paths.convert(mainFilePath)); assertEquals("test name", testModel.overview.getProjectName()); }
@Test public void testPathPointsToDotFile() throws Exception { TestModel testModel = kieService.loadContent(Paths.convert(dotFilePath)); assertNotNull(testModel); assertMetadataRequestedForMainFile(); }
@Test public void testPathPointsToOrphanDotFile() throws Exception { TestModel testModel = kieService.loadContent(Paths.convert(orphanDotFilePath)); assertNotNull(testModel); assertMetadataRequestedForOrphanFile(); }