use of org.entando.entando.web.common.model.PagedMetadata in project entando-core by entando.
the class WidgetControllerTest method testGetWidgetList.
@Test
public void testGetWidgetList() throws Exception {
UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24").grantedToRoleAdmin().build();
String accessToken = mockOAuthInterceptor(user);
PagedMetadata<WidgetDto> pagedDto = new PagedMetadata<>();
when(widgetService.getWidgets(any())).thenReturn(pagedDto);
// @formatter:off
ResultActions result = mockMvc.perform(get("/widgets").header("Authorization", "Bearer " + accessToken));
String response = result.andExpect(status().isOk()).andReturn().getResponse().getContentAsString();
assertNotNull(response);
}
Aggregations