Пример #1
0
  @Test
  public void updateClass_normal_true() {
    String method_name = Thread.currentThread().getStackTrace()[1].getMethodName();
    logger.info(method_name + " START");

    String path = "/api/classes/update";
    // logger.info("       path:"+path);

    Map<String, String> eclass = new HashMap<>();
    eclass.put("id", "1");
    eclass.put("title", "Class 1 test update : " + Utils.now());

    given()
        .header("api_key", WEB_API_KEY)
        .header("auth_key", ADM1_AUTH_KEY)
        .contentType("application/json;charset=UTF-8")
        .body(eclass)
        .when()
        .post(path)
        .then()
        .log()
        .ifValidationFails()
        .assertThat()
        .statusCode(200);
  }
Пример #2
0
  @Override
  public void updateSchoolExam(User me, SchoolExam schoolExam) {

    schoolExam.setMdfusr(Constant.USER_SYS);
    schoolExam.setLstmdf(Utils.now());
    schoolExam.setMdfpgm(Constant.PGM_REST);

    if (me != null) {
      schoolExam.setMdfusr(me.getSso_id());
      ApiKey apiKey = me.getApi_key();
      String device = null;
      if (apiKey != null && apiKey.getApi_key() != null) {
        device = apiKey.getApi_key();
      }
      if (device != null) {
        schoolExam.setMdfwks(device);
      }
    }
    update(schoolExam);
  }
Пример #3
0
  @Override
  public void saveSchoolExam(User me, SchoolExam schoolExam) {

    schoolExam.setActflg("A");
    schoolExam.setCtdusr(Constant.USER_SYS);
    schoolExam.setCtddtm(Utils.now());
    schoolExam.setCtdpgm(Constant.PGM_REST);

    if (me != null) {
      schoolExam.setCtdusr(me.getSso_id());
      ApiKey apiKey = me.getApi_key();
      String device = null;
      if (apiKey != null && apiKey.getApi_key() != null) {
        device = apiKey.getApi_key();
      }
      if (device != null) {
        schoolExam.setCtdwks(device);
      }
    }

    save(schoolExam);
  }