@Test
public void shouldWriteExpectedOutput() throws IOException {

	// Given
	String contentString = "test test test";
	byte[] content = contentString.getBytes();
	final InputStream in = new ByteArrayInputStream(content);
	AbstractPart mock = createPartWithInputStream(name, in);
	ByteArrayOutputStream out = new ByteArrayOutputStream();
	Part part = new TestPart(name, mock);
	String expected = "Content-Disposition: form-data; name=\"" + name + "\"\r\n\r\n" + contentString + "\r\n";
	// When
	part.write(out);
	// Then
	byte[] result = out.toByteArray();
	assertThat(new String(result), is(expected));
}