summaryrefslogtreecommitdiff
path: root/qpid/java/systests/src
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-04-03 11:50:36 +0000
committerAlex Rudyy <orudyy@apache.org>2013-04-03 11:50:36 +0000
commit45fc3b612fe45ec01db5e6e6e65661b5d8898f1b (patch)
treefb8e07e544de7ea2168926b4ed7dda714f632e20 /qpid/java/systests/src
parent24b2431ab0f4cdb639122a3f1d54d66a657ecbc7 (diff)
downloadqpid-python-45fc3b612fe45ec01db5e6e6e65661b5d8898f1b.tar.gz
QPID-4695: Add validation of configured object names and IDs
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1463933 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
index 4ba2069dfd..09408572d7 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/AuthenticationProviderRestTest.java
@@ -24,6 +24,7 @@ import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import org.apache.qpid.server.model.AuthenticationProvider;
import org.apache.qpid.server.model.LifetimePolicy;
@@ -90,6 +91,22 @@ public class AuthenticationProviderRestTest extends QpidRestTestCase
assertProvider(false, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE, provider);
}
+ public void testUpdateAuthenticationProviderIdFails() throws Exception
+ {
+ String providerName = "test-provider";
+ Map<String, Object> attributes = new HashMap<String, Object>();
+ attributes.put(AuthenticationProvider.NAME, providerName);
+ attributes.put(AuthenticationProvider.TYPE, AnonymousAuthenticationManagerFactory.PROVIDER_TYPE);
+
+ int responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes);
+ assertEquals("Unexpected response code", 201, responseCode);
+
+ attributes.put(AuthenticationProvider.ID, UUID.randomUUID());
+
+ responseCode = getRestTestHelper().submitRequest("/rest/authenticationprovider/" + providerName, "PUT", attributes);
+ assertEquals("Update with new ID should fail", 409, responseCode);
+ }
+
public void testDeleteOfDefaultAuthenticationProviderFails() throws Exception
{
String providerName = TestBrokerConfiguration.ENTRY_NAME_AUTHENTICATION_PROVIDER;