| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,8 @@ public class PullResponseItem extends ResponseItem { | |||
| 19 | 19 | ||
| 20 | 20 | private static final String DOWNLOADED_SWARM = ": downloaded"; | |
| 21 | 21 | ||
| 22 | + private static final String ALREADY_EXISTS = "Already exists"; | ||
| 23 | + | ||
| 22 | 24 | /** | |
| 23 | 25 | * Returns whether the status indicates a successful pull operation | |
| 24 | 26 | * | |
@@ -34,7 +36,8 @@ public boolean isPullSuccessIndicated() { | |||
| 34 | 36 | getStatus().contains(IMAGE_UP_TO_DATE) || | |
| 35 | 37 | getStatus().contains(DOWNLOADED_NEWER_IMAGE) || | |
| 36 | 38 | getStatus().contains(LEGACY_REGISTRY) || | |
| 37 | - getStatus().contains(DOWNLOADED_SWARM) | ||
| 39 | + getStatus().contains(DOWNLOADED_SWARM) || | ||
| 40 | + getStatus().contains(ALREADY_EXISTS) | ||
| 38 | 41 | ); | |
| 39 | 42 | } | |
| 40 | 43 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -29,6 +29,14 @@ | |||
| 29 | 29 | * @author Zach Marshall | |
| 30 | 30 | */ | |
| 31 | 31 | public class PullResponseItemTest { | |
| 32 | + @Test | ||
| 33 | + public void imageAlreadyExists() throws IOException { | ||
| 34 | + PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_alreadyExists, | ||
| 35 | + PullResponseItem.class); | ||
| 36 | + assertTrue(response.isPullSuccessIndicated()); | ||
| 37 | + assertFalse(response.isErrorIndicated()); | ||
| 38 | + } | ||
| 39 | + | ||
| 32 | 40 | @Test | |
| 33 | 41 | public void pullNewerImage() throws IOException { | |
| 34 | 42 | PullResponseItem response = testRoundTrip(PullResponseJSONSamples.pullImageResponse_newerImage, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,7 +23,9 @@ | |||
| 23 | 23 | * @author Zach Marshall | |
| 24 | 24 | */ | |
| 25 | 25 | public enum PullResponseJSONSamples implements JSONResourceRef { | |
| 26 | - pullImageResponse_legacy, pullImageResponse_error, pullImageResponse_newerImage, pullImageResponse_upToDate; | ||
| 26 | + pullImageResponse_legacy, pullImageResponse_error, | ||
| 27 | + pullImageResponse_newerImage, pullImageResponse_upToDate, | ||
| 28 | + pullImageResponse_alreadyExists; | ||
| 27 | 29 | ||
| 28 | 30 | @Override | |
| 29 | 31 | public String getFileName() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + {"status":"Already exists"} | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments