22
33import org .junit .jupiter .api .Test ;
44
5+ import com .enonic .xp .admin .extension .AdminExtensionDescriptor ;
6+ import com .enonic .xp .admin .extension .AdminExtensionDescriptorService ;
57import com .enonic .xp .admin .tool .AdminToolDescriptor ;
68import com .enonic .xp .admin .tool .AdminToolDescriptorService ;
79import com .enonic .xp .admin .tool .AdminToolDescriptors ;
8- import com .enonic .xp .admin .widget .WidgetDescriptor ;
9- import com .enonic .xp .admin .widget .WidgetDescriptorService ;
1010import com .enonic .xp .app .ApplicationKey ;
1111import com .enonic .xp .branch .Branch ;
1212import com .enonic .xp .content .ContentPath ;
1313import com .enonic .xp .data .PropertyTree ;
14- import com .enonic .xp .descriptor .Descriptors ;
1514import com .enonic .xp .descriptor .DescriptorKey ;
15+ import com .enonic .xp .descriptor .Descriptors ;
1616import com .enonic .xp .project .Project ;
1717import com .enonic .xp .project .ProjectName ;
1818import com .enonic .xp .repository .RepositoryId ;
@@ -35,7 +35,7 @@ public class RequestVerifierHandlerTest
3535{
3636 private AdminToolDescriptorService adminToolDescriptorService ;
3737
38- private WidgetDescriptorService widgetDescriptorService ;
38+ private AdminExtensionDescriptorService extensionDescriptorService ;
3939
4040 @ Override
4141 protected void initialize ()
@@ -46,8 +46,8 @@ protected void initialize()
4646 adminToolDescriptorService = mock ( AdminToolDescriptorService .class );
4747 addService ( AdminToolDescriptorService .class , adminToolDescriptorService );
4848
49- widgetDescriptorService = mock ( WidgetDescriptorService .class );
50- addService ( WidgetDescriptorService .class , widgetDescriptorService );
49+ extensionDescriptorService = mock ( AdminExtensionDescriptorService .class );
50+ addService ( AdminExtensionDescriptorService .class , extensionDescriptorService );
5151 }
5252
5353 @ Test
@@ -147,8 +147,8 @@ void testAssetRequestOnLegacyAdminTool()
147147 final ApplicationKey applicationKey = ApplicationKey .from ( "myapplication" );
148148
149149 when ( adminToolDescriptorService .getByApplication ( eq ( applicationKey ) ) ).thenReturn ( AdminToolDescriptors .empty () );
150- when ( widgetDescriptorService .getByApplication ( eq ( applicationKey ) ) ).thenReturn (
151- Descriptors .from ( WidgetDescriptor .create ().key ( DescriptorKey .from ( applicationKey , "widgetName" ) ).build () ) );
150+ when ( extensionDescriptorService .getByApplication ( eq ( applicationKey ) ) ).thenReturn (
151+ Descriptors .from ( AdminExtensionDescriptor .create ().key ( DescriptorKey .from ( applicationKey , "widgetName" ) ).build () ) );
152152
153153 runFunction ( "lib/request-verifier-test.js" , "testAssetRequestOnLegacyAdminTool" );
154154 }
@@ -173,7 +173,7 @@ void testAssetRequestOnRoot()
173173
174174 when ( adminToolDescriptorService .getByApplication ( eq ( ApplicationKey .from ( "myapplication" ) ) ) ).thenReturn (
175175 AdminToolDescriptors .empty () );
176- when ( widgetDescriptorService .getByApplication ( eq ( ApplicationKey .from ( "myapplication" ) ) ) ).thenReturn ( Descriptors .empty () );
176+ when ( extensionDescriptorService .getByApplication ( eq ( ApplicationKey .from ( "myapplication" ) ) ) ).thenReturn ( Descriptors .empty () );
177177
178178 runFunction ( "lib/request-verifier-test.js" , "testAssetRequestOnRoot" );
179179 }
@@ -186,7 +186,7 @@ void testAssetRequestOnAdminWithoutToolsAndWidgets()
186186
187187 when ( adminToolDescriptorService .getByApplication ( eq ( ApplicationKey .from ( "myapplication" ) ) ) ).thenReturn (
188188 AdminToolDescriptors .empty () );
189- when ( widgetDescriptorService .getByApplication ( eq ( ApplicationKey .from ( "myapplication" ) ) ) ).thenReturn ( Descriptors .empty () );
189+ when ( extensionDescriptorService .getByApplication ( eq ( ApplicationKey .from ( "myapplication" ) ) ) ).thenReturn ( Descriptors .empty () );
190190
191191 runFunction ( "lib/request-verifier-test.js" , "testAssetRequestOnAdminWithoutToolsAndWidgets" );
192192 }
@@ -233,8 +233,8 @@ void testAssetRequestInAdminMode()
233233 when ( adminToolDescriptorService .getByApplication ( eq ( applicationKey ) ) ).thenReturn (
234234 AdminToolDescriptors .from ( AdminToolDescriptor .create ().build () ) );
235235
236- when ( widgetDescriptorService .getByApplication ( eq ( applicationKey ) ) ).thenReturn (
237- Descriptors .from ( WidgetDescriptor .create ().key ( DescriptorKey .from ( applicationKey , "widgetName" ) ).build () ) );
236+ when ( extensionDescriptorService .getByApplication ( eq ( applicationKey ) ) ).thenReturn (
237+ Descriptors .from ( AdminExtensionDescriptor .create ().key ( DescriptorKey .from ( applicationKey , "widgetName" ) ).build () ) );
238238
239239 runFunction ( "lib/request-verifier-test.js" , "testAssetRequestInAdminMode" );
240240 }
0 commit comments