You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dlab.apache.org by GitBox <gi...@apache.org> on 2020/09/04 08:34:20 UTC

[GitHub] [incubator-dlab] ofuks commented on a change in pull request #888: [DLAB] Project resource UT

ofuks commented on a change in pull request #888:
URL: https://github.com/apache/incubator-dlab/pull/888#discussion_r483471730



##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java
##########
@@ -128,6 +128,34 @@ public void startProject() {
         verifyNoMoreInteractions(projectService);
     }
 
+    @Test
+    public void getProject() {
+        when(projectService.get(PROJECT_NAME)).thenReturn(ProjectDTO.builder().name(PROJECT_NAME).build());

Review comment:
       Please, use **any()** method

##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/resources/ProjectResourceTest.java
##########
@@ -128,6 +128,34 @@ public void startProject() {
         verifyNoMoreInteractions(projectService);
     }
 
+    @Test
+    public void getProject() {
+        when(projectService.get(PROJECT_NAME)).thenReturn(ProjectDTO.builder().name(PROJECT_NAME).build());
+        final Response response = resources.getJerseyTest()
+                .target("project/" + PROJECT_NAME)
+                .request()
+                .header("Authorization", "Bearer " + TOKEN)
+                .get();
+
+        assertEquals(HttpStatus.SC_OK, response.getStatus());
+        verify(projectService).get(PROJECT_NAME);
+        verifyNoMoreInteractions(projectService);
+    }
+
+    @Test
+    public void getProjects() {
+        when(projectService.getProjects(getUserInfo())).thenReturn(Collections.singletonList(ProjectDTO.builder().name(PROJECT_NAME).build()));

Review comment:
       The same here




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@dlab.apache.org
For additional commands, e-mail: dev-help@dlab.apache.org