use of com.enonic.xp.impl.macro.MacroServiceImpl in project xp by enonic.
the class AbstractPortalUrlServiceImplTest method setup.
@BeforeEach
public void setup() {
final ApplicationKey applicationKey = ApplicationKey.from("myapplication");
final Application application = Mockito.mock(Application.class);
when(application.getKey()).thenReturn(applicationKey);
req = mock(HttpServletRequest.class);
this.portalRequest = new PortalRequest();
this.portalRequest.setBranch(Branch.from("draft"));
this.portalRequest.setApplicationKey(applicationKey);
this.portalRequest.setBaseUri("/site");
this.portalRequest.setContentPath(ContentPath.from("context/path"));
this.portalRequest.setRawRequest(req);
this.service = new PortalUrlServiceImpl();
this.service.setMacroService(new MacroServiceImpl());
this.contentService = Mockito.mock(ContentService.class);
this.service.setContentService(this.contentService);
this.styleDescriptorService = Mockito.mock(StyleDescriptorService.class);
when(this.styleDescriptorService.getByApplications(Mockito.any())).thenReturn(StyleDescriptors.empty());
this.service.setStyleDescriptorService(this.styleDescriptorService);
this.applicationService = Mockito.mock(ApplicationService.class);
when(this.applicationService.getInstalledApplication(applicationKey)).thenReturn(application);
this.resourceService = Mockito.mock(ResourceService.class);
this.service.setResourceService(this.resourceService);
}
Aggregations