HttpUtils { public static String createCookieHeaderValue(Collection<Cookie> cookies) { return cookies.stream() .map((c) -> c.getName() + "=" + c.getValue()) .collect(Collectors.joining("; ")); } private  HttpUtils(); static KeyStore getKeyStore(ScenarioContext context, String trustStoreFile, String password, String type); static boolean isPrintable(String mediaType); static Charset parseContentTypeCharset(String mimeType); static Map<String, String> parseContentTypeParams(String mimeType); static String getContentType(ScriptValue sv); static Map<String, Cookie> parseCookieHeaderString(String header); static String createCookieHeaderValue(Collection<Cookie> cookies); static Map<String, String> parseUriPattern(String pattern, String url); static final String normaliseUriPath(String uri); static List<Integer> calculatePathMatchScore(String path); static String generateMimeBoundaryMarker(); static String multiPartToString(List<MultiPartItem> items, String boundary); static final String HEADER_CONTENT_TYPE; static final String HEADER_CONTENT_LENGTH; static final String HEADER_ACCEPT; static final String HEADER_ALLOW; static final String HEADER_AC_ALLOW_ORIGIN; static final String HEADER_AC_ALLOW_METHODS; static final String HEADER_AC_REQUEST_HEADERS; static final String HEADER_AC_ALLOW_HEADERS; static final String CHARSET; static final Set<String> HTTP_METHODS; static final List<Integer> DEFAULT_PATH_SCORE; }
@Test public void testCreateCookieString() { Cookie c1 = new Cookie("foo", "bar"); Cookie c2 = new Cookie("hello", "world"); String header = HttpUtils.createCookieHeaderValue(Arrays.asList(c1, c2)); Match.equalsText(header, "foo=bar; hello=world"); }