RestConf { public static String send(String url, String payload, String username, String password) { Assert.assertNotNull(url); Assert.assertNotNull(username); Assert.assertNotNull(password); try { httpClient.start(); Request request = httpClient.newRequest(url).method(Http.CREATE_IN_HTTP); request.content(new StringContentProvider(payload)); request.accept(OneM2M.Http.MIME.APPLICATION_JSON); request.header(OneM2M.Http.Header.CONTENT_TYPE, OneM2M.Http.MIME.APPLICATION_JSON); String authString = username + ":" + password; request.header("Authorization", "Basic " + Base64.getEncoder().encodeToString(authString.getBytes())); ContentResponse contentResponse = request.send(); String response = contentResponse.getContentAsString(); httpClient.stop(); return response; } catch (Exception e) { throw new AssertionError(e.getMessage()); } }  static String send(String url, String payload, String username, String password); static String defaultProvision(); static String defaultClear(); static String defaultProvision(String host); static String defaultClear(String host); final static String SCHEMA; final static String HOST; final static String PORT; final static String PROVISIONING_PATH; final static String CLEANUP_STORE_PATH; final static String URL_PROVISON; final static String URL_CLEAR; final static String PAYLOAD; final static String USERNAME; final static String PASSWORD; }
@Test(expected = AssertionError.class) public void restConf_null_value_of_url() { RestConf.send(RestConf.USERNAME, RestConf.PAYLOAD, RestConf.USERNAME, RestConf.PASSWORD); }
@Test(expected = AssertionError.class) public void restConf_null_value_of_username() { RestConf.send(RestConf.USERNAME, RestConf.PAYLOAD, null, RestConf.PASSWORD); }
@Test(expected = AssertionError.class) public void restConf_null_value_of_password() { RestConf.send(RestConf.USERNAME, RestConf.PAYLOAD, null, RestConf.PASSWORD); }