package <%=packageName%>.web.rest;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.http.MediaType;

import java.io.IOException;
import java.nio.charset.Charset;

/**
 * Utility class for testing REST controllers.
 */
public class TestUtil {

    /** MediaType for JSON UTF8 */
    public static final MediaType APPLICATION_JSON_UTF8 = new MediaType(
            MediaType.APPLICATION_JSON.getType(),
            MediaType.APPLICATION_JSON.getSubtype(), Charset.forName("utf8"));

    /**
     * Convert an object to JSON byte array.
     *
     * @param object
     *            the object to convert
     * @return the JSON byte array
     * @throws IOException
     */
    public static byte[] convertObjectToJsonBytes(Object object)
            throws IOException {
        ObjectMapper mapper = new ObjectMapper();
        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
        return mapper.writeValueAsBytes(object);
    }
}

@@ -1023,11 +1023,454 @@
 );%0A    %7D
+%0A%0A    /**%0A     * Create a byte array with a specific size filled with specified data.%0A     *%0A     * @param size the size of the byte array%0A     * @param data the data to put in the byte array%0A     */%0A    public static byte%5B%5D createByteArray(int size, String data) %7B%0A        byte%5B%5D byteArray = new byte%5Bsize%5D;%0A        for (int i = 0; i %3C size; i++) %7B%0A            byteArray%5Bi%5D = Byte.parseByte(data, 2);%0A        %7D%0A        return byteArray;%0A    %7D
 %0A%7D%0A

revert create byte array method removal