You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@datalab.apache.org by GitBox <gi...@apache.org> on 2020/10/27 15:29:27 UTC

[GitHub] [incubator-datalab] ppapou opened a new pull request #964: [DLAB-2116] Oduhu unitests

ppapou opened a new pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964


    - findOdahu()
    - create()


----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ppapou commented on a change in pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964#discussion_r524264421



##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,125 @@
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.EndpointDTO;
+import com.epam.dlab.backendapi.domain.OdahuCreateDTO;
+import com.epam.dlab.backendapi.domain.OdahuDTO;
+import com.epam.dlab.backendapi.domain.ProjectDTO;
+import com.epam.dlab.backendapi.domain.ProjectEndpointDTO;
+import com.epam.dlab.backendapi.domain.RequestId;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.when;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080";
+    private static final String END_POINT_NAME = "endpoint";
+    private static final String tag = "testTag";
+    private static final String uuid = "34dsr324";
+    private static final String ODAHU_NAME = "odahuTest";
+
+    private UserInfo userInfo;
+
+    @Mock
+    private OdahuDAO odahuDAO;
+
+    @Mock
+    private ProjectService projectService;
+
+    @Mock
+    private EndpointService endpointService;
+
+    @Mock
+    private RequestId requestId;
+
+    @Mock
+    private RESTService provisioningService;
+
+    @Mock
+    private RequestBuilder requestBuilder;
+
+    @Mock
+    private OdahuServiceImpl odahuService;
+
+    @Before

Review comment:
       Before class has been intorduced




----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ofuks commented on a change in pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964#discussion_r514097713



##########
File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImpl.java
##########
@@ -84,14 +84,15 @@ public OdahuServiceImpl(ProjectService projectService, EndpointService endpointS
         return odahuDAO.findOdahuClusters();
     }
 
-    @Override
+    @Override//TODO:method should be refactored

Review comment:
       Resolve this TODO

##########
File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImpl.java
##########
@@ -116,6 +116,8 @@ public void create(@Project String project, OdahuCreateDTO odahuCreateDTO, UserI
                 odahuDAO.updateStatus(odahuCreateDTO.getName(), odahuCreateDTO.getProject(), odahuCreateDTO.getEndpoint(),
                         UserInstanceStatus.FAILED);
             }
