Examples of postForObject()


Examples of org.springframework.web.client.RestTemplate.postForObject()

        //设置一个错误的签名
        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeaaaaa");
        form.add("sign", sign);

        for (int i = 0; i < 11; i++) {
            restTemplate.postForObject(SERVER_URL, form, String.class);
        }

        String response = restTemplate.postForObject(SERVER_URL, form, String.class);
        System.out.println("response1:" + response);
        assertTrue(response.indexOf("code=\"" + MainErrorType.EXCEED_APP_INVOKE_LIMITED.value() + "\"") > -1);
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        for (int i = 0; i < 11; i++) {
            restTemplate.postForObject(SERVER_URL, form, String.class);
        }

        String response = restTemplate.postForObject(SERVER_URL, form, String.class);
        System.out.println("response1:" + response);
        assertTrue(response.indexOf("code=\"" + MainErrorType.EXCEED_APP_INVOKE_LIMITED.value() + "\"") > -1);
    }

    /**
 
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");

        form.add("sign", sign);
        form.add("password", "123456"); //password无需签名,所以放在最后

        String response = restTemplate.postForObject(
                SERVER_URL, form, String.class);
        System.out.println("response:\n" + response);

        //返回业务的错误报文
        assertTrue(response.indexOf("isv.user-add-service-error:USER_NAME_RESERVED") > 0);
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        //对请求参数列表进行签名
        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");
        form.add("sign", sign);

        String response = restTemplate.postForObject(
                SERVER_URL, form, String.class);
        System.out.println("response:\n" + response);
        assertTrue(response.indexOf("the userName can't be jhonson!") > -1);
    }
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        //对请求参数列表进行签名
        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");
        form.add("sign", sign);


        String response = restTemplate.postForObject(
                SERVER_URL, form, String.class);
        System.out.println("response:" + response);
        assertTrue(response.indexOf("isp.user-timeout-service-timeout") > -1);
    }
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        //对请求参数列表进行签名
        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");
        form.add("sign", sign);

        String response = restTemplate.postForObject(
                SERVER_URL, form, String.class);
        System.out.println("response:\n" + response);
        assertTrue(response.indexOf("code=\"5\"") > -1);
    }
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");
        form.add("sign", sign);

        long begin = System.currentTimeMillis();
        for (int i = 0; i < 100; i++) {
            String response = restTemplate.postForObject(
                    SERVER_URL, form, String.class);
            assertTrue(response.indexOf("<createUserResponse") > -1);
        }
        System.out.println("time elapsed:" + (System.currentTimeMillis() - begin));
    }
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");
        form.add("sign", sign);

        form.add("photo", "png@" + Base64.encodeBase64String(uploadFile.getContent())); //文件不进行签名

        String response = restTemplate.postForObject(
                SERVER_URL, form, String.class);
        System.out.println("response:\n" + response);
        assertTrue(response.indexOf("png") > -1);
    }
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");
        form.add("sign", sign);

        form.add("photo", "exe@" + Base64.encodeBase64String(uploadFile.getContent())); //文件不进行签名

        String response = restTemplate.postForObject(
                SERVER_URL, form, String.class);
        System.out.println("response:\n" + response);
        assertTrue(response.indexOf(MainErrorType.UPLOAD_FAIL.value()) > -1);
    }
View Full Code Here

Examples of org.springframework.web.client.RestTemplate.postForObject()

        String sign = RopUtils.sign(form.toSingleValueMap(), "abcdeabcdeabcdeabcdeabcde");
        form.add("sign", sign);

        form.add("photo", "png@" + Base64.encodeBase64String(uploadFile.getContent())); //文件不进行签名

        String response = restTemplate.postForObject(SERVER_URL, form, String.class);
        System.out.println("response:\n" + response);
        assertTrue(response.indexOf(MainErrorType.UPLOAD_FAIL.value()) > -1);
    }

    @Test
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.