示例#1
0
 @Test(expected = ClientForbiddenException.class)
 public void export_account_denied() throws JsonProcessingException {
   TeacherContext teacherContext1 = support.doCreateTeacher();
   TeacherContext teacherContext2 = support.doCreateTeacher();
   support
       .client()
       .account()
       .asTeacher(teacherContext2)
       .call(client -> client.exportAccount(Locale.ENGLISH, teacherContext1.getTeacher().getId()));
 }
示例#2
0
 @Test
 public void export_account() throws JsonProcessingException {
   TeacherContext teacherContext = support.doCreateTeacher();
   JsonNode data =
       support
           .client()
           .account()
           .asAdmin()
           .call(
               client ->
                   client.exportAccount(Locale.ENGLISH, teacherContext.getTeacher().getId()));
   assertNotNull("Returned data", data);
   assertEquals(
       ObjectMapperFactory.create().writeValueAsString(data), "{\"version\":2,\"schools\":[]}");
 }