This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit c5440f573ff3bea380988922c14311e98dd6f9bb Author: Benoit Tellier <[email protected]> AuthorDate: Wed Dec 11 17:18:55 2019 +0700 JAMES-2272 CassandraMigrationRoutes should position Location header --- .../james/webadmin/routes/CassandraMigrationRoutes.java | 2 +- .../james/webadmin/routes/CassandraMigrationRoutesTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/server/protocols/webadmin/webadmin-cassandra/src/main/java/org/apache/james/webadmin/routes/CassandraMigrationRoutes.java b/server/protocols/webadmin/webadmin-cassandra/src/main/java/org/apache/james/webadmin/routes/CassandraMigrationRoutes.java index 8f77736..c690059 100644 --- a/server/protocols/webadmin/webadmin-cassandra/src/main/java/org/apache/james/webadmin/routes/CassandraMigrationRoutes.java +++ b/server/protocols/webadmin/webadmin-cassandra/src/main/java/org/apache/james/webadmin/routes/CassandraMigrationRoutes.java @@ -144,7 +144,7 @@ public class CassandraMigrationRoutes implements Routes { CassandraVersionRequest cassandraVersionRequest = CassandraVersionRequest.parse(request.body()); Task migration = cassandraMigrationService.upgradeToVersion(cassandraVersionRequest.getValue()); TaskId taskId = taskManager.submit(migration); - return TaskIdDto.from(taskId); + return TaskIdDto.respond(response, taskId); } @GET diff --git a/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java b/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java index 3575722..5d5d4e5 100644 --- a/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java +++ b/server/protocols/webadmin/webadmin-cassandra/src/test/java/org/apache/james/webadmin/routes/CassandraMigrationRoutesTest.java @@ -233,6 +233,18 @@ public class CassandraMigrationRoutesTest { } @Test + public void postShouldPositionLocationHeader() { + when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(CURRENT_VERSION))); + + given() + .body(String.valueOf(OLDER_VERSION.getValue())) + .when() + .post("/upgrade") + .then() + .header("Location", notNullValue()); + } + + @Test public void postShouldDoMigrationToLatestVersion() { when(schemaVersionDAO.getCurrentSchemaVersion()).thenReturn(Mono.just(Optional.of(OLDER_VERSION))); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
