Merge branch 'origin/Extend_end-2-end_tests_for_full_DDI_roundtrip_with_Java_client' of local repository into Extend_end-2-end_tests_for_full_DDI_roundtrip_with_Java_client

This commit is contained in:
SirWayne
2016-04-21 14:12:21 +02:00
3 changed files with 11 additions and 6 deletions

View File

@@ -29,6 +29,7 @@ import org.springframework.cache.CacheManager;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -54,7 +55,7 @@ public class SystemManagementResource implements SystemManagementRestApi {
* @return HttpStatus.OK
*/
@Override
public ResponseEntity<Void> deleteTenant(final String tenant) {
public ResponseEntity<Void> deleteTenant(@PathVariable("tenant") final String tenant) {
systemManagement.deleteTenant(tenant);
return new ResponseEntity<>(HttpStatus.OK);
}

View File

@@ -25,6 +25,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.hateoas.ResourceSupport;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
/**
@@ -68,7 +70,7 @@ public class SystemResource implements SystemRestApi {
* the response.
*/
@Override
public ResponseEntity<Void> deleteConfigurationValue(final String keyName) {
public ResponseEntity<Void> deleteConfigurationValue(@PathVariable("keyName") final String keyName) {
final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName);
@@ -89,7 +91,8 @@ public class SystemResource implements SystemRestApi {
* response.
*/
@Override
public ResponseEntity<SystemTenantConfigurationValue> getConfigurationValue(final String keyName) {
public ResponseEntity<SystemTenantConfigurationValue> getConfigurationValue(
@PathVariable("keyName") final String keyName) {
final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName);
@@ -111,8 +114,9 @@ public class SystemResource implements SystemRestApi {
* response.
*/
@Override
public ResponseEntity<SystemTenantConfigurationValue> updateConfigurationValue(final String keyName,
final SystemTenantConfigurationValueRequest configurationValueRest) {
public ResponseEntity<SystemTenantConfigurationValue> updateConfigurationValue(
@PathVariable("keyName") final String keyName,
@RequestBody final SystemTenantConfigurationValueRequest configurationValueRest) {
final TenantConfigurationKey configKey = TenantConfigurationKey.fromKeyName(keyName);

View File

@@ -78,7 +78,7 @@ public class SystemResourceTest extends AbstractIntegrationTest {
final TenantConfigurationKey key = TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_AUTHORITY_NAME;
final String testValue = "12:12:12";
mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}", key.getKeyName())
mvc.perform(put(SystemRestConstant.SYSTEM_V1_REQUEST_MAPPING + "/configs/{keyName}/", key.getKeyName())
.content(String.format(BASE_JSON_REQUEST_STRING, testValue)).contentType(MediaType.APPLICATION_JSON))
.andDo(MockMvcResultPrinter.print()).andExpect(status().isOk());