use of com.agiletec.aps.system.services.user.UserDetails in project entando-core by entando.
the class DatabaseControllerIntegrationTest method testReports_2.
@Test
public void testReports_2() throws Exception {
UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24").grantedToRoleAdmin().build();
String accessToken = mockOAuthInterceptor(user);
ResultActions result = mockMvc.perform(get("/database").param("page", "2").header("Authorization", "Bearer " + accessToken));
result.andExpect(status().isNotFound());
}
use of com.agiletec.aps.system.services.user.UserDetails in project entando-core by entando.
the class DatabaseControllerIntegrationTest method testGetStatus.
@Test
public void testGetStatus() throws Exception {
UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24").grantedToRoleAdmin().build();
String accessToken = mockOAuthInterceptor(user);
ResultActions result = mockMvc.perform(get("/database/status").header("Authorization", "Bearer " + accessToken));
result.andExpect(status().isOk());
}
use of com.agiletec.aps.system.services.user.UserDetails in project entando-core by entando.
the class DatabaseControllerIntegrationTest method testInitBackup.
@Test
public void testInitBackup() throws Exception {
UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24").grantedToRoleAdmin().build();
String accessToken = mockOAuthInterceptor(user);
ResultActions result = mockMvc.perform(get("/database/initBackup").header("Authorization", "Bearer " + accessToken));
result.andExpect(status().isOk());
}
use of com.agiletec.aps.system.services.user.UserDetails in project entando-core by entando.
the class DatabaseControllerTest method getReports.
@Test
public void getReports() throws Exception {
UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24").grantedToRoleAdmin().build();
String accessToken = mockOAuthInterceptor(user);
ResultActions result = mockMvc.perform(get("/database").header("Authorization", "Bearer " + accessToken));
System.out.println(result.andReturn().getResponse().getContentAsString());
result.andExpect(status().isOk());
}
use of com.agiletec.aps.system.services.user.UserDetails in project entando-core by entando.
the class DatabaseControllerTest method getReport_1.
@Test
public void getReport_1() throws Exception {
UserDetails user = new OAuth2TestUtils.UserBuilder("jack_bauer", "0x24").grantedToRoleAdmin().build();
String accessToken = mockOAuthInterceptor(user);
String xml = null;
DataSourceDumpReport report = new DataSourceDumpReport(xml);
when(databaseManager.getBackupReport(ArgumentMatchers.anyString())).thenReturn(report);
ResultActions result = mockMvc.perform(get("/database/report/{reportCode}", new Object[] { "develop" }).header("Authorization", "Bearer " + accessToken));
result.andExpect(status().isOk());
}
Aggregations