+        } else {
+            throw new DlabException("The odahu project " + project + " can not be created.");

Review comment:
       Describe a detailed reason 

##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,125 @@
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.EndpointDTO;
+import com.epam.dlab.backendapi.domain.OdahuCreateDTO;
+import com.epam.dlab.backendapi.domain.OdahuDTO;
+import com.epam.dlab.backendapi.domain.ProjectDTO;
+import com.epam.dlab.backendapi.domain.ProjectEndpointDTO;
+import com.epam.dlab.backendapi.domain.RequestId;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.doThrow;
+import static org.mockito.Mockito.when;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080";
+    private static final String END_POINT_NAME = "endpoint";
+    private static final String tag = "testTag";
+    private static final String uuid = "34dsr324";
+    private static final String ODAHU_NAME = "odahuTest";
+
+    private UserInfo userInfo;
+
+    @Mock
+    private OdahuDAO odahuDAO;
+
+    @Mock
+    private ProjectService projectService;
+
+    @Mock
+    private EndpointService endpointService;
+
+    @Mock
+    private RequestId requestId;
+
+    @Mock
+    private RESTService provisioningService;
+
+    @Mock
+    private RequestBuilder requestBuilder;
+
+    @Mock
+    private OdahuServiceImpl odahuService;
+
+    @Before

Review comment:
       Can we use **@BeforeClass** here?

##########
File path: services/self-service/src/main/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImpl.java
##########
@@ -84,14 +84,15 @@ public OdahuServiceImpl(ProjectService projectService, EndpointService endpointS
         return odahuDAO.findOdahuClusters();
     }
 
-    @Override
+    @Override//TODO:method should be refactored
     public Optional<OdahuDTO> get(String project, String endpoint) {
         return odahuDAO.getByProjectEndpoint(project, endpoint);
     }
 
     @BudgetLimited
     @Override
     public void create(@Project String project, OdahuCreateDTO odahuCreateDTO, UserInfo user) {
+

Review comment:
       Please remove this line




----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ofuks commented on a change in pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ofuks commented on a change in pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964#discussion_r519809009



##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.*;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.DlabException;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080/";
+    private static final String END_POINT_NAME = "testEndpoint";
+    private static final String tag = "testTag";
+    private static final String uuid = "34dsr324";
+    private static final String ODAHU_NAME = "odahuTest";
+    private static UserInfo userInfo;
+
+    @Mock
+    private OdahuDAO odahuDAO;
+
+    @Mock
+    private ProjectService projectService;
+
+    @Mock
+    private EndpointService endpointService;
+
+    @Mock
+    private RequestId requestId;
+
+    @Mock
+    private RESTService provisioningService;
+
+    @Mock
+    private RequestBuilder requestBuilder;
+
+    @InjectMocks
+    private OdahuServiceImpl odahuService;

Review comment:
       Please remove empty lines between variables

##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.*;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.DlabException;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080/";
+    private static final String END_POINT_NAME = "testEndpoint";
+    private static final String tag = "testTag";
+    private static final String uuid = "34dsr324";
+    private static final String ODAHU_NAME = "odahuTest";
+    private static UserInfo userInfo;
+
+    @Mock
+    private OdahuDAO odahuDAO;
+
+    @Mock
+    private ProjectService projectService;
+
+    @Mock
+    private EndpointService endpointService;
+
+    @Mock
+    private RequestId requestId;
+
+    @Mock
+    private RESTService provisioningService;
+
+    @Mock
+    private RequestBuilder requestBuilder;
+
+    @InjectMocks
+    private OdahuServiceImpl odahuService;
+
+    @BeforeClass
+    public static void setUp(){
+        userInfo = new UserInfo(USER, TOKEN);
+    }
+
+    @Test
+    public void findOdahuTest() {
+        List<OdahuDTO> odahuDTOList = odahuService.findOdahu();

Review comment:
       Do we want to verify **odahuDAO** method execution?

##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.*;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.DlabException;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080/";
+    private static final String END_POINT_NAME = "testEndpoint";

Review comment:
       **END_POINT_NAME** -> **ENDPOINT_NAME**
   **END_POINT_URL** -> **ENDPOINT_URL**




----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ppapou commented on a change in pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964#discussion_r523779525



##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.*;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.DlabException;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080/";
+    private static final String END_POINT_NAME = "testEndpoint";

Review comment:
       Variables names have been adjusted




----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ppapou commented on a change in pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964#discussion_r523779383



##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.*;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.DlabException;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080/";
+    private static final String END_POINT_NAME = "testEndpoint";
+    private static final String tag = "testTag";
+    private static final String uuid = "34dsr324";
+    private static final String ODAHU_NAME = "odahuTest";
+    private static UserInfo userInfo;
+
+    @Mock
+    private OdahuDAO odahuDAO;
+
+    @Mock
+    private ProjectService projectService;
+
+    @Mock
+    private EndpointService endpointService;
+
+    @Mock
+    private RequestId requestId;
+
+    @Mock
+    private RESTService provisioningService;
+
+    @Mock
+    private RequestBuilder requestBuilder;
+
+    @InjectMocks
+    private OdahuServiceImpl odahuService;
+
+    @BeforeClass
+    public static void setUp(){
+        userInfo = new UserInfo(USER, TOKEN);
+    }
+
+    @Test
+    public void findOdahuTest() {
+        List<OdahuDTO> odahuDTOList = odahuService.findOdahu();

Review comment:
       verification has been added




----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ppapou commented on a change in pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ppapou commented on a change in pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964#discussion_r523779356



##########
File path: services/self-service/src/test/java/com/epam/dlab/backendapi/service/impl/OdahuServiceImplTest.java
##########
@@ -0,0 +1,240 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package com.epam.dlab.backendapi.service.impl;
+
+import com.epam.dlab.auth.UserInfo;
+import com.epam.dlab.backendapi.dao.OdahuDAO;
+import com.epam.dlab.backendapi.domain.*;
+import com.epam.dlab.backendapi.service.EndpointService;
+import com.epam.dlab.backendapi.service.ProjectService;
+import com.epam.dlab.backendapi.util.RequestBuilder;
+import com.epam.dlab.cloud.CloudProvider;
+import com.epam.dlab.dto.UserInstanceStatus;
+import com.epam.dlab.dto.base.edge.EdgeInfo;
+import com.epam.dlab.exceptions.DlabException;
+import com.epam.dlab.exceptions.ResourceConflictException;
+import com.epam.dlab.rest.client.RESTService;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.InjectMocks;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.util.*;
+
+import static java.util.Collections.singletonList;
+import static org.junit.Assert.assertNotNull;
+import static org.mockito.Mockito.*;
+
+@RunWith(MockitoJUnitRunner.class)
+public class OdahuServiceImplTest {
+
+    private static final String USER = "testUser";
+    private static final String TOKEN = "testToken";
+    private static final String PROJECT = "testProject";
+    private static final String END_POINT_URL = "https://localhsot:8080/";
+    private static final String END_POINT_NAME = "testEndpoint";
+    private static final String tag = "testTag";
+    private static final String uuid = "34dsr324";
+    private static final String ODAHU_NAME = "odahuTest";
+    private static UserInfo userInfo;
+
+    @Mock
+    private OdahuDAO odahuDAO;
+
+    @Mock
+    private ProjectService projectService;
+
+    @Mock
+    private EndpointService endpointService;
+
+    @Mock
+    private RequestId requestId;
+
+    @Mock
+    private RESTService provisioningService;
+
+    @Mock
+    private RequestBuilder requestBuilder;
+
+    @InjectMocks
+    private OdahuServiceImpl odahuService;

Review comment:
       lines have been removed




----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ppapou commented on pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ppapou commented on pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964#issuecomment-728023787


   > Do we need to define exact values inside **when()** method? or we can use **any()**?
   
   The ANY calls have been added, where is it possible


----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org


[GitHub] [incubator-datalab] ofuks merged pull request #964: [DLAB-2116] Oduhu unitests

Posted by GitBox <gi...@apache.org>.
ofuks merged pull request #964:
URL: https://github.com/apache/incubator-datalab/pull/964


   


----------------------------------------------------------------
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@datalab.apache.org
For additional commands, e-mail: dev-help@datalab.apache.org