@Test public void cannotParseMediaTypesWithDanglingQuotedPair() throws Exception { try { createParam("myparam=\"a"+Character.toString('\\')+offending()+"a\""); fail("Should fail for dangling quoted pair"); } catch (final InvalidMediaTypeException e) { assertThat(Throwables.getRootCause(e).getMessage(),containsString("Invalid quoted-pair character '"+offending()+"'")); } }
@Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters); }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters); @Override String type(); @Override String subType(); @Override Charset charset(); @Override String suffix(); @Override Map<String,String> parameters(); @Override boolean isWildcard(); @Override String toHeader(); @Override int hashCode(); @Override boolean equals(final Object other); @Override String toString(); }
ImmutableMediaType implements MediaType { @Override public String toString() { return MoreObjects. toStringHelper(getClass()). omitNullValues(). add("type",this.type). add("subtype",this.subtype). add("suffix",this.suffix). add("parameters",this.parameters). toString(); } ImmutableMediaType(final MediaRangeSyntax syntax, final String type, final String subtype, String suffix, final Map<String, String> parameters); @Override String type(); @Override String subType(); @Override Charset charset(); @Override String suffix(); @Override Map<String,String> parameters(); @Override boolean isWildcard(); @Override String toHeader(); @Override int hashCode(); @Override boolean equals(final Object other); @Override String toString();  }