diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2016-08-12 12:47:34 +0900 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2016-08-20 00:54:52 +0200 |
commit | 2fc1cebfc9b81f4511bee20e71428c03a229b4ce (patch) | |
tree | 282728f31a78e065effbafa8f2054ef296002faa /org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit | |
parent | f15e9c088a6c50d96789fbeba04bb3272a5d3d4d (diff) | |
download | jgit-2fc1cebfc9b81f4511bee20e71428c03a229b4ce.tar.gz jgit-2fc1cebfc9b81f4511bee20e71428c03a229b4ce.zip |
DownloadTest: Use enums from org.apache.http.HttpStatus
Instead of using hard-coded HTTP status codes, use the enums
which makes it a bit easier to see what's expected.
Change-Id: I2da5d25632f374b8625d64da4df70d1c9c406bb1
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit')
-rw-r--r-- | org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java index 033ed0edf2..f92e638e80 100644 --- a/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java +++ b/org.eclipse.jgit.lfs.server.test/tst/org/eclipse/jgit/lfs/server/fs/DownloadTest.java @@ -42,6 +42,8 @@ */ 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.fail; @@ -80,7 +82,8 @@ public class DownloadTest extends LfsServerTest { } catch (RuntimeException e) { String error = String.format( "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 class DownloadTest extends LfsServerTest { fail("expected RuntimeException"); } catch (RuntimeException e) { 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 class DownloadTest extends LfsServerTest { fail("expected RuntimeException"); } catch (RuntimeException e) { String error = String.format("Object '%s' not found", id.getName()); - assertEquals(formatErrorMessage(404, error), e.getMessage()); + assertEquals(formatErrorMessage(SC_NOT_FOUND, error), + e.getMessage()); } } |