Fix test since getExtendedKeyUsage doc disagrees
The documentation for X509Certificate#getExtendedKeyUsage says that it
must return an unmodifiable list. The test was testing the exact
opposite was true.
Change-Id: I0f99ed6c8f2ddcc59ce6b90b973ccabd0dce35f6
diff --git a/luni/src/test/java/tests/security/cert/X509Certificate2Test.java b/luni/src/test/java/tests/security/cert/X509Certificate2Test.java
index 2c9e2fb..03b0243 100644
--- a/luni/src/test/java/tests/security/cert/X509Certificate2Test.java
+++ b/luni/src/test/java/tests/security/cert/X509Certificate2Test.java
@@ -303,10 +303,21 @@
X509Certificate cert = generateCert(CERT_CORRECT);
List<String> l = cert.getExtendedKeyUsage();
assertNotNull(l);
- l.clear();
- l.add("Test");
- assertEquals(1, l.size());
- l.remove(0);
+
+ try {
+ l.clear();
+ } catch (UnsupportedOperationException expected) {
+ }
+
+ try {
+ l.add("Test");
+ } catch (UnsupportedOperationException expected) {
+ }
+
+ try {
+ l.remove(0);
+ } catch (UnsupportedOperationException expected) {
+ }
}
private static final String CERT_WITHOUT_BASIC