### Question:
Header { public String getValue() { return value; } Header(String headerLine); String getValue(); String getValue(String key); String getName(); static final String QUOTE; }### Answer:
@Test public void fetchMainValue() { Header header = new Header("Content-type: text/plain"); assertThat(header.getValue(), equalTo("text/plain")); }
@Test public void whenSeparatorPresent_truncateValue() { Header header = new Header("Content-type: text/plain; more stuff"); assertThat(header.getValue(), equalTo("text/plain")); }
@Test public void whenParametersPresent_fetchValues() { Header header = new Header("Content-disposition: form-data; name=\"file1\"; filename=\"a.txt\""); assertThat(header.getValue(), equalTo("form-data")); assertThat(header.getValue("name"), equalTo("file1")); assertThat(header.getValue("filename"), equalTo("a.txt")); }