@Test
public void shouldThrowExceptionWhenDanglingOpeningCharacterDetected() throws IOException {

    // given
    String text = "{ this has danglign opening character";
    StringReader reader = new StringReader(text);
    // when
    try {
        StreamPartReader.readPart(reader, '{', '}');
        fail("expected IllegalState exception but none thrown");
    } catch (IllegalStateException exception) {
        // then
        assertThat(exception).isInstanceOf(IllegalStateException.class);
    }
}