Merge "DownloadTest: Use enums from org.apache.http.HttpStatus"
This commit is contained in:
commit
1bea0227e7
|
@ -42,6 +42,8 @@
|
||||||
*/
|
*/
|
||||||
package org.eclipse.jgit.lfs.server.fs;
|
package org.eclipse.jgit.lfs.server.fs;
|
||||||
|
|
||||||
|
import static org.apache.http.HttpStatus.SC_NOT_FOUND;
|
||||||
|
import static org.apache.http.HttpStatus.SC_UNPROCESSABLE_ENTITY;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.fail;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
|
@ -80,7 +82,8 @@ public void testDownloadInvalidPathInfo()
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
String error = String.format(
|
String error = String.format(
|
||||||
"Invalid pathInfo '/%s' does not match '/{SHA-256}'", id);
|
"Invalid pathInfo '/%s' does not match '/{SHA-256}'", id);
|
||||||
assertEquals(formatErrorMessage(422, error), e.getMessage());
|
assertEquals(formatErrorMessage(SC_UNPROCESSABLE_ENTITY, error),
|
||||||
|
e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +98,8 @@ public void testDownloadInvalidId()
|
||||||
fail("expected RuntimeException");
|
fail("expected RuntimeException");
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
String error = String.format("Invalid id: : %s", id);
|
String error = String.format("Invalid id: : %s", id);
|
||||||
assertEquals(formatErrorMessage(422, error), e.getMessage());
|
assertEquals(formatErrorMessage(SC_UNPROCESSABLE_ENTITY, error),
|
||||||
|
e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,7 +114,8 @@ public void testDownloadNotFound()
|
||||||
fail("expected RuntimeException");
|
fail("expected RuntimeException");
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
String error = String.format("Object '%s' not found", id.getName());
|
String error = String.format("Object '%s' not found", id.getName());
|
||||||
assertEquals(formatErrorMessage(404, error), e.getMessage());
|
assertEquals(formatErrorMessage(SC_NOT_FOUND, error),
|
||||||
|
e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue