You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2012/03/15 11:17:24 UTC
svn commit: r1300882 [21/22] - in /incubator/syncope/trunk:
build-tools/src/main/java/org/syncope/buildtools/
client/src/main/java/org/syncope/annotation/
client/src/main/java/org/syncope/client/
client/src/main/java/org/syncope/client/http/ client/src...
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConfigurationTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConfigurationTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConfigurationTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConfigurationTestITCase.java Thu Mar 15 10:17:12 2012
@@ -36,51 +36,40 @@ public class ConfigurationTestITCase ext
configurationTO.setKey("testKey");
configurationTO.setValue("testValue");
- ConfigurationTO newConfigurationTO = restTemplate.postForObject(
- BASE_URL + "configuration/create",
+ ConfigurationTO newConfigurationTO = restTemplate.postForObject(BASE_URL + "configuration/create",
configurationTO, ConfigurationTO.class);
assertEquals(configurationTO, newConfigurationTO);
}
@Test
- public void delete()
- throws UnsupportedEncodingException {
+ public void delete() throws UnsupportedEncodingException {
try {
- restTemplate.delete(BASE_URL + "configuration/delete/{key}.json",
- "nonExistent");
+ restTemplate.delete(BASE_URL + "configuration/delete/{key}.json", "nonExistent");
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
}
- ConfigurationTO tokenLengthTO = restTemplate.getForObject(
- BASE_URL + "configuration/read/{key}.json",
- ConfigurationTO.class,
- "token.length");
+ ConfigurationTO tokenLengthTO = restTemplate.getForObject(BASE_URL + "configuration/read/{key}.json",
+ ConfigurationTO.class, "token.length");
- restTemplate.delete(BASE_URL + "configuration/delete/{key}.json",
- "token.length");
+ restTemplate.delete(BASE_URL + "configuration/delete/{key}.json", "token.length");
try {
- restTemplate.getForObject(
- BASE_URL + "configuration/read/{key}.json",
- ConfigurationTO.class,
- "token.length");
+ restTemplate
+ .getForObject(BASE_URL + "configuration/read/{key}.json", ConfigurationTO.class, "token.length");
} catch (HttpStatusCodeException e) {
assertEquals(e.getStatusCode(), HttpStatus.NOT_FOUND);
}
- ConfigurationTO newConfigurationTO = restTemplate.postForObject(
- BASE_URL + "configuration/create",
+ ConfigurationTO newConfigurationTO = restTemplate.postForObject(BASE_URL + "configuration/create",
tokenLengthTO, ConfigurationTO.class);
assertEquals(tokenLengthTO, newConfigurationTO);
}
@Test
public void list() {
- List<ConfigurationTO> configurations = Arrays.asList(
- restTemplate.getForObject(
- BASE_URL + "configuration/list.json",
- ConfigurationTO[].class));
+ List<ConfigurationTO> configurations = Arrays.asList(restTemplate.getForObject(BASE_URL
+ + "configuration/list.json", ConfigurationTO[].class));
assertNotNull(configurations);
for (ConfigurationTO configuration : configurations) {
assertNotNull(configuration);
@@ -89,8 +78,7 @@ public class ConfigurationTestITCase ext
@Test
public void read() {
- ConfigurationTO configurationTO = restTemplate.getForObject(BASE_URL
- + "configuration/read/{key}.json",
+ ConfigurationTO configurationTO = restTemplate.getForObject(BASE_URL + "configuration/read/{key}.json",
ConfigurationTO.class, "token.expireTime");
assertNotNull(configurationTO);
@@ -102,8 +90,7 @@ public class ConfigurationTestITCase ext
configurationTO.setKey("token.expireTime");
configurationTO.setValue("61");
- ConfigurationTO newConfigurationTO = restTemplate.postForObject(
- BASE_URL + "configuration/update",
+ ConfigurationTO newConfigurationTO = restTemplate.postForObject(BASE_URL + "configuration/update",
configurationTO, ConfigurationTO.class);
assertEquals(configurationTO, newConfigurationTO);
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConnInstanceTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConnInstanceTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConnInstanceTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ConnInstanceTestITCase.java Thu Mar 15 10:17:12 2012
@@ -45,20 +45,19 @@ import org.syncope.types.ConnConfPropert
import org.syncope.types.ConnectorCapability;
public class ConnInstanceTestITCase extends AbstractTest {
-
+
private static String connidSoapVersion;
-
+
private static String connidDbTableVersion;
-
+
private static String bundlesDirectory;
-
+
@BeforeClass
public static void init() {
Properties props = new Properties();
InputStream propStream = null;
try {
- propStream = ConnInstanceTestITCase.class.getResourceAsStream(
- "/bundles.properties");
+ propStream = ConnInstanceTestITCase.class.getResourceAsStream("/bundles.properties");
props.load(propStream);
connidSoapVersion = props.getProperty("connid.soap.version");
connidDbTableVersion = props.getProperty("connid.db.table.version");
@@ -77,15 +76,14 @@ public class ConnInstanceTestITCase exte
assertNotNull(connidSoapVersion);
assertNotNull(bundlesDirectory);
}
-
+
@Test(expected = SyncopeClientCompositeErrorException.class)
public void createWithException() {
ConnInstanceTO connectorTO = new ConnInstanceTO();
-
- restTemplate.postForObject(BASE_URL + "connector/create.json",
- connectorTO, ConnInstanceTO.class);
+
+ restTemplate.postForObject(BASE_URL + "connector/create.json", connectorTO, ConnInstanceTO.class);
}
-
+
@Test
public void create() {
ConnInstanceTO connectorTO = new ConnInstanceTO();
@@ -98,21 +96,20 @@ public class ConnInstanceTestITCase exte
// set bundle name
connectorTO.setBundleName("org.connid.bundles.soap");
-
+
connectorTO.setDisplayName("Display name");
// set the connector configuration using PropertyTO
Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
+
ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
endpointSchema.setName("endpoint");
endpointSchema.setType(String.class.getName());
endpointSchema.setRequired(true);
ConnConfProperty endpoint = new ConnConfProperty();
endpoint.setSchema(endpointSchema);
- endpoint.setValues(Collections.singletonList(
- "http://localhost:8888/wssample/services"));
-
+ endpoint.setValues(Collections.singletonList("http://localhost:8888/wssample/services"));
+
ConnConfPropSchema servicenameSchema = new ConnConfPropSchema();
servicenameSchema.setName("servicename");
servicenameSchema.setType(String.class.getName());
@@ -120,7 +117,7 @@ public class ConnInstanceTestITCase exte
ConnConfProperty servicename = new ConnConfProperty();
servicename.setSchema(servicenameSchema);
servicename.setValues(Collections.singletonList("Provisioning"));
-
+
conf.add(endpoint);
conf.add(servicename);
@@ -131,62 +128,55 @@ public class ConnInstanceTestITCase exte
connectorTO.addCapability(ConnectorCapability.TWO_PHASES_CREATE);
connectorTO.addCapability(ConnectorCapability.ONE_PHASE_CREATE);
connectorTO.addCapability(ConnectorCapability.TWO_PHASES_UPDATE);
-
- ConnInstanceTO actual = restTemplate.postForObject(
- BASE_URL + "connector/create.json",
- connectorTO, ConnInstanceTO.class);
-
+
+ ConnInstanceTO actual = restTemplate.postForObject(BASE_URL + "connector/create.json", connectorTO,
+ ConnInstanceTO.class);
+
assertNotNull(actual);
-
+
assertEquals(actual.getBundleName(), connectorTO.getBundleName());
assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
assertEquals(actual.getVersion(), connectorTO.getVersion());
assertEquals("Display name", actual.getDisplayName());
assertEquals(connectorTO.getCapabilities(), actual.getCapabilities());
-
+
Throwable t = null;
// check for the updating
connectorTO.setId(actual.getId());
-
+
connectorTO.removeCapability(ConnectorCapability.TWO_PHASES_UPDATE);
actual = null;
try {
- actual = restTemplate.postForObject(
- BASE_URL + "connector/update.json",
- connectorTO, ConnInstanceTO.class);
+ actual = restTemplate.postForObject(BASE_URL + "connector/update.json", connectorTO, ConnInstanceTO.class);
} catch (HttpStatusCodeException e) {
LOG.error("update failed", e);
t = e;
}
-
+
assertNull(t);
assertNotNull(actual);
assertEquals(connectorTO.getCapabilities(), actual.getCapabilities());
// check also for the deletion of the created object
try {
- restTemplate.delete(
- BASE_URL + "connector/delete/{connectorId}.json",
- String.valueOf(actual.getId()));
+ restTemplate.delete(BASE_URL + "connector/delete/{connectorId}.json", String.valueOf(actual.getId()));
} catch (HttpStatusCodeException e) {
LOG.error("delete failed", e);
t = e;
}
-
+
assertNull(t);
// check the non existence
try {
- restTemplate.getForObject(
- BASE_URL + "connector/read/{connectorId}",
- ConnInstanceTO.class,
- String.valueOf(actual.getId()));
+ restTemplate.getForObject(BASE_URL + "connector/read/{connectorId}", ConnInstanceTO.class, String
+ .valueOf(actual.getId()));
} catch (HttpStatusCodeException e) {
assertEquals(e.getStatusCode(), HttpStatus.NOT_FOUND);
}
}
-
+
@Test
public void update() {
ConnInstanceTO connectorTO = new ConnInstanceTO();
@@ -205,17 +195,15 @@ public class ConnInstanceTestITCase exte
// set the connector configuration using PropertyTO
Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
+
ConnConfPropSchema endpointSchema = new ConnConfPropSchema();
endpointSchema.setName("endpoint");
endpointSchema.setType(String.class.getName());
endpointSchema.setRequired(true);
ConnConfProperty endpoint = new ConnConfProperty();
endpoint.setSchema(endpointSchema);
- endpoint.setValues(
- Collections.singletonList(
- "http://localhost:8888/wssample/services"));
-
+ endpoint.setValues(Collections.singletonList("http://localhost:8888/wssample/services"));
+
ConnConfPropSchema servicenameSchema = new ConnConfPropSchema();
servicenameSchema.setName("servicename");
servicenameSchema.setType(String.class.getName());
@@ -223,47 +211,42 @@ public class ConnInstanceTestITCase exte
ConnConfProperty servicename = new ConnConfProperty();
servicename.setSchema(servicenameSchema);
servicename.setValues(Collections.singletonList("Provisioning"));
-
+
conf.add(endpoint);
conf.add(servicename);
// set connector configuration
connectorTO.setConfiguration(conf);
-
- ConnInstanceTO actual = (ConnInstanceTO) restTemplate.postForObject(
- BASE_URL + "connector/update.json",
+
+ ConnInstanceTO actual = (ConnInstanceTO) restTemplate.postForObject(BASE_URL + "connector/update.json",
connectorTO, ConnInstanceTO.class);
-
+
assertNotNull(actual);
-
- actual = restTemplate.getForObject(
- BASE_URL + "connector/read/{connectorId}",
- ConnInstanceTO.class,
- String.valueOf(actual.getId()));
-
+
+ actual = restTemplate.getForObject(BASE_URL + "connector/read/{connectorId}", ConnInstanceTO.class, String
+ .valueOf(actual.getId()));
+
assertNotNull(actual);
assertEquals(actual.getBundleName(), connectorTO.getBundleName());
assertEquals(actual.getConnectorName(), connectorTO.getConnectorName());
assertEquals(actual.getVersion(), connectorTO.getVersion());
}
-
+
@Test
public void issueSYNCOPE10() {
// ----------------------------------
// Copy resource and connector in order to create new objects.
// ----------------------------------
// Retrieve a connector instance template.
- ConnInstanceTO connInstanceTO = restTemplate.getForObject(
- BASE_URL + "connector/read/{connectorId}",
+ ConnInstanceTO connInstanceTO = restTemplate.getForObject(BASE_URL + "connector/read/{connectorId}",
ConnInstanceTO.class, 103L);
-
+
assertNotNull(connInstanceTO);
// check for resource
- List<ResourceTO> resources = Arrays.asList(restTemplate.getForObject(
- BASE_URL + "resource/list.json?connInstanceId=103",
- ResourceTO[].class));
-
+ List<ResourceTO> resources = Arrays.asList(restTemplate.getForObject(BASE_URL
+ + "resource/list.json?connInstanceId=103", ResourceTO[].class));
+
assertEquals(1, resources.size());
// Retrieve a resource TO template.
@@ -280,13 +263,12 @@ public class ConnInstanceTestITCase exte
// ----------------------------------
// Create a new connector instance.
// ----------------------------------
- connInstanceTO = restTemplate.postForObject(
- BASE_URL + "connector/create.json",
- connInstanceTO, ConnInstanceTO.class);
-
+ connInstanceTO = restTemplate.postForObject(BASE_URL + "connector/create.json", connInstanceTO,
+ ConnInstanceTO.class);
+
assertNotNull(connInstanceTO);
assertTrue(connInstanceTO.getCapabilities().isEmpty());
-
+
long connId = connInstanceTO.getId();
// Link resourceTO to the new connector instance.
@@ -296,16 +278,13 @@ public class ConnInstanceTestITCase exte
// ----------------------------------
// Check for connector instance update after resource creation.
// ----------------------------------
- resourceTO = restTemplate.postForObject(
- BASE_URL + "resource/create.json",
- resourceTO, ResourceTO.class);
-
+ resourceTO = restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
+
assertNotNull(resourceTO);
-
- resources = Arrays.asList(restTemplate.getForObject(
- BASE_URL + "resource/list.json?connInstanceId=" + connId,
+
+ resources = Arrays.asList(restTemplate.getForObject(BASE_URL + "resource/list.json?connInstanceId=" + connId,
ResourceTO[].class));
-
+
assertEquals(1, resources.size());
// ----------------------------------
@@ -313,9 +292,8 @@ public class ConnInstanceTestITCase exte
// Check for spring bean.
// ----------------------------------
ConnInstanceTO connInstanceBean = restTemplate.getForObject(
- BASE_URL + "connector/{resourceName}/connectorBean",
- ConnInstanceTO.class, resourceTO.getName());
-
+ BASE_URL + "connector/{resourceName}/connectorBean", ConnInstanceTO.class, resourceTO.getName());
+
assertNotNull(connInstanceBean);
assertTrue(connInstanceBean.getCapabilities().isEmpty());
// ----------------------------------
@@ -324,59 +302,52 @@ public class ConnInstanceTestITCase exte
// Check for spring bean update after connector instance update.
// ----------------------------------
connInstanceTO.addCapability(ConnectorCapability.SEARCH);
-
- ConnInstanceTO actual = (ConnInstanceTO) restTemplate.postForObject(
- BASE_URL + "connector/update.json",
+
+ ConnInstanceTO actual = (ConnInstanceTO) restTemplate.postForObject(BASE_URL + "connector/update.json",
connInstanceTO, ConnInstanceTO.class);
-
+
assertNotNull(actual);
assertFalse(connInstanceTO.getCapabilities().isEmpty());
// check for spring bean update
- connInstanceBean = restTemplate.getForObject(
- BASE_URL + "connector/{resourceName}/connectorBean",
+ connInstanceBean = restTemplate.getForObject(BASE_URL + "connector/{resourceName}/connectorBean",
ConnInstanceTO.class, resourceTO.getName());
-
+
assertFalse(connInstanceBean.getCapabilities().isEmpty());
// ----------------------------------
}
-
+
@Test
public void deleteWithException() {
try {
- restTemplate.delete(
- BASE_URL + "connector/delete/{connectorId}.json", "0");
+ restTemplate.delete(BASE_URL + "connector/delete/{connectorId}.json", "0");
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
}
}
-
+
@Test
public void list() {
- List<ConnInstanceTO> connectorInstanceTOs = Arrays.asList(
- restTemplate.getForObject(
- BASE_URL + "connector/list.json", ConnInstanceTO[].class));
+ List<ConnInstanceTO> connectorInstanceTOs = Arrays.asList(restTemplate.getForObject(BASE_URL
+ + "connector/list.json", ConnInstanceTO[].class));
assertNotNull(connectorInstanceTOs);
assertFalse(connectorInstanceTOs.isEmpty());
for (ConnInstanceTO instance : connectorInstanceTOs) {
assertNotNull(instance);
}
}
-
+
@Test
public void read() {
- ConnInstanceTO connectorInstanceTO = restTemplate.getForObject(
- BASE_URL + "connector/read/{connectorId}.json",
+ ConnInstanceTO connectorInstanceTO = restTemplate.getForObject(BASE_URL + "connector/read/{connectorId}.json",
ConnInstanceTO.class, "100");
-
+
assertNotNull(connectorInstanceTO);
}
-
+
@Test
public void getBundles() {
- List<ConnBundleTO> bundles = Arrays.asList(
- restTemplate.getForObject(
- BASE_URL + "connector/bundle/list",
+ List<ConnBundleTO> bundles = Arrays.asList(restTemplate.getForObject(BASE_URL + "connector/bundle/list",
ConnBundleTO[].class));
assertNotNull(bundles);
assertFalse(bundles.isEmpty());
@@ -384,24 +355,22 @@ public class ConnInstanceTestITCase exte
assertNotNull(bundle);
}
}
-
+
@Test
public void getConnectorConfiguration() {
- List<ConnConfProperty> props = Arrays.asList(restTemplate.getForObject(
- BASE_URL + "connector/{connectorId}/configurationProperty/list",
- ConnConfProperty[].class, 104));
+ List<ConnConfProperty> props = Arrays.asList(restTemplate.getForObject(BASE_URL
+ + "connector/{connectorId}/configurationProperty/list", ConnConfProperty[].class, 104));
assertNotNull(props);
assertFalse(props.isEmpty());
}
-
+
@Test
public void checkHiddenProperty() {
- ConnInstanceTO connInstanceTO = restTemplate.getForObject(
- BASE_URL + "connector/read/{connectorId}.json",
+ ConnInstanceTO connInstanceTO = restTemplate.getForObject(BASE_URL + "connector/read/{connectorId}.json",
ConnInstanceTO.class, "100");
-
+
boolean check = false;
-
+
for (ConnConfProperty prop : connInstanceTO.getConfiguration()) {
if ("receiveTimeout".equals(prop.getSchema().getName())) {
check = true;
@@ -409,46 +378,38 @@ public class ConnInstanceTestITCase exte
}
assertTrue(check);
}
-
+
@Test
public void checkSelectedLanguage() {
// 1. Check Italian
- List<ConnInstanceTO> connectorInstanceTOs =
- Arrays.asList(restTemplate.getForObject(
- BASE_URL + "connector/list.json?lang=it",
- ConnInstanceTO[].class));
-
+ List<ConnInstanceTO> connectorInstanceTOs = Arrays.asList(restTemplate.getForObject(BASE_URL
+ + "connector/list.json?lang=it", ConnInstanceTO[].class));
+
Map<String, ConnConfProperty> instanceConfMap;
for (ConnInstanceTO instance : connectorInstanceTOs) {
- if ("org.connid.bundles.db.table".equals(
- instance.getBundleName())) {
-
+ if ("org.connid.bundles.db.table".equals(instance.getBundleName())) {
+
instanceConfMap = instance.getConfigurationMap();
- assertEquals("Utente", instanceConfMap.get("user").
- getSchema().getDisplayName());
+ assertEquals("Utente", instanceConfMap.get("user").getSchema().getDisplayName());
}
}
// 2. Check English (default)
- connectorInstanceTOs =
- Arrays.asList(restTemplate.getForObject(
- BASE_URL + "connector/list.json",
+ connectorInstanceTOs = Arrays.asList(restTemplate.getForObject(BASE_URL + "connector/list.json",
ConnInstanceTO[].class));
-
+
for (ConnInstanceTO instance : connectorInstanceTOs) {
- if ("org.connid.bundles.db.table".equals(
- instance.getBundleName())) {
-
+ if ("org.connid.bundles.db.table".equals(instance.getBundleName())) {
+
instanceConfMap = instance.getConfigurationMap();
- assertEquals("User", instanceConfMap.get("user").
- getSchema().getDisplayName());
+ assertEquals("User", instanceConfMap.get("user").getSchema().getDisplayName());
}
}
}
-
+
@Test
public void check() {
-
+
ConnInstanceTO connectorTO = new ConnInstanceTO();
// set connector version
@@ -459,12 +420,12 @@ public class ConnInstanceTestITCase exte
// set bundle name
connectorTO.setBundleName("org.connid.bundles.db.table");
-
+
connectorTO.setDisplayName("H2Test");
// set the connector configuration using PropertyTO
Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
-
+
ConnConfPropSchema userSchema = new ConnConfPropSchema();
userSchema.setName("user");
userSchema.setType(String.class.getName());
@@ -472,7 +433,7 @@ public class ConnInstanceTestITCase exte
ConnConfProperty user = new ConnConfProperty();
user.setSchema(userSchema);
user.setValues(Collections.singletonList("sa"));
-
+
ConnConfPropSchema keyColumnSchema = new ConnConfPropSchema();
keyColumnSchema.setName("keyColumn");
keyColumnSchema.setType(String.class.getName());
@@ -480,16 +441,15 @@ public class ConnInstanceTestITCase exte
ConnConfProperty keyColumn = new ConnConfProperty();
keyColumn.setSchema(keyColumnSchema);
keyColumn.setValues(Collections.singletonList("id"));
-
+
ConnConfPropSchema jdbcUrlTemplateSchema = new ConnConfPropSchema();
jdbcUrlTemplateSchema.setName("jdbcUrlTemplate");
jdbcUrlTemplateSchema.setType(String.class.getName());
jdbcUrlTemplateSchema.setRequired(true);
ConnConfProperty jdbcUrlTemplate = new ConnConfProperty();
jdbcUrlTemplate.setSchema(jdbcUrlTemplateSchema);
- jdbcUrlTemplate.setValues(Collections.singletonList(
- "jdbc:h2:tcp://localhost:9092/testdb"));
-
+ jdbcUrlTemplate.setValues(Collections.singletonList("jdbc:h2:tcp://localhost:9092/testdb"));
+
ConnConfPropSchema passwordColumnSchema = new ConnConfPropSchema();
passwordColumnSchema.setName("passwordColumn");
passwordColumnSchema.setType(String.class.getName());
@@ -497,7 +457,7 @@ public class ConnInstanceTestITCase exte
ConnConfProperty passwordColumn = new ConnConfProperty();
passwordColumn.setSchema(passwordColumnSchema);
passwordColumn.setValues(Collections.singletonList("password"));
-
+
ConnConfPropSchema tableSchema = new ConnConfPropSchema();
tableSchema.setName("table");
tableSchema.setType(String.class.getName());
@@ -505,7 +465,7 @@ public class ConnInstanceTestITCase exte
ConnConfProperty table = new ConnConfProperty();
table.setSchema(tableSchema);
table.setValues(Collections.singletonList("test"));
-
+
ConnConfPropSchema passwordSchema = new ConnConfPropSchema();
passwordSchema.setName("password");
passwordSchema.setType(GuardedString.class.getName());
@@ -513,7 +473,7 @@ public class ConnInstanceTestITCase exte
ConnConfProperty password = new ConnConfProperty();
password.setSchema(passwordSchema);
password.setValues(Collections.singletonList("sa"));
-
+
ConnConfPropSchema jdbcDriverSchema = new ConnConfPropSchema();
jdbcDriverSchema.setName("jdbcDriver");
jdbcDriverSchema.setType(String.class.getName());
@@ -521,7 +481,7 @@ public class ConnInstanceTestITCase exte
ConnConfProperty jdbcDriver = new ConnConfProperty();
jdbcDriver.setSchema(jdbcDriverSchema);
jdbcDriver.setValues(Collections.singletonList("org.h2.Driver"));
-
+
conf.add(user);
conf.add(keyColumn);
conf.add(jdbcUrlTemplate);
@@ -532,52 +492,42 @@ public class ConnInstanceTestITCase exte
// set connector configuration
connectorTO.setConfiguration(conf);
-
- Boolean verify = restTemplate.postForObject(
- BASE_URL + "connector/check.json",
- connectorTO, Boolean.class);
-
+
+ Boolean verify = restTemplate.postForObject(BASE_URL + "connector/check.json", connectorTO, Boolean.class);
+
assertTrue(verify);
-
+
conf.remove(password);
password.setValues(Collections.singletonList("password"));
conf.add(password);
-
- verify = restTemplate.postForObject(
- BASE_URL + "connector/check.json",
- connectorTO, Boolean.class);
-
+
+ verify = restTemplate.postForObject(BASE_URL + "connector/check.json", connectorTO, Boolean.class);
+
assertFalse(verify);
}
-
+
@Test
public void getSchemaNames() {
- ConnInstanceTO conn = restTemplate.getForObject(
- BASE_URL + "connector/read/{connectorId}.json",
+ ConnInstanceTO conn = restTemplate.getForObject(BASE_URL + "connector/read/{connectorId}.json",
ConnInstanceTO.class, "101");
-
- List<String> schemaNames = Arrays.asList(restTemplate.postForObject(
- BASE_URL + "connector/schema/list?showall=true",
- conn, String[].class));
+
+ List<String> schemaNames = Arrays.asList(restTemplate.postForObject(BASE_URL
+ + "connector/schema/list?showall=true", conn, String[].class));
assertNotNull(schemaNames);
assertFalse(schemaNames.isEmpty());
-
- schemaNames = Arrays.asList(restTemplate.postForObject(
- BASE_URL + "connector/schema/list",
- conn, String[].class));
+
+ schemaNames = Arrays.asList(restTemplate
+ .postForObject(BASE_URL + "connector/schema/list", conn, String[].class));
assertNotNull(schemaNames);
assertEquals(0, schemaNames.size());
-
- conn = restTemplate.getForObject(
- BASE_URL + "connector/read/{connectorId}.json",
- ConnInstanceTO.class, "104");
+
+ conn = restTemplate.getForObject(BASE_URL + "connector/read/{connectorId}.json", ConnInstanceTO.class, "104");
// to be used with overridden properties
conn.getConfiguration().clear();
-
- schemaNames = Arrays.asList(restTemplate.postForObject(
- BASE_URL + "connector//schema/list?showall=true",
- conn, String[].class, conn));
+
+ schemaNames = Arrays.asList(restTemplate.postForObject(BASE_URL + "connector//schema/list?showall=true", conn,
+ String[].class, conn));
assertNotNull(schemaNames);
assertFalse(schemaNames.isEmpty());
}
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/DerivedSchemaTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/DerivedSchemaTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/DerivedSchemaTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/DerivedSchemaTestITCase.java Thu Mar 15 10:17:12 2012
@@ -30,8 +30,7 @@ public class DerivedSchemaTestITCase ext
@Test
public void list() {
- List<DerivedSchemaTO> derivedSchemas = Arrays.asList(
- restTemplate.getForObject(BASE_URL
+ List<DerivedSchemaTO> derivedSchemas = Arrays.asList(restTemplate.getForObject(BASE_URL
+ "derivedSchema/user/list.json", DerivedSchemaTO[].class));
assertFalse(derivedSchemas.isEmpty());
for (DerivedSchemaTO derivedSchemaTO : derivedSchemas) {
@@ -41,8 +40,8 @@ public class DerivedSchemaTestITCase ext
@Test
public void read() {
- DerivedSchemaTO derivedSchemaTO = restTemplate.getForObject(BASE_URL
- + "derivedSchema/user/read/cn.json", DerivedSchemaTO.class);
+ DerivedSchemaTO derivedSchemaTO = restTemplate.getForObject(BASE_URL + "derivedSchema/user/read/cn.json",
+ DerivedSchemaTO.class);
assertNotNull(derivedSchemaTO);
}
@@ -52,14 +51,11 @@ public class DerivedSchemaTestITCase ext
schema.setName("derived");
schema.setExpression("derived_sx + '_' + derived_dx");
- DerivedSchemaTO actual = restTemplate.postForObject(BASE_URL
- + "derivedSchema/user/create.json",
- schema,
+ DerivedSchemaTO actual = restTemplate.postForObject(BASE_URL + "derivedSchema/user/create.json", schema,
DerivedSchemaTO.class);
assertNotNull(actual);
- actual = restTemplate.getForObject(BASE_URL
- + "derivedSchema/user/read/" + actual.getName() + ".json",
+ actual = restTemplate.getForObject(BASE_URL + "derivedSchema/user/read/" + actual.getName() + ".json",
DerivedSchemaTO.class);
assertNotNull(actual);
assertEquals(actual.getExpression(), "derived_sx + '_' + derived_dx");
@@ -67,20 +63,15 @@ public class DerivedSchemaTestITCase ext
@Test
public void delete() {
- DerivedSchemaTO schema = restTemplate.getForObject(BASE_URL
- + "derivedSchema/role/read/rderiveddata.json",
+ DerivedSchemaTO schema = restTemplate.getForObject(BASE_URL + "derivedSchema/role/read/rderiveddata.json",
DerivedSchemaTO.class);
assertNotNull(schema);
- restTemplate.delete(
- BASE_URL + "derivedSchema/role/delete/{schema}",
- schema.getName());
+ restTemplate.delete(BASE_URL + "derivedSchema/role/delete/{schema}", schema.getName());
Throwable t = null;
try {
- restTemplate.getForObject(BASE_URL
- + "derivedSchema/role/read/rderiveddata.json",
- DerivedSchemaTO.class);
+ restTemplate.getForObject(BASE_URL + "derivedSchema/role/read/rderiveddata.json", DerivedSchemaTO.class);
} catch (SyncopeClientCompositeErrorException e) {
t = e;
assertNotNull(e.getException(SyncopeClientExceptionType.NotFound));
@@ -90,22 +81,18 @@ public class DerivedSchemaTestITCase ext
@Test
public void update() {
- DerivedSchemaTO schema = restTemplate.getForObject(BASE_URL
- + "derivedSchema/membership/read/mderiveddata.json",
- DerivedSchemaTO.class);
+ DerivedSchemaTO schema = restTemplate.getForObject(
+ BASE_URL + "derivedSchema/membership/read/mderiveddata.json", DerivedSchemaTO.class);
assertNotNull(schema);
assertEquals("mderived_sx + '-' + mderived_dx", schema.getExpression());
schema.setExpression("mderived_sx + '.' + mderived_dx");
- schema = restTemplate.postForObject(BASE_URL
- + "derivedSchema/membership/update.json",
- schema,
+ schema = restTemplate.postForObject(BASE_URL + "derivedSchema/membership/update.json", schema,
DerivedSchemaTO.class);
assertNotNull(schema);
- schema = restTemplate.getForObject(BASE_URL
- + "derivedSchema/membership/read/mderiveddata.json",
+ schema = restTemplate.getForObject(BASE_URL + "derivedSchema/membership/read/mderiveddata.json",
DerivedSchemaTO.class);
assertNotNull(schema);
assertEquals("mderived_sx + '.' + mderived_dx", schema.getExpression());
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/LoggerTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/LoggerTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/LoggerTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/LoggerTestITCase.java Thu Mar 15 10:17:12 2012
@@ -30,8 +30,8 @@ public class LoggerTestITCase extends Ab
@Test
public void list() {
- List<LoggerTO> loggers =
- Arrays.asList(restTemplate.getForObject(BASE_URL + "logger/log/list", LoggerTO[].class));
+ List<LoggerTO> loggers = Arrays.asList(restTemplate
+ .getForObject(BASE_URL + "logger/log/list", LoggerTO[].class));
assertNotNull(loggers);
assertFalse(loggers.isEmpty());
for (LoggerTO logger : loggers) {
@@ -48,13 +48,13 @@ public class LoggerTestITCase extends Ab
@Test
public void setLevel() {
- List<LoggerTO> loggers = Arrays.asList(
- restTemplate.getForObject(BASE_URL + "logger/log/list", LoggerTO[].class));
+ List<LoggerTO> loggers = Arrays.asList(restTemplate
+ .getForObject(BASE_URL + "logger/log/list", LoggerTO[].class));
assertNotNull(loggers);
int startSize = loggers.size();
- LoggerTO logger = restTemplate.postForObject(
- BASE_URL + "logger/log/{name}/{level}", null, LoggerTO.class, "TEST", "INFO");
+ LoggerTO logger = restTemplate.postForObject(BASE_URL + "logger/log/{name}/{level}", null, LoggerTO.class,
+ "TEST", "INFO");
assertNotNull(logger);
assertEquals(SyncopeLoggerLevel.INFO, logger.getLevel());
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/NotificationTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/NotificationTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/NotificationTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/NotificationTestITCase.java Thu Mar 15 10:17:12 2012
@@ -36,8 +36,7 @@ public class NotificationTestITCase exte
@Test
public void read() {
- NotificationTO notificationTO = restTemplate.getForObject(
- BASE_URL + "notification/read/{notificationId}.json",
+ NotificationTO notificationTO = restTemplate.getForObject(BASE_URL + "notification/read/{notificationId}.json",
NotificationTO.class, "100");
assertNotNull(notificationTO);
@@ -45,9 +44,8 @@ public class NotificationTestITCase exte
@Test
public void list() {
- List<NotificationTO> notificationTOs = Arrays.asList(
- restTemplate.getForObject(
- BASE_URL + "notification/list.json", NotificationTO[].class));
+ List<NotificationTO> notificationTOs = Arrays.asList(restTemplate.getForObject(BASE_URL
+ + "notification/list.json", NotificationTO[].class));
assertNotNull(notificationTOs);
assertFalse(notificationTOs.isEmpty());
for (NotificationTO instance : notificationTOs) {
@@ -61,17 +59,14 @@ public class NotificationTestITCase exte
notificationTO.setTraceLevel(TraceLevel.SUMMARY);
notificationTO.addEvent("create");
- AttributeCond fullnameLeafCond1 =
- new AttributeCond(AttributeCond.Type.LIKE);
+ AttributeCond fullnameLeafCond1 = new AttributeCond(AttributeCond.Type.LIKE);
fullnameLeafCond1.setSchema("fullname");
fullnameLeafCond1.setExpression("%o%");
- AttributeCond fullnameLeafCond2 =
- new AttributeCond(AttributeCond.Type.LIKE);
+ AttributeCond fullnameLeafCond2 = new AttributeCond(AttributeCond.Type.LIKE);
fullnameLeafCond2.setSchema("fullname");
fullnameLeafCond2.setExpression("%i%");
- NodeCond about = NodeCond.getAndCond(
- NodeCond.getLeafCond(fullnameLeafCond1),
- NodeCond.getLeafCond(fullnameLeafCond2));
+ NodeCond about = NodeCond.getAndCond(NodeCond.getLeafCond(fullnameLeafCond1), NodeCond
+ .getLeafCond(fullnameLeafCond2));
notificationTO.setAbout(about);
@@ -85,9 +80,8 @@ public class NotificationTestITCase exte
notificationTO.setSubject("Test notification");
notificationTO.setTemplate("test");
- NotificationTO actual = restTemplate.postForObject(
- BASE_URL + "notification/create.json",
- notificationTO, NotificationTO.class);
+ NotificationTO actual = restTemplate.postForObject(BASE_URL + "notification/create.json", notificationTO,
+ NotificationTO.class);
assertNotNull(actual);
assertNotNull(actual.getId());
notificationTO.setId(actual.getId());
@@ -96,22 +90,17 @@ public class NotificationTestITCase exte
@Test
public void update() {
- NotificationTO notificationTO = restTemplate.getForObject(
- BASE_URL + "notification/read/{notificationId}.json",
+ NotificationTO notificationTO = restTemplate.getForObject(BASE_URL + "notification/read/{notificationId}.json",
NotificationTO.class, "100");
assertNotNull(notificationTO);
- notificationTO.setRecipients(
- NodeCond.getLeafCond(new MembershipCond()));
+ notificationTO.setRecipients(NodeCond.getLeafCond(new MembershipCond()));
SyncopeClientException exception = null;
try {
- restTemplate.postForObject(
- BASE_URL + "notification/update.json",
- notificationTO, NotificationTO.class);
+ restTemplate.postForObject(BASE_URL + "notification/update.json", notificationTO, NotificationTO.class);
} catch (SyncopeClientCompositeErrorException e) {
- exception = e.getException(
- SyncopeClientExceptionType.InvalidNotification);
+ exception = e.getException(SyncopeClientExceptionType.InvalidNotification);
}
assertNotNull(exception);
@@ -121,23 +110,20 @@ public class NotificationTestITCase exte
notificationTO.setRecipients(recipients);
- NotificationTO actual = restTemplate.postForObject(
- BASE_URL + "notification/update.json",
- notificationTO, NotificationTO.class);
+ NotificationTO actual = restTemplate.postForObject(BASE_URL + "notification/update.json", notificationTO,
+ NotificationTO.class);
assertNotNull(actual);
assertEquals(actual, notificationTO);
}
@Test
public void delete() {
- restTemplate.delete(
- BASE_URL + "notification/delete/{notificationId}.json", "101");
+ restTemplate.delete(BASE_URL + "notification/delete/{notificationId}.json", "101");
SyncopeClientException exception = null;
try {
- restTemplate.getForObject(
- BASE_URL + "notification/read/{notificationId}.json",
- NotificationTO.class, "101");
+ restTemplate
+ .getForObject(BASE_URL + "notification/read/{notificationId}.json", NotificationTO.class, "101");
} catch (SyncopeClientCompositeErrorException e) {
exception = e.getException(SyncopeClientExceptionType.NotFound);
}
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/PolicyTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/PolicyTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/PolicyTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/PolicyTestITCase.java Thu Mar 15 10:17:12 2012
@@ -37,8 +37,7 @@ public class PolicyTestITCase extends Ab
@Test
public void listByType() {
- List<SyncPolicyTO> policyTOs = Arrays.asList(restTemplate.getForObject(
- BASE_URL + "policy/{kind}/list",
+ List<SyncPolicyTO> policyTOs = Arrays.asList(restTemplate.getForObject(BASE_URL + "policy/{kind}/list",
SyncPolicyTO[].class, PolicyType.SYNC.toString()));
assertNotNull(policyTOs);
@@ -47,28 +46,25 @@ public class PolicyTestITCase extends Ab
@Test
public void read() {
- SyncPolicyTO policyTO = restTemplate.getForObject(
- BASE_URL + "policy/read/{id}", SyncPolicyTO.class, 1L);
+ SyncPolicyTO policyTO = restTemplate.getForObject(BASE_URL + "policy/read/{id}", SyncPolicyTO.class, 1L);
assertNotNull(policyTO);
}
@Test
public void getGlobalPasswordPolicy() {
- PasswordPolicyTO policyTO = restTemplate.getForObject(
- BASE_URL + "policy/password/global/read",
+ PasswordPolicyTO policyTO = restTemplate.getForObject(BASE_URL + "policy/password/global/read",
PasswordPolicyTO.class);
assertNotNull(policyTO);
assertEquals(PolicyType.GLOBAL_PASSWORD, policyTO.getType());
- assertEquals(8, ((PasswordPolicySpec) policyTO.getSpecification()).
- getMinLength());
+ assertEquals(8, ((PasswordPolicySpec) policyTO.getSpecification()).getMinLength());
}
@Test
public void getGlobalAccountPolicy() {
- AccountPolicyTO policyTO = restTemplate.getForObject(
- BASE_URL + "policy/account/global/read", AccountPolicyTO.class);
+ AccountPolicyTO policyTO = restTemplate.getForObject(BASE_URL + "policy/account/global/read",
+ AccountPolicyTO.class);
assertNotNull(policyTO);
assertEquals(PolicyType.GLOBAL_ACCOUNT, policyTO.getType());
@@ -82,13 +78,10 @@ public class PolicyTestITCase extends Ab
Throwable t = null;
try {
- restTemplate.postForObject(
- BASE_URL + "policy/password/create",
- policy, PasswordPolicyTO.class);
+ restTemplate.postForObject(BASE_URL + "policy/password/create", policy, PasswordPolicyTO.class);
fail();
} catch (SyncopeClientCompositeErrorException sccee) {
- t = sccee.getException(
- SyncopeClientExceptionType.InvalidPasswordPolicy);
+ t = sccee.getException(SyncopeClientExceptionType.InvalidPasswordPolicy);
}
assertNotNull(t);
}
@@ -100,13 +93,10 @@ public class PolicyTestITCase extends Ab
Throwable t = null;
try {
- restTemplate.postForObject(
- BASE_URL + "policy/sync/create",
- policy, PasswordPolicyTO.class);
+ restTemplate.postForObject(BASE_URL + "policy/sync/create", policy, PasswordPolicyTO.class);
fail();
} catch (SyncopeClientCompositeErrorException sccee) {
- t = sccee.getException(
- SyncopeClientExceptionType.InvalidSyncPolicy);
+ t = sccee.getException(SyncopeClientExceptionType.InvalidSyncPolicy);
}
assertNotNull(t);
}
@@ -117,8 +107,7 @@ public class PolicyTestITCase extends Ab
policy.setSpecification(new SyncPolicySpec());
policy.setDescription("Sync policy");
- SyncPolicyTO policyTO = restTemplate.postForObject(
- BASE_URL + "policy/sync/create", policy, SyncPolicyTO.class);
+ SyncPolicyTO policyTO = restTemplate.postForObject(BASE_URL + "policy/sync/create", policy, SyncPolicyTO.class);
assertNotNull(policyTO);
assertEquals(PolicyType.SYNC, policyTO.getType());
@@ -127,46 +116,37 @@ public class PolicyTestITCase extends Ab
@Test
public void update() {
// get global password
- PasswordPolicyTO globalPolicy = restTemplate.getForObject(
- BASE_URL + "policy/read/{id}", PasswordPolicyTO.class, 2L);
+ PasswordPolicyTO globalPolicy = restTemplate.getForObject(BASE_URL + "policy/read/{id}",
+ PasswordPolicyTO.class, 2L);
PasswordPolicyTO policy = new PasswordPolicyTO();
policy.setDescription("A simple password policy");
policy.setSpecification(globalPolicy.getSpecification());
// create a new password policy using global password as a template
- policy = restTemplate.postForObject(
- BASE_URL + "policy/password/create",
- policy, PasswordPolicyTO.class);
+ policy = restTemplate.postForObject(BASE_URL + "policy/password/create", policy, PasswordPolicyTO.class);
// read new password policy
- policy = restTemplate.getForObject(
- BASE_URL + "policy/read/{id}",
- PasswordPolicyTO.class, policy.getId());
+ policy = restTemplate.getForObject(BASE_URL + "policy/read/{id}", PasswordPolicyTO.class, policy.getId());
assertNotNull("find to update did not work", policy);
- PasswordPolicySpec policySpec =
- ((PasswordPolicyTO) policy).getSpecification();
+ PasswordPolicySpec policySpec = ((PasswordPolicyTO) policy).getSpecification();
policySpec.setMaxLength(22);
policy.setSpecification(policySpec);
// update new password policy
- policy = restTemplate.postForObject(BASE_URL + "policy/password/update",
- policy, PasswordPolicyTO.class);
+ policy = restTemplate.postForObject(BASE_URL + "policy/password/update", policy, PasswordPolicyTO.class);
assertNotNull(policy);
assertEquals(PolicyType.PASSWORD, policy.getType());
- assertEquals(22,
- ((PasswordPolicyTO) policy).getSpecification().getMaxLength());
- assertEquals(8,
- ((PasswordPolicyTO) policy).getSpecification().getMinLength());
+ assertEquals(22, ((PasswordPolicyTO) policy).getSpecification().getMaxLength());
+ assertEquals(8, ((PasswordPolicyTO) policy).getSpecification().getMinLength());
}
@Test
public void delete() {
- final PolicyTO policyTO = restTemplate.getForObject(
- BASE_URL + "policy/read/{id}", SyncPolicyTO.class, 7L);
+ final PolicyTO policyTO = restTemplate.getForObject(BASE_URL + "policy/read/{id}", SyncPolicyTO.class, 7L);
assertNotNull("find to delete did not work", policyTO);
@@ -174,8 +154,7 @@ public class PolicyTestITCase extends Ab
Throwable t = null;
try {
- restTemplate.getForObject(
- BASE_URL + "policy/read/{id}", SyncPolicyTO.class, 7L);
+ restTemplate.getForObject(BASE_URL + "policy/read/{id}", SyncPolicyTO.class, 7L);
} catch (SyncopeClientCompositeErrorException e) {
t = e;
}
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ReportTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ReportTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ReportTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ReportTestITCase.java Thu Mar 15 10:17:12 2012
@@ -41,24 +41,22 @@ public class ReportTestITCase extends Ab
@Test
public void getReportletClasses() {
- Set<String> reportletClasses = restTemplate.getForObject(
- BASE_URL + "report/reportletConfClasses.json", Set.class);
+ Set<String> reportletClasses = restTemplate.getForObject(BASE_URL + "report/reportletConfClasses.json",
+ Set.class);
assertNotNull(reportletClasses);
assertFalse(reportletClasses.isEmpty());
}
@Test
public void count() {
- Integer count = restTemplate.getForObject(
- BASE_URL + "report/count.json", Integer.class);
+ Integer count = restTemplate.getForObject(BASE_URL + "report/count.json", Integer.class);
assertNotNull(count);
assertTrue(count > 0);
}
@Test
public void list() {
- List<ReportTO> reports = Arrays.asList(restTemplate.getForObject(
- BASE_URL + "report/list", ReportTO[].class));
+ List<ReportTO> reports = Arrays.asList(restTemplate.getForObject(BASE_URL + "report/list", ReportTO[].class));
assertNotNull(reports);
assertFalse(reports.isEmpty());
for (ReportTO report : reports) {
@@ -68,8 +66,7 @@ public class ReportTestITCase extends Ab
@Test
public void listExecutions() {
- List<ReportExecTO> executions = Arrays.asList(restTemplate.getForObject(
- BASE_URL + "report/execution/list",
+ List<ReportExecTO> executions = Arrays.asList(restTemplate.getForObject(BASE_URL + "report/execution/list",
ReportExecTO[].class));
assertNotNull(executions);
assertFalse(executions.isEmpty());
@@ -80,8 +77,7 @@ public class ReportTestITCase extends Ab
@Test
public void read() {
- ReportTO reportTO = restTemplate.getForObject(
- BASE_URL + "report/read/{reportId}", ReportTO.class, 1);
+ ReportTO reportTO = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class, 1);
assertNotNull(reportTO);
assertNotNull(reportTO.getExecutions());
@@ -90,8 +86,7 @@ public class ReportTestITCase extends Ab
@Test
public void readExecution() {
- ReportExecTO reportExecTO = restTemplate.getForObject(
- BASE_URL + "report/execution/read/{reportId}",
+ ReportExecTO reportExecTO = restTemplate.getForObject(BASE_URL + "report/execution/read/{reportId}",
ReportExecTO.class, 1);
assertNotNull(reportExecTO);
}
@@ -103,13 +98,11 @@ public class ReportTestITCase extends Ab
report.addReportletConf(new UserReportletConf("first"));
report.addReportletConf(new UserReportletConf("second"));
- report = restTemplate.postForObject(
- BASE_URL + "report/create", report, ReportTO.class);
+ report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
assertNotNull(report);
- ReportTO actual = restTemplate.getForObject(
- BASE_URL + "report/read/{reportId}", ReportTO.class,
- report.getId());
+ ReportTO actual = restTemplate
+ .getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class, report.getId());
assertNotNull(actual);
assertEquals(actual, report);
}
@@ -121,15 +114,13 @@ public class ReportTestITCase extends Ab
report.addReportletConf(new UserReportletConf("first"));
report.addReportletConf(new UserReportletConf("second"));
- report = restTemplate.postForObject(
- BASE_URL + "report/create", report, ReportTO.class);
+ report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
assertNotNull(report);
assertEquals(2, report.getReportletConfs().size());
report.addReportletConf(new UserReportletConf("last"));
- ReportTO updated = restTemplate.postForObject(
- BASE_URL + "report/update", report, ReportTO.class);
+ ReportTO updated = restTemplate.postForObject(BASE_URL + "report/update", report, ReportTO.class);
assertNotNull(updated);
assertEquals(3, updated.getReportletConfs().size());
}
@@ -141,16 +132,13 @@ public class ReportTestITCase extends Ab
report.addReportletConf(new UserReportletConf("first"));
report.addReportletConf(new UserReportletConf("second"));
- report = restTemplate.postForObject(
- BASE_URL + "report/create", report, ReportTO.class);
+ report = restTemplate.postForObject(BASE_URL + "report/create", report, ReportTO.class);
assertNotNull(report);
- restTemplate.delete(
- BASE_URL + "report/delete/{reportId}", report.getId());
+ restTemplate.delete(BASE_URL + "report/delete/{reportId}", report.getId());
try {
- restTemplate.getForObject(BASE_URL + "report/read/{reportId}",
- UserTO.class, report.getId());
+ restTemplate.getForObject(BASE_URL + "report/read/{reportId}", UserTO.class, report.getId());
fail();
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
@@ -158,11 +146,9 @@ public class ReportTestITCase extends Ab
}
@Test
- public void executeAndExport()
- throws IOException {
+ public void executeAndExport() throws IOException {
- ReportTO reportTO = restTemplate.getForObject(
- BASE_URL + "report/read/{reportId}", ReportTO.class, 1);
+ ReportTO reportTO = restTemplate.getForObject(BASE_URL + "report/read/{reportId}", ReportTO.class, 1);
assertNotNull(reportTO);
Set<Long> preExecIds = new HashSet<Long>();
@@ -170,9 +156,8 @@ public class ReportTestITCase extends Ab
preExecIds.add(exec.getId());
}
- ReportExecTO execution = restTemplate.postForObject(
- BASE_URL + "report/execute/{reportId}",
- null, ReportExecTO.class, reportTO.getId());
+ ReportExecTO execution = restTemplate.postForObject(BASE_URL + "report/execute/{reportId}", null,
+ ReportExecTO.class, reportTO.getId());
assertNotNull(execution);
int i = 0;
@@ -214,8 +199,8 @@ public class ReportTestITCase extends Ab
getMethod = new HttpGet(BASE_URL + "report/execution/export/" + postExecIds.iterator().next());
- response = ((PreemptiveAuthHttpRequestFactory) restTemplate.getRequestFactory()).getHttpClient().
- execute(getMethod);
+ response = ((PreemptiveAuthHttpRequestFactory) restTemplate.getRequestFactory()).getHttpClient().execute(
+ getMethod);
i++;
} while ((response == null || response.getStatusLine().getStatusCode() != 200) && i < maxit);
@@ -227,8 +212,7 @@ public class ReportTestITCase extends Ab
assertFalse(export.isEmpty());
// 2. HTML
- getMethod = new HttpGet(BASE_URL + "report/execution/export/"
- + postExecIds.iterator().next() + "?fmt=HTML");
+ getMethod = new HttpGet(BASE_URL + "report/execution/export/" + postExecIds.iterator().next() + "?fmt=HTML");
response = ((PreemptiveAuthHttpRequestFactory) restTemplate.getRequestFactory()).getHttpClient().execute(
getMethod);
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -238,8 +222,7 @@ public class ReportTestITCase extends Ab
assertFalse(export.isEmpty());
// 3. PDF
- getMethod = new HttpGet(BASE_URL + "report/execution/export/"
- + postExecIds.iterator().next() + "?fmt=PDF");
+ getMethod = new HttpGet(BASE_URL + "report/execution/export/" + postExecIds.iterator().next() + "?fmt=PDF");
response = ((PreemptiveAuthHttpRequestFactory) restTemplate.getRequestFactory()).getHttpClient().execute(
getMethod);
assertEquals(200, response.getStatusLine().getStatusCode());
@@ -249,8 +232,7 @@ public class ReportTestITCase extends Ab
assertFalse(export.isEmpty());
// 4. RTF
- getMethod = new HttpGet(BASE_URL + "report/execution/export/"
- + postExecIds.iterator().next() + "?fmt=RTF");
+ getMethod = new HttpGet(BASE_URL + "report/execution/export/" + postExecIds.iterator().next() + "?fmt=RTF");
response = ((PreemptiveAuthHttpRequestFactory) restTemplate.getRequestFactory()).getHttpClient().execute(
getMethod);
assertEquals(200, response.getStatusLine().getStatusCode());
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ResourceTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ResourceTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ResourceTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/ResourceTestITCase.java Thu Mar 15 10:17:12 2012
@@ -48,8 +48,7 @@ public class ResourceTestITCase extends
resourceTO.setName(resourceName);
resourceTO.setConnectorId(100L);
- restTemplate.postForObject(BASE_URL + "resource/create.json",
- resourceTO, ResourceTO.class);
+ restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
}
@Test
@@ -80,17 +79,13 @@ public class ResourceTestITCase extends
schemaMappingTO.setAccountid(false);
resourceTO.addMapping(schemaMappingTO);
- ResourceTO actual = restTemplate.postForObject(
- BASE_URL + "resource/create.json",
- resourceTO, ResourceTO.class);
+ ResourceTO actual = restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
assertNotNull(actual);
// check the existence
- actual = restTemplate.getForObject(
- BASE_URL + "resource/read/{resourceName}.json",
- ResourceTO.class,
+ actual = restTemplate.getForObject(BASE_URL + "resource/read/{resourceName}.json", ResourceTO.class,
resourceName);
assertNotNull(actual);
@@ -132,21 +127,17 @@ public class ResourceTestITCase extends
p.setSchema(schema);
p.setValues(Collections.singletonList("http://invalidurl/"));
- Set<ConnConfProperty> connectorConfigurationProperties =
- new HashSet<ConnConfProperty>(Arrays.asList(p));
+ Set<ConnConfProperty> connectorConfigurationProperties = new HashSet<ConnConfProperty>(Arrays.asList(p));
- resourceTO.setConnectorConfigurationProperties(
- connectorConfigurationProperties);
+ resourceTO.setConnectorConfigurationProperties(connectorConfigurationProperties);
- ResourceTO actual = restTemplate.postForObject(BASE_URL
- + "resource/create.json", resourceTO, ResourceTO.class);
+ ResourceTO actual = restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
assertNotNull(actual);
// check the existence
- actual = restTemplate.getForObject(BASE_URL
- + "resource/read/{resourceName}.json", ResourceTO.class,
+ actual = restTemplate.getForObject(BASE_URL + "resource/read/{resourceName}.json", ResourceTO.class,
resourceName);
assertNotNull(actual);
@@ -165,9 +156,7 @@ public class ResourceTestITCase extends
schemaMappingTO.setAccountid(true);
resourceTO.addMapping(schemaMappingTO);
- ResourceTO actual = restTemplate.postForObject(
- BASE_URL + "resource/create.json",
- resourceTO, ResourceTO.class);
+ ResourceTO actual = restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
assertNotNull(actual);
}
@@ -191,25 +180,21 @@ public class ResourceTestITCase extends
// missing intAttrName ...
resourceTO.addMapping(schemaMappingTO);
-
Throwable t = null;
try {
- restTemplate.postForObject(
- BASE_URL + "resource/create.json",
- resourceTO, ResourceTO.class);
+ restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
} catch (SyncopeClientCompositeErrorException e) {
t = e;
- SyncopeClientException requiredValueMissing = e.getException(
- SyncopeClientExceptionType.RequiredValuesMissing);
+ SyncopeClientException requiredValueMissing = e
+ .getException(SyncopeClientExceptionType.RequiredValuesMissing);
assertNotNull(requiredValueMissing);
assertNotNull(requiredValueMissing.getElements());
assertEquals(1, requiredValueMissing.getElements().size());
- assertEquals("intAttrName",
- requiredValueMissing.getElements().iterator().next());
+ assertEquals("intAttrName", requiredValueMissing.getElements().iterator().next());
}
assertNotNull(t);
}
@@ -233,9 +218,7 @@ public class ResourceTestITCase extends
// missing extAttrName ...
resourceTO.addMapping(schemaMappingTO);
- restTemplate.postForObject(
- BASE_URL + "resource/create.json",
- resourceTO, ResourceTO.class);
+ restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
}
@Test
@@ -254,17 +237,13 @@ public class ResourceTestITCase extends
schemaMappingTO.setAccountid(true);
resourceTO.addMapping(schemaMappingTO);
- ResourceTO actual = restTemplate.postForObject(
- BASE_URL + "resource/create.json",
- resourceTO, ResourceTO.class);
+ ResourceTO actual = restTemplate.postForObject(BASE_URL + "resource/create.json", resourceTO, ResourceTO.class);
assertNotNull(actual);
// check the existence
- actual = restTemplate.getForObject(
- BASE_URL + "resource/read/{resourceName}.json",
- ResourceTO.class,
+ actual = restTemplate.getForObject(BASE_URL + "resource/read/{resourceName}.json", ResourceTO.class,
resourceName);
assertNotNull(actual);
@@ -279,8 +258,7 @@ public class ResourceTestITCase extends
resourceTO.setName("resourcenotfound");
- restTemplate.postForObject(BASE_URL + "resource/update.json",
- resourceTO, ResourceTO.class);
+ restTemplate.postForObject(BASE_URL + "resource/update.json", resourceTO, ResourceTO.class);
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
}
@@ -294,8 +272,7 @@ public class ResourceTestITCase extends
resourceTO.setName(resourceName);
resourceTO.setConnectorId(101L);
- List<SchemaMappingTO> schemaMappingTOs =
- new ArrayList<SchemaMappingTO>();
+ List<SchemaMappingTO> schemaMappingTOs = new ArrayList<SchemaMappingTO>();
// Update with an existing and already assigned mapping
SchemaMappingTO schemaMappingTO = new SchemaMappingTO();
@@ -322,9 +299,7 @@ public class ResourceTestITCase extends
resourceTO.setMappings(schemaMappingTOs);
- ResourceTO actual = restTemplate.postForObject(
- BASE_URL + "resource/update.json",
- resourceTO, ResourceTO.class);
+ ResourceTO actual = restTemplate.postForObject(BASE_URL + "resource/update.json", resourceTO, ResourceTO.class);
assertNotNull(actual);
@@ -340,9 +315,7 @@ public class ResourceTestITCase extends
@Test
public void deleteWithException() {
try {
- restTemplate.delete(
- BASE_URL + "resource/delete/{resourceName}.json",
- "resourcenotfound");
+ restTemplate.delete(BASE_URL + "resource/delete/{resourceName}.json", "resourcenotfound");
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
}
@@ -352,16 +325,13 @@ public class ResourceTestITCase extends
public void updateResetSyncToken() {
// pre condition: sync token is set
String resourceName = "ws-target-resource-update-resetsynctoken";
- ResourceTO pre = restTemplate.getForObject(
- BASE_URL + "/resource/read/{resourceName}.json",
- ResourceTO.class, resourceName);
+ ResourceTO pre = restTemplate.getForObject(BASE_URL + "/resource/read/{resourceName}.json", ResourceTO.class,
+ resourceName);
assertNotNull(pre.getSyncToken());
pre.setSyncToken(null);
- ResourceTO actual = restTemplate.postForObject(
- BASE_URL + "resource/update.json",
- pre, ResourceTO.class);
+ ResourceTO actual = restTemplate.postForObject(BASE_URL + "resource/update.json", pre, ResourceTO.class);
// check that the synctoken has been reset
assertNull(actual.getSyncToken());
@@ -371,15 +341,10 @@ public class ResourceTestITCase extends
public void delete() {
final String resourceName = "ws-target-resource-delete";
- restTemplate.delete(
- BASE_URL + "resource/delete/{resourceName}.json",
- resourceName);
+ restTemplate.delete(BASE_URL + "resource/delete/{resourceName}.json", resourceName);
try {
- restTemplate.getForObject(
- BASE_URL + "resource/read/{resourceName}.json",
- ResourceTO.class,
- resourceName);
+ restTemplate.getForObject(BASE_URL + "resource/read/{resourceName}.json", ResourceTO.class, resourceName);
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
}
@@ -387,9 +352,8 @@ public class ResourceTestITCase extends
@Test
public void list() {
- List<ResourceTO> actuals = Arrays.asList(
- restTemplate.getForObject(
- BASE_URL + "resource/list.json", ResourceTO[].class));
+ List<ResourceTO> actuals = Arrays.asList(restTemplate.getForObject(BASE_URL + "resource/list.json",
+ ResourceTO[].class));
assertNotNull(actuals);
assertFalse(actuals.isEmpty());
for (ResourceTO resourceTO : actuals) {
@@ -399,9 +363,8 @@ public class ResourceTestITCase extends
@Test
public void listByType() {
- List<ResourceTO> actuals = Arrays.asList(restTemplate.getForObject(
- BASE_URL + "resource/list.json?connInstanceId=105",
- ResourceTO[].class));
+ List<ResourceTO> actuals = Arrays.asList(restTemplate.getForObject(BASE_URL
+ + "resource/list.json?connInstanceId=105", ResourceTO[].class));
assertNotNull(actuals);
assertEquals(1, actuals.size());
@@ -410,8 +373,7 @@ public class ResourceTestITCase extends
@Test
public void read() {
- ResourceTO actual = restTemplate.getForObject(
- BASE_URL + "/resource/read/{resourceName}.json",
+ ResourceTO actual = restTemplate.getForObject(BASE_URL + "/resource/read/{resourceName}.json",
ResourceTO.class, "resource-testdb");
assertNotNull(actual);
Modified: incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/RoleTestITCase.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/RoleTestITCase.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/RoleTestITCase.java (original)
+++ incubator/syncope/trunk/core/src/test/java/org/syncope/core/rest/RoleTestITCase.java Thu Mar 15 10:17:12 2012
@@ -45,12 +45,10 @@ public class RoleTestITCase extends Abst
Throwable t = null;
try {
- restTemplate.postForObject(BASE_URL + "role/create",
- newRoleTO, RoleTO.class);
+ restTemplate.postForObject(BASE_URL + "role/create", newRoleTO, RoleTO.class);
fail();
} catch (SyncopeClientCompositeErrorException sccee) {
- t = sccee.getException(
- SyncopeClientExceptionType.InvalidSyncopeRole);
+ t = sccee.getException(SyncopeClientExceptionType.InvalidSyncopeRole);
}
assertNotNull(t);
}
@@ -74,8 +72,7 @@ public class RoleTestITCase extends Abst
icon.setSchema("icon");
icon.addValue("anIcon");
- RoleTO actual = restTemplate.postForObject(BASE_URL + "role/create",
- roleTO, RoleTO.class);
+ RoleTO actual = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);
roleTO.setId(actual.getId());
@@ -97,13 +94,11 @@ public class RoleTestITCase extends Abst
roleTO.setParent(8L);
roleTO.setPasswordPolicy(4L);
- RoleTO actual = restTemplate.postForObject(BASE_URL + "role/create",
- roleTO, RoleTO.class);
+ RoleTO actual = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);
assertNotNull(actual);
- actual = restTemplate.getForObject(BASE_URL
- + "role/read/{roleId}.json", RoleTO.class, actual.getId());
+ actual = restTemplate.getForObject(BASE_URL + "role/read/{roleId}.json", RoleTO.class, actual.getId());
assertNotNull(actual);
assertNotNull(actual.getPasswordPolicy());
@@ -120,8 +115,7 @@ public class RoleTestITCase extends Abst
restTemplate.delete(BASE_URL + "role/delete/{roleId}", 5);
try {
- restTemplate.getForObject(BASE_URL + "role/read/{roleId}.json",
- RoleTO.class, 2);
+ restTemplate.getForObject(BASE_URL + "role/read/{roleId}.json", RoleTO.class, 2);
} catch (HttpStatusCodeException e) {
assertEquals(HttpStatus.NOT_FOUND, e.getStatusCode());
}
@@ -129,9 +123,7 @@ public class RoleTestITCase extends Abst
@Test
public void list() {
- List<RoleTO> roleTOs = Arrays.asList(
- restTemplate.getForObject(BASE_URL
- + "role/list.json", RoleTO[].class));
+ List<RoleTO> roleTOs = Arrays.asList(restTemplate.getForObject(BASE_URL + "role/list.json", RoleTO[].class));
assertNotNull(roleTOs);
assertTrue(roleTOs.size() >= 8);
for (RoleTO roleTO : roleTOs) {
@@ -141,8 +133,7 @@ public class RoleTestITCase extends Abst
@Test
public void parent() {
- RoleTO roleTO = restTemplate.getForObject(BASE_URL
- + "role/parent/{roleId}.json", RoleTO.class, 7);
+ RoleTO roleTO = restTemplate.getForObject(BASE_URL + "role/parent/{roleId}.json", RoleTO.class, 7);
assertNotNull(roleTO);
assertEquals(roleTO.getId(), 6L);
@@ -150,8 +141,7 @@ public class RoleTestITCase extends Abst
@Test
public void read() {
- RoleTO roleTO = restTemplate.getForObject(BASE_URL
- + "role/read/{roleId}.json", RoleTO.class, 1);
+ RoleTO roleTO = restTemplate.getForObject(BASE_URL + "role/read/{roleId}.json", RoleTO.class, 1);
assertNotNull(roleTO);
assertNotNull(roleTO.getAttributes());
@@ -178,8 +168,7 @@ public class RoleTestITCase extends Abst
icon.addValue("anIcon");
roleTO.addAttribute(icon);
- roleTO = restTemplate.postForObject(BASE_URL + "role/create",
- roleTO, RoleTO.class);
+ roleTO = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);
assertEquals(1, roleTO.getAttributes().size());
@@ -201,8 +190,7 @@ public class RoleTestITCase extends Abst
// change password policy inheritance
roleMod.setInheritPasswordPolicy(Boolean.FALSE);
- roleTO = restTemplate.postForObject(BASE_URL + "role/update",
- roleMod, RoleTO.class);
+ roleTO = restTemplate.postForObject(BASE_URL + "role/update", roleMod, RoleTO.class);
assertEquals("finalRole", roleTO.getName());
assertEquals(2, roleTO.getAttributes().size());
@@ -225,8 +213,7 @@ public class RoleTestITCase extends Abst
rvirtualdata.setSchema("rvirtualdata");
roleTO.addVirtualAttribute(rvirtualdata);
- roleTO = restTemplate.postForObject(
- BASE_URL + "role/create", roleTO, RoleTO.class);
+ roleTO = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);
assertNotNull(roleTO);
assertEquals(1, roleTO.getVirtualAttributes().size());
@@ -235,8 +222,7 @@ public class RoleTestITCase extends Abst
roleMod.setId(roleTO.getId());
roleMod.addVirtualAttributeToBeRemoved("rvirtualdata");
- roleTO = restTemplate.postForObject(
- BASE_URL + "role/update", roleMod, RoleTO.class);
+ roleTO = restTemplate.postForObject(BASE_URL + "role/update", roleMod, RoleTO.class);
assertNotNull(roleTO);
assertTrue(roleTO.getVirtualAttributes().isEmpty());
@@ -252,8 +238,7 @@ public class RoleTestITCase extends Abst
deriveddata.setSchema("rderivedschema");
roleTO.addDerivedAttribute(deriveddata);
- roleTO = restTemplate.postForObject(
- BASE_URL + "role/create", roleTO, RoleTO.class);
+ roleTO = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);
assertNotNull(roleTO);
assertEquals(1, roleTO.getDerivedAttributes().size());
@@ -262,8 +247,7 @@ public class RoleTestITCase extends Abst
roleMod.setId(roleTO.getId());
roleMod.addDerivedAttributeToBeRemoved("rderivedschema");
- roleTO = restTemplate.postForObject(
- BASE_URL + "role/update", roleMod, RoleTO.class);
+ roleTO = restTemplate.postForObject(BASE_URL + "role/update", roleMod, RoleTO.class);
assertNotNull(roleTO);
assertTrue(roleTO.getDerivedAttributes().isEmpty());
@@ -279,8 +263,7 @@ public class RoleTestITCase extends Abst
RoleTO roleTO = new RoleTO();
roleTO.setName("torename");
- RoleTO actual = restTemplate.postForObject(
- BASE_URL + "role/create", roleTO, RoleTO.class);
+ RoleTO actual = restTemplate.postForObject(BASE_URL + "role/create", roleTO, RoleTO.class);
assertNotNull(actual);
assertEquals("torename", actual.getName());
@@ -290,8 +273,7 @@ public class RoleTestITCase extends Abst
roleMod.setId(actual.getId());
roleMod.setName("renamed");
- actual = restTemplate.postForObject(
- BASE_URL + "role/update", roleMod, RoleTO.class);
+ actual = restTemplate.postForObject(BASE_URL + "role/update", roleMod, RoleTO.class);
assertNotNull(actual);
assertEquals("renamed", actual.getName());