MimeType.compareTo uses case-insensitive Charset (analogous to equals)

Issue: SPR-16458
This commit is contained in:
Juergen Hoeller
2018-02-02 13:44:07 +01:00
parent 4dc964544f
commit cfe7ff1c81
2 changed files with 45 additions and 31 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,12 +27,8 @@ import org.junit.Test;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.DefaultConversionService;
import static java.util.Collections.singletonMap;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static java.util.Collections.*;
import static org.junit.Assert.*;
/**
* Unit tests for {@link MimeType}.
@@ -335,6 +331,8 @@ public class MimeTypeTests {
MimeType m2 = new MimeType("text", "plain", singletonMap("charset", "utf-8"));
assertEquals(m1, m2);
assertEquals(m2, m1);
assertEquals(0, m1.compareTo(m2));
assertEquals(0, m2.compareTo(m1));
}
}