use of me.vertretungsplan.objects.credential.UserPasswordCredential in project substitution-schedule-parser by vertretungsplanme.
the class LoginHandlerTest method setUp.
@Before
public void setUp() throws JSONException {
baseurl = "http://localhost:" + wireMockRule.port();
correct = new UserPasswordCredential("user", "password");
wrong = new UserPasswordCredential("user", "wrong");
JSONObject loginBasic = new JSONObject();
loginBasic.put("type", "basic");
dataBasic = getSubstitutionScheduleData(loginBasic);
JSONObject loginBasicUrl = new JSONObject();
loginBasicUrl.put("type", "basic");
loginBasicUrl.put("url", baseurl + "/index.html");
dataBasicUrl = getSubstitutionScheduleData(loginBasicUrl);
JSONObject loginFixed = new JSONObject();
loginFixed.put("type", "fixed");
loginFixed.put("login", correct.getUsername());
loginFixed.put("password", correct.getPassword());
dataFixed = getSubstitutionScheduleData(loginFixed);
JSONObject loginPost = new JSONObject();
loginPost.put("type", "post");
loginPost.put("url", baseurl + "/index.html");
JSONObject postData = new JSONObject();
postData.put("user", "_login");
postData.put("password", "_password");
loginPost.put("data", postData);
dataPost = getSubstitutionScheduleData(loginPost);
JSONObject loginPostCheckUrl = new JSONObject();
loginPostCheckUrl.put("type", "post");
loginPostCheckUrl.put("url", baseurl + "/index.html");
loginPostCheckUrl.put("checkUrl", baseurl + "/index.html");
loginPostCheckUrl.put("checkText", "please login");
loginPostCheckUrl.put("data", postData);
dataPostCheckUrl = getSubstitutionScheduleData(loginPostCheckUrl);
JSONObject loginPostCheckText = new JSONObject();
loginPostCheckText.put("type", "post");
loginPostCheckText.put("url", baseurl + "/index.html");
loginPostCheckText.put("checkText", "wrong");
loginPostCheckText.put("data", postData);
dataPostCheckText = getSubstitutionScheduleData(loginPostCheckText);
JSONObject loginPostFormData = new JSONObject();
loginPostFormData.put("type", "post");
loginPostFormData.put("url", baseurl + "/index.html");
loginPostFormData.put("form-data", true);
loginPostFormData.put("data", postData);
dataPostFormData = getSubstitutionScheduleData(loginPostFormData);
}
Aggregations