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<Response> 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"})
<xs:element name="accounts_common">
<xs:complexType>
<xs:annotation>
+ <xs:documentation>
+ 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
+ </xs:documentation>
<xs:appinfo>
<hj:entity>
<orm:table name="accounts_common">
- <orm:unique-constraint>
- <orm:column-name>screen_name</orm:column-name>
- </orm:unique-constraint>
</orm:table>
</hj:entity>
</xs:appinfo>
<!-- userid, could be calnet id, openid URI -->
<xs:element name="userId" type="xs:string" minOccurs="1" maxOccurs="1">
<xs:annotation>
+ <xs:documentation>
+ userId is unique across all tenants in CollectionSpace
+ </xs:documentation>
<xs:appinfo>
<hj:basic>
<orm:column name="userid" length="128" nullable="false"/>
<!-- optional base64 encoded password for default identity provider only -->
<xs:element name="password" type="xs:base64Binary" minOccurs="0" maxOccurs="1">
<xs:annotation>
+ <xs:documentation>
+ password should be >8 and <24 chars in length
+ </xs:documentation>
<xs:appinfo>
<hj:ignored/>
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="tenants" type="account_tenant" minOccurs="1" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ 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
+ </xs:documentation>
+ </xs:annotation>
</xs:element>
<xs:element name="status" type="status">
<xs:annotation>
<xs:element name="accounts-common-list">
<xs:complexType>
<xs:annotation>
+ <xs:documentation>
+ AccountsCommonList contains information about one or more
+ accounts. An instance of this type could be returned on
+ index and search operations.
+ </xs:documentation>
<xs:appinfo>
<hj:ignored/>
</xs:appinfo>
</xs:element>
<xs:simpleType name="status">
+ <xs:annotation>
+ <xs:documentation>
+ Status of the account in CollectionSpace
+ </xs:documentation>
+ </xs:annotation>
<xs:restriction base="xs:string">
<xs:enumeration value="active" />
<xs:enumeration value="inactive" />
<xs:complexType name="account_tenant">
<xs:annotation>
+ <xs:documentation>
+ AccountTenant defines the relationship between an account and a tenant
+ </xs:documentation>
<xs:appinfo>
<hj:entity>
<orm:table name="accounts_tenants">
</xs:sequence>
</xs:complexType>
+ <!-- FIXME tenant definition could be in a separate schema -->
<xs:complexType name="tenant">
<xs:annotation>
+ <xs:documentation>
+ Tenant defines the tenant in CollectionSpace
+ </xs:documentation>
<xs:appinfo>
<hj:entity>
<orm:table name="tenants"/>
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);