From 7604be6512e65666c00e1df46a7973ca38a206f5 Mon Sep 17 00:00:00 2001 From: Sanjay Dalal Date: Fri, 23 Apr 2010 23:32:09 +0000 Subject: [PATCH] CSPACE-1521 screen name is no more unique. only userid is unique across all realms including csip realm test: account M account/jaxb/src/main/resources/accounts_common.xsd M account/pstore/src/main/resources/db/mysql/account.sql M account/client/src/test/java/org/collectionspace/services/account/client/test/AccountServiceTest.java --- .../client/test/AccountServiceTest.java | 21 --------- .../src/main/resources/accounts_common.xsd | 43 +++++++++++++++++-- .../src/main/resources/db/mysql/account.sql | 2 +- 3 files changed, 41 insertions(+), 25 deletions(-) diff --git a/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountServiceTest.java b/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountServiceTest.java index 92826b3d3..97028e7b0 100644 --- a/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountServiceTest.java +++ b/services/account/client/src/test/java/org/collectionspace/services/account/client/test/AccountServiceTest.java @@ -130,27 +130,6 @@ public class AccountServiceTest extends AbstractServiceTestImpl { Assert.assertEquals(statusCode, Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); } - @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, - dependsOnMethods = {"create"}) - public void createForUniqueScreenName(String testName) throws Exception { - - setupCreate(testName); - - // Submit the request to the service and store the response. - AccountsCommon account = - createAccountInstance("barney", "otherUser", "hithere08", "barney@dinoland.com", - true, false, true, true); - AccountClient client = new AccountClient(); - ClientResponse res = client.create(account); - int statusCode = res.getStatus(); - - if (logger.isDebugEnabled()) { - logger.debug(testName + ": status = " + statusCode); - } - Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode), - invalidStatusCodeMessage(REQUEST_TYPE, statusCode)); - Assert.assertEquals(statusCode, Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()); - } @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class, dependsOnMethods = {"create"}) diff --git a/services/account/jaxb/src/main/resources/accounts_common.xsd b/services/account/jaxb/src/main/resources/accounts_common.xsd index 7ee4d8412..4fbc5d548 100644 --- a/services/account/jaxb/src/main/resources/accounts_common.xsd +++ b/services/account/jaxb/src/main/resources/accounts_common.xsd @@ -33,12 +33,18 @@ + + AccountsCommon is the account definition in CollectionSpace + - userId is unique across all realms and across all tenants in CollectionSpace + - password should be >8 and <24 chars in length + - tenant association is usually not required to be provided by the + service consumer. only in cases where a user in CollectionSpace + has access to the spaces of multiple tenants, this is used + to associate that user with more than one tenants + - - screen_name - @@ -92,6 +98,9 @@ + + userId is unique across all tenants in CollectionSpace + @@ -102,12 +111,23 @@ + + password should be >8 and <24 chars in length + + + + tenant association is usually not required to be provided by the + service consumer. only in cases where a user in CollectionSpace + has access to the spaces of multiple tenants, this is used + to associate that user with more than one tenants + + @@ -152,6 +172,11 @@ + + AccountsCommonList contains information about one or more + accounts. An instance of this type could be returned on + index and search operations. + @@ -180,6 +205,11 @@ + + + Status of the account in CollectionSpace + + @@ -188,6 +218,9 @@ + + AccountTenant defines the relationship between an account and a tenant + @@ -208,8 +241,12 @@ + + + Tenant defines the tenant in CollectionSpace + diff --git a/services/account/pstore/src/main/resources/db/mysql/account.sql b/services/account/pstore/src/main/resources/db/mysql/account.sql index 9156e70c2..c92067828 100644 --- a/services/account/pstore/src/main/resources/db/mysql/account.sql +++ b/services/account/pstore/src/main/resources/db/mysql/account.sql @@ -2,7 +2,7 @@ alter table accounts_tenants drop foreign key FKFDA649B05A9CEEB5; drop table if exists accounts_common; drop table if exists accounts_tenants; drop table if exists tenants; -create table accounts_common (csid varchar(128) not null, created_at datetime not null, email varchar(255) not null, mobile varchar(255), person_ref_name varchar(255), phone varchar(255), screen_name varchar(128) not null, status varchar(15) not null, updated_at datetime, userid varchar(128) not null, primary key (csid), unique (screen_name)); +create table accounts_common (csid varchar(128) not null, created_at datetime not null, email varchar(255) not null, mobile varchar(255), person_ref_name varchar(255), phone varchar(255), screen_name varchar(128) not null, status varchar(15) not null, updated_at datetime, userid varchar(128) not null, primary key (csid)); create table accounts_tenants (HJID bigint not null auto_increment, tenant_id varchar(128) not null, TENANTS_ACCOUNTSCOMMON_CSID varchar(128), primary key (HJID)); create table tenants (id varchar(128) not null, created_at datetime not null, name varchar(255) not null, updated_at datetime, primary key (id)); alter table accounts_tenants add index FKFDA649B05A9CEEB5 (TENANTS_ACCOUNTSCOMMON_CSID), add constraint FKFDA649B05A9CEEB5 foreign key (TENANTS_ACCOUNTSCOMMON_CSID) references accounts_common (csid); -- 2.47.3