use of org.kie.workbench.common.stunner.project.diagram.impl.ProjectMetadataImpl in project kie-wb-common by kiegroup.
the class DMNContentServiceImplTest method testGetProjectContent.
@Test
public void testGetProjectContent() {
final String defSetId = "defSetId";
final String expectedContent = "<xml/>";
final String moduleName = "moduleName";
final Package aPackage = mock(Package.class);
final KieModule kieModule = mock(KieModule.class);
final Overview overview = mock(Overview.class);
doReturn(expectedContent).when(service).getSource(path);
when(moduleService.resolvePackage(path)).thenReturn(aPackage);
when(moduleService.resolveModule(path)).thenReturn(kieModule);
when(overviewLoader.loadOverview(path)).thenReturn(overview);
when(kieModule.getModuleName()).thenReturn(moduleName);
final DMNContentResource contentResource = service.getProjectContent(path, defSetId);
final String actualContent = contentResource.getContent();
final ProjectMetadataImpl metadata = (ProjectMetadataImpl) contentResource.getMetadata();
assertEquals(expectedContent, actualContent);
assertEquals(defSetId, metadata.getDefinitionSetId());
assertEquals(moduleName, metadata.getModuleName());
assertEquals(aPackage, metadata.getProjectPackage());
assertEquals(overview, metadata.getOverview());
assertEquals(fileName, metadata.getTitle());
assertEquals(path, metadata.getPath());
}
Aggregations