Applies Virgo code formatting
diff --git a/org.eclipse.virgo.apps.repository.web/src/test/java/org/eclipse/virgo/apps/repository/web/RepositoryControllerTests.java b/org.eclipse.virgo.apps.repository.web/src/test/java/org/eclipse/virgo/apps/repository/web/RepositoryControllerTests.java
index 37fc0da..c664b95 100644
--- a/org.eclipse.virgo.apps.repository.web/src/test/java/org/eclipse/virgo/apps/repository/web/RepositoryControllerTests.java
+++ b/org.eclipse.virgo.apps.repository.web/src/test/java/org/eclipse/virgo/apps/repository/web/RepositoryControllerTests.java
@@ -32,100 +32,101 @@
import org.eclipse.virgo.apps.repository.core.RepositoryManager;
public class RepositoryControllerTests {
-
+
private RepositoryManager repositoryManager;
+
private RepositoryController repositoryController;
-
+
@Before
public void setup() {
repositoryManager = createMock(RepositoryManager.class);
repositoryController = new RepositoryController(this.repositoryManager);
}
-
+
@Test
public void getIndex() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpServletResponse response = new MockHttpServletResponse();
-
+
request.setRequestURI("http://localhost:8080/org.eclipse.virgo.server.repository/my-repo");
request.setMethod("GET");
-
- byte[] indexBytes = new byte[] {1, 2, 3, 4, 5, 6, 7, 8};
-
+
+ byte[] indexBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
+
RepositoryIndex repositoryIndex = createMock(RepositoryIndex.class);
- expect(repositoryIndex.getInputStream()).andReturn(new ByteArrayInputStream(indexBytes)).anyTimes();
+ expect(repositoryIndex.getInputStream()).andReturn(new ByteArrayInputStream(indexBytes)).anyTimes();
expect(repositoryIndex.getETag()).andReturn("123456789").anyTimes();
expect(repositoryIndex.getLength()).andReturn(indexBytes.length).anyTimes();
-
+
expect(this.repositoryManager.getIndex("my-repo")).andReturn(repositoryIndex);
-
+
replay(this.repositoryManager, repositoryIndex);
-
+
repositoryController.getIndex(request, response);
-
+
verify(this.repositoryManager, repositoryIndex);
-
+
assertEquals("application/org.eclipse.virgo.repository.Index", response.getContentType());
assertArrayEquals(indexBytes, response.getContentAsByteArray());
}
-
+
@Test
public void getIndexForUnknownRepository() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpServletResponse response = new MockHttpServletResponse();
-
+
request.setRequestURI("http://localhost:8080/org.eclipse.virgo.server.repository/my-repo");
request.setMethod("GET");
-
+
expect(this.repositoryManager.getIndex("my-repo")).andReturn(null);
-
+
replay(this.repositoryManager);
-
+
repositoryController.getIndex(request, response);
-
+
verify(this.repositoryManager);
-
+
assertEquals(response.getStatus(), HttpServletResponse.SC_NOT_FOUND);
}
-
+
@Test
public void getArtefact() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpServletResponse response = new MockHttpServletResponse();
-
+
request.setRequestURI("http://localhost:8080/org.eclipse.virgo.server.repository/my-repo/bundle/com.foo/1.0.0");
request.setMethod("GET");
-
- byte[] artefactBytes = new byte[] {1, 2, 3, 4, 5, 6, 7, 8};
-
+
+ byte[] artefactBytes = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 };
+
expect(this.repositoryManager.getArtifact("my-repo", "bundle", "com.foo", "1.0.0")).andReturn(new ByteArrayInputStream(artefactBytes));
-
+
replay(this.repositoryManager);
-
+
repositoryController.getArtifact(request, response);
-
+
verify(this.repositoryManager);
-
+
assertEquals("application/octet-stream", response.getContentType());
assertArrayEquals(artefactBytes, response.getContentAsByteArray());
}
-
+
@Test
public void getUnknownArtefact() throws Exception {
MockHttpServletRequest request = new MockHttpServletRequest();
MockHttpServletResponse response = new MockHttpServletResponse();
-
+
request.setRequestURI("http://localhost:8080/org.eclipse.virgo.server.repository/my-repo/bundle/com.foo/1.0.0");
request.setMethod("GET");
-
+
expect(this.repositoryManager.getArtifact("my-repo", "bundle", "com.foo", "1.0.0")).andReturn(null);
-
+
replay(this.repositoryManager);
-
+
repositoryController.getArtifact(request, response);
-
+
verify(this.repositoryManager);
-
+
assertEquals(response.getStatus(), HttpServletResponse.SC_NOT_FOUND);
}
}