Fix tests
This commit is contained in:
parent
8fab42ce8f
commit
112f3f9308
@ -67,14 +67,14 @@ public class PreviewWikibaseSchemaCommand extends Command {
|
||||
try {
|
||||
schema = WikibaseSchema.reconstruct(jsonString);
|
||||
} catch (JSONException e) {
|
||||
respondError(response, e.toString());
|
||||
respondError(response, "Wikibase schema could not be parsed.");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
schema = (WikibaseSchema) project.overlayModels.get("wikibaseSchema");
|
||||
}
|
||||
if (schema == null) {
|
||||
respondError(response, "No schema provided.");
|
||||
respondError(response, "No Wikibase schema provided.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ public class SaveWikibaseSchemaCommand extends Command {
|
||||
// We do not use respondException here because this is an expected
|
||||
// exception which happens every time a user tries to save an incomplete
|
||||
// schema - the exception should not be logged.
|
||||
respondError(response, "Invalid Wikibase schema provided.");
|
||||
respondError(response, "Wikibase schema could not be parsed.");
|
||||
} catch (Exception e) {
|
||||
// This is an unexpected exception, so we log it.
|
||||
respondException(response, e);
|
||||
|
@ -39,7 +39,7 @@ public abstract class SchemaCommandTest extends CommandTest {
|
||||
throws ServletException, IOException {
|
||||
command.doPost(request, response);
|
||||
|
||||
assertEquals("{\"status\":\"error\",\"message\":\"No Wikibase schema provided.\"}", writer.toString());
|
||||
assertEquals("{\"code\":\"error\",\"message\":\"No Wikibase schema provided.\"}", writer.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -48,6 +48,6 @@ public abstract class SchemaCommandTest extends CommandTest {
|
||||
when(request.getParameter("schema")).thenReturn("{bogus json");
|
||||
command.doPost(request, response);
|
||||
|
||||
assertEquals("{\"status\":\"error\",\"message\":\"Wikibase schema could not be parsed.\"}", writer.toString());
|
||||
assertEquals("{\"code\":\"error\",\"message\":\"Wikibase schema could not be parsed.\"}", writer.toString());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user