@Test public void test_mimetype_compares_two_indentical_instances_correctly () { final MimeType one = MimeType.of(MimeType.Type.APPLICATION, MimeType.SubType.of("json")); final MimeType two = MimeType.of(MimeType.Type.APPLICATION, MimeType.SubType.of("json")); assertThat(one).isEqualTo(two); assertThat(one.hashCode()).isEqualTo(two.hashCode()); }
@Test public void test_mimetype_compares_two_different_instances_correctly () { final MimeType one = MimeType.of(MimeType.Type.APPLICATION, MimeType.SubType.of("json")); final MimeType two = MimeType.of(MimeType.Type.APPLICATION, MimeType.SubType.of(MimeType.Facet.STANDARD, "schema", Optional.of("json"))); assertThat(one).isNotEqualTo(two); assertThat(one.hashCode()).isNotEqualTo(two.hashCode()); }