2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.servlets;
23 import static org.assertj.core.api.Assertions.assertThat;
24 import static org.junit.Assert.assertEquals;
25 import static org.mockito.ArgumentMatchers.any;
26 import static org.mockito.ArgumentMatchers.anyString;
27 import static org.mockito.ArgumentMatchers.eq;
28 import static org.mockito.ArgumentMatchers.nullable;
29 import static org.mockito.Mockito.when;
30 import static org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum.SERVICE_PARAM_NAME;
32 import com.fasterxml.jackson.core.JsonProcessingException;
33 import com.fasterxml.jackson.databind.ObjectMapper;
34 import fj.data.Either;
35 import java.util.ArrayList;
36 import java.util.Arrays;
37 import java.util.List;
39 import javax.servlet.ServletContext;
40 import javax.servlet.http.HttpServletRequest;
41 import javax.servlet.http.HttpSession;
42 import javax.ws.rs.client.Entity;
43 import javax.ws.rs.core.MediaType;
44 import javax.ws.rs.core.Response;
45 import org.eclipse.jetty.http.HttpStatus;
46 import org.glassfish.hk2.utilities.binding.AbstractBinder;
47 import org.glassfish.jersey.server.ResourceConfig;
48 import org.glassfish.jersey.test.JerseyTest;
49 import org.glassfish.jersey.test.TestProperties;
50 import org.junit.jupiter.api.AfterEach;
51 import org.junit.jupiter.api.BeforeAll;
52 import org.junit.jupiter.api.BeforeEach;
53 import org.junit.jupiter.api.Test;
54 import org.mockito.ArgumentMatchers;
55 import org.mockito.Mockito;
56 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
57 import org.openecomp.sdc.be.components.impl.ComponentNodeFilterBusinessLogic;
58 import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
59 import org.openecomp.sdc.be.components.impl.ResourceImportManager;
60 import org.openecomp.sdc.be.components.impl.ServiceBusinessLogic;
61 import org.openecomp.sdc.be.config.Configuration;
62 import org.openecomp.sdc.be.config.ConfigurationManager;
63 import org.openecomp.sdc.be.config.SpringConfig;
64 import org.openecomp.sdc.be.dao.api.ActionStatus;
65 import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum;
66 import org.openecomp.sdc.be.impl.ComponentsUtils;
67 import org.openecomp.sdc.be.impl.ServletUtils;
68 import org.openecomp.sdc.be.impl.WebAppContextWrapper;
69 import org.openecomp.sdc.be.model.ComponentInstance;
70 import org.openecomp.sdc.be.model.ComponentInstanceInput;
71 import org.openecomp.sdc.be.model.ComponentInstanceProperty;
72 import org.openecomp.sdc.be.model.RequirementCapabilityRelDef;
73 import org.openecomp.sdc.be.model.RequirementDefinition;
74 import org.openecomp.sdc.be.model.User;
75 import org.openecomp.sdc.be.resources.data.auditing.AuditingActionEnum;
76 import org.openecomp.sdc.be.user.UserBusinessLogic;
77 import org.openecomp.sdc.common.api.Constants;
78 import org.openecomp.sdc.common.api.ConfigurationSource;
79 import org.openecomp.sdc.common.impl.ExternalConfiguration;
80 import org.openecomp.sdc.common.impl.FSConfigurationSource;
81 import org.openecomp.sdc.exception.ResponseFormat;
82 import org.springframework.context.ApplicationContext;
83 import org.springframework.context.annotation.AnnotationConfigApplicationContext;
84 import org.springframework.web.context.WebApplicationContext;
88 * The test suite designed for test functionality of ComponentInstanceServlet class
90 class ComponentInstanceServletTest extends JerseyTest {
92 private final static String USER_ID = "jh0003";
93 private static HttpServletRequest request;
94 private static HttpSession session;
95 private static ServletContext servletContext;
96 private static WebAppContextWrapper webAppContextWrapper;
97 private static WebApplicationContext webApplicationContext;
98 private static ComponentInstanceBusinessLogic componentInstanceBusinessLogic;
99 private static ComponentsUtils componentsUtils;
100 private static ServletUtils servletUtils;
101 private static ResponseFormat responseFormat;
102 private static UserBusinessLogic userBusinessLogic;
103 private static GroupBusinessLogic groupBusinessLogic;
104 private static ResourceImportManager resourceImportManager;
105 private static ServiceBusinessLogic serviceBusinessLogic;
106 private static ComponentNodeFilterBusinessLogic componentNodeFilterBusinessLogic;
107 private static ConfigurationManager configurationManager;
110 public static void setup() {
113 String appConfigDir = "src/test/resources/config/catalog-be";
114 ConfigurationSource configurationSource = new FSConfigurationSource(ExternalConfiguration.getChangeListener(), appConfigDir);
115 configurationManager = new ConfigurationManager(configurationSource);
116 org.openecomp.sdc.be.config.Configuration configuration = new org.openecomp.sdc.be.config.Configuration();
117 configuration.setJanusGraphInMemoryGraph(true);
118 configurationManager.setConfiguration(configuration);
119 ExternalConfiguration.setAppName("catalog-be");
123 public void before() throws Exception {
128 public void tearDown() throws Exception {
133 void testGetRelationByIdSuccess() {
135 String containerComponentType = "resources";
136 String componentId = "componentId";
137 String relationId = "relationId";
138 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/" + relationId + "/relationId";
139 Either<RequirementCapabilityRelDef, ResponseFormat> successResponse = Either
140 .left(new RequirementCapabilityRelDef());
141 when(componentInstanceBusinessLogic
142 .getRelationById(eq(componentId), eq(relationId), eq(USER_ID), eq(ComponentTypeEnum.RESOURCE)))
143 .thenReturn(successResponse);
144 when(responseFormat.getStatus()).thenReturn(HttpStatus.OK_200);
145 when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
146 Response response = target()
148 .request(MediaType.APPLICATION_JSON)
149 .accept(MediaType.APPLICATION_JSON)
150 .header("USER_ID", USER_ID)
151 .get(Response.class);
153 assertThat(response.getStatus()).isEqualTo(HttpStatus.OK_200);
157 void testGetRelationByIdFailure() {
159 String containerComponentType = "unknown_type";
160 String componentId = "componentId";
161 String relationId = "relationId";
162 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/" + relationId + "/relationId";
163 when(responseFormat.getStatus()).thenReturn(HttpStatus.BAD_REQUEST_400);
164 when(componentsUtils.getResponseFormat(eq(ActionStatus.UNSUPPORTED_ERROR), eq(containerComponentType)))
165 .thenReturn(responseFormat);
166 Response response = target()
168 .request(MediaType.APPLICATION_JSON)
169 .header("USER_ID", USER_ID)
170 .get(Response.class);
172 assertEquals(HttpStatus.BAD_REQUEST_400, response.getStatus());
176 void testBatchDeleteResourceInstancesSuccess() {
178 String componentId = "componentId";
179 String containerComponentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
180 String compId1 = "compId1";
181 String[] delCompIds = new String[1];
182 delCompIds[0] = compId1;
183 List<ComponentInstance> compInsts = new ArrayList<ComponentInstance>();
184 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/batchDeleteResourceInstances";
186 ComponentInstance compInst = new ComponentInstance();
187 compInst.setName(compId1);
188 compInst.setUniqueId(compId1);
189 compInst.setComponentUid(compId1);
190 compInst.setInvariantName(compId1);
191 compInsts.add(compInst);
193 when(responseFormat.getStatus()).thenReturn(HttpStatus.OK_200);
194 when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
195 Either<String[], ResponseFormat> convertStatusEither = Either.left(delCompIds);
197 .convertJsonToObjectUsingObjectMapper(anyString(), any(User.class), ArgumentMatchers.<Class<String[]>>any(),
198 nullable(AuditingActionEnum.class), nullable(ComponentTypeEnum.class))).thenReturn(convertStatusEither);
199 when(componentInstanceBusinessLogic
200 .batchDeleteComponentInstance(eq(containerComponentType), eq(componentId), any(List.class),
201 eq(USER_ID))).thenReturn(Mockito.mock(Map.class));
203 Response response = target()
205 .request(MediaType.APPLICATION_JSON)
206 .header("USER_ID", USER_ID)
207 .post(Entity.json(compInsts));
209 assertEquals(HttpStatus.OK_200, response.getStatus());
213 void testBatchDeleteResourceInstancesFailure() {
215 String componentId = "componentId";
216 String containerComponentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
217 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/batchDeleteResourceInstances";
219 when(responseFormat.getStatus()).thenReturn(HttpStatus.INTERNAL_SERVER_ERROR_500);
220 when(componentsUtils.getResponseFormat(ActionStatus.INVALID_CONTENT)).thenReturn(responseFormat);
222 Response response = target()
224 .request(MediaType.APPLICATION_JSON)
225 .header("USER_ID", USER_ID)
226 .post(Entity.json(""));
228 assertEquals(HttpStatus.INTERNAL_SERVER_ERROR_500, response.getStatus());
232 void testBatchDissociateRIFromRISuccess() {
234 String componentId = "componentId";
235 String containerComponentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
236 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/resourceInstance/batchDissociate";
237 RequirementCapabilityRelDef[] refs = new RequirementCapabilityRelDef[1];
238 RequirementCapabilityRelDef ref = new RequirementCapabilityRelDef();
241 when(responseFormat.getStatus()).thenReturn(HttpStatus.OK_200);
242 when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
243 Either<RequirementCapabilityRelDef[], ResponseFormat> convertReqEither = Either.left(refs);
244 when(componentsUtils.convertJsonToObjectUsingObjectMapper(anyString(), any(User.class),
245 ArgumentMatchers.<Class<RequirementCapabilityRelDef[]>>any(),
246 nullable(AuditingActionEnum.class), nullable(ComponentTypeEnum.class))).thenReturn(convertReqEither);
247 RequirementCapabilityRelDef actionResponseEither = ref;
248 when(componentInstanceBusinessLogic
249 .dissociateRIFromRI(componentId, USER_ID, ref, ComponentTypeEnum.findByParamName(containerComponentType)))
250 .thenReturn(actionResponseEither);
252 Response response = target()
254 .request(MediaType.APPLICATION_JSON)
255 .header("USER_ID", USER_ID)
256 .put(Entity.json(refs));
258 assertEquals(HttpStatus.OK_200, response.getStatus());
262 void testBatchDissociateRIFromRIFailure() {
264 String componentId = "componentId";
265 String containerComponentType = ComponentTypeEnum.SERVICE_PARAM_NAME;
266 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/resourceInstance/batchDissociate";
268 when(responseFormat.getStatus()).thenReturn(HttpStatus.INTERNAL_SERVER_ERROR_500);
269 when(componentsUtils.getResponseFormat(ActionStatus.INVALID_CONTENT)).thenReturn(responseFormat);
271 Response response = target()
273 .request(MediaType.APPLICATION_JSON)
274 .header("USER_ID", USER_ID)
275 .put(Entity.json(""));
277 assertEquals(HttpStatus.INTERNAL_SERVER_ERROR_500, response.getStatus());
281 protected ResourceConfig configure() {
282 forceSet(TestProperties.CONTAINER_PORT, "0");
283 ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
284 return new ResourceConfig(ComponentInstanceServlet.class)
285 .register(new AbstractBinder() {
287 protected void configure() {
288 bind(request).to(HttpServletRequest.class);
289 bind(userBusinessLogic).to(UserBusinessLogic.class);
290 bind(groupBusinessLogic).to(GroupBusinessLogic.class);
291 bind(componentInstanceBusinessLogic).to(ComponentInstanceBusinessLogic.class);
292 bind(componentsUtils).to(ComponentsUtils.class);
293 bind(servletUtils).to(ServletUtils.class);
294 bind(resourceImportManager).to(ResourceImportManager.class);
295 bind(serviceBusinessLogic).to(ServiceBusinessLogic.class);
296 bind(componentNodeFilterBusinessLogic).to(ComponentNodeFilterBusinessLogic.class);
299 .property("contextConfig", context);
302 private static void createMocks() {
303 request = Mockito.mock(HttpServletRequest.class);
304 session = Mockito.mock(HttpSession.class);
305 servletContext = Mockito.mock(ServletContext.class);
306 webAppContextWrapper = Mockito.mock(WebAppContextWrapper.class);
307 webApplicationContext = Mockito.mock(WebApplicationContext.class);
308 userBusinessLogic = Mockito.mock(UserBusinessLogic.class);
309 groupBusinessLogic = Mockito.mock(GroupBusinessLogic.class);
310 resourceImportManager = Mockito.mock(ResourceImportManager.class);
311 componentInstanceBusinessLogic = Mockito.mock(ComponentInstanceBusinessLogic.class);
312 componentsUtils = Mockito.mock(ComponentsUtils.class);
313 servletUtils = Mockito.mock(ServletUtils.class);
314 responseFormat = Mockito.mock(ResponseFormat.class);
315 serviceBusinessLogic = Mockito.mock(ServiceBusinessLogic.class);
316 componentNodeFilterBusinessLogic = Mockito.mock(ComponentNodeFilterBusinessLogic.class);
319 private static void stubMethods() {
320 when(request.getSession()).thenReturn(session);
321 when(session.getServletContext()).thenReturn(servletContext);
322 when(servletContext.getAttribute(Constants.WEB_APPLICATION_CONTEXT_WRAPPER_ATTR))
323 .thenReturn(webAppContextWrapper);
324 when(webAppContextWrapper.getWebAppContext(servletContext)).thenReturn(webApplicationContext);
325 when(webApplicationContext.getBean(ComponentInstanceBusinessLogic.class))
326 .thenReturn(componentInstanceBusinessLogic);
327 when(request.getHeader("USER_ID")).thenReturn(USER_ID);
328 when(webApplicationContext.getBean(ServletUtils.class)).thenReturn(servletUtils);
329 when(servletUtils.getComponentsUtils()).thenReturn(componentsUtils);
333 void testUpdateResourceInstancePropertiesSuccess() {
335 String containerComponentType = "services";
336 String componentId = "componentId";
337 String resourceInstanceId = "resourceInstanceId";
338 ComponentInstanceProperty[] properties = new ComponentInstanceProperty[1];
339 ComponentInstanceProperty property = new ComponentInstanceProperty();
340 property.setName("property");
341 property.setValue("value");
342 property.setType("String");
343 properties[0] = (property);
344 ObjectMapper mapper = new ObjectMapper();
345 String propertyJson = null;
347 propertyJson = mapper.writeValueAsString(properties);
348 } catch (JsonProcessingException e) {
351 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/resourceInstance" + "/" +
352 resourceInstanceId + "/properties";
354 .convertJsonToObjectUsingObjectMapper(propertyJson, new User(), ComponentInstanceProperty[].class,
355 null, ComponentTypeEnum.RESOURCE_INSTANCE)).thenReturn(Either.left(properties));
356 when(componentInstanceBusinessLogic
357 .createOrUpdatePropertiesValues(eq(ComponentTypeEnum.findByParamName(SERVICE_PARAM_NAME)),
358 eq(componentId), eq(resourceInstanceId), eq(Arrays.asList(properties)), eq(USER_ID)))
359 .thenReturn(Either.left(Arrays.asList(properties)));
360 when(responseFormat.getStatus()).thenReturn(HttpStatus.OK_200);
361 when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
362 Response response = target()
364 .request(MediaType.APPLICATION_JSON)
365 .header("USER_ID", USER_ID).post(Entity.entity(properties, MediaType.APPLICATION_JSON));
366 assertThat(response.getStatus()).isEqualTo(HttpStatus.OK_200);
370 void testUpdateResourceInstanceInputsSuccess() {
372 String containerComponentType = "services";
373 String componentId = "componentId";
374 String resourceInstanceId = "resourceInstanceId";
375 ComponentInstanceInput[] inputs = new ComponentInstanceInput[1];
376 ComponentInstanceInput input = new ComponentInstanceInput();
377 input.setName("input");
378 input.setValue("value");
379 input.setType("String");
381 ObjectMapper mapper = new ObjectMapper();
382 String inputJson = null;
384 inputJson = mapper.writeValueAsString(inputs);
385 } catch (JsonProcessingException e) {
388 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/resourceInstance" + "/" +
389 resourceInstanceId + "/inputs";
390 when(componentsUtils.convertJsonToObjectUsingObjectMapper(inputJson, new User(), ComponentInstanceInput[].class,
391 null, ComponentTypeEnum.RESOURCE_INSTANCE)).thenReturn(Either.left(inputs));
392 when(componentInstanceBusinessLogic
393 .createOrUpdateInstanceInputValues(eq(ComponentTypeEnum.findByParamName(SERVICE_PARAM_NAME)),
394 eq(componentId), eq(resourceInstanceId), eq(Arrays.asList(inputs)), eq(USER_ID)))
395 .thenReturn(Either.left(Arrays.asList(inputs)));
396 when(responseFormat.getStatus()).thenReturn(HttpStatus.OK_200);
397 when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
398 Response response = target()
400 .request(MediaType.APPLICATION_JSON)
401 .header("USER_ID", USER_ID).post(Entity.entity(inputs, MediaType.APPLICATION_JSON));
402 assertThat(response.getStatus()).isEqualTo(HttpStatus.OK_200);
406 void testUpdateResourceInstancePropertiesFailure() {
408 String containerComponentType = "services";
409 String componentId = "componentId";
410 String resourceInstanceId = "resourceInstanceId";
411 ComponentInstanceProperty[] properties = new ComponentInstanceProperty[1];
412 ComponentInstanceProperty property = new ComponentInstanceProperty();
413 property.setName("property");
414 property.setValue("value");
415 property.setType("String");
416 properties[0] = (property);
417 ObjectMapper mapper = new ObjectMapper();
418 String propertyJson = null;
420 propertyJson = mapper.writeValueAsString(properties);
421 } catch (JsonProcessingException e) {
424 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/resourceInstance" + "/" +
425 resourceInstanceId + "/properties";
427 .convertJsonToObjectUsingObjectMapper(propertyJson, new User(), ComponentInstanceProperty[].class,
428 null, ComponentTypeEnum.RESOURCE_INSTANCE)).thenReturn(Either.left(properties));
429 when(componentInstanceBusinessLogic
430 .createOrUpdatePropertiesValues(eq(ComponentTypeEnum.findByParamName(SERVICE_PARAM_NAME)),
431 eq(componentId), eq(resourceInstanceId), eq(Arrays.asList(properties)), eq(USER_ID)))
432 .thenReturn(Either.right(new ResponseFormat(404)));
433 when(responseFormat.getStatus()).thenReturn(HttpStatus.NOT_FOUND_404);
434 when(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_NOT_FOUND)).thenReturn(responseFormat);
435 Response response = target()
437 .request(MediaType.APPLICATION_JSON)
438 .header("USER_ID", USER_ID).post(Entity.entity(properties, MediaType.APPLICATION_JSON));
439 assertThat(response.getStatus()).isEqualTo(HttpStatus.NOT_FOUND_404);
443 void testUpdateResourceInstanceInputsFailure() {
445 String containerComponentType = "services";
446 String componentId = "componentId";
447 String resourceInstanceId = "resourceInstanceId";
448 ComponentInstanceInput[] inputs = new ComponentInstanceInput[1];
449 ComponentInstanceInput input = new ComponentInstanceInput();
450 input.setName("input");
451 input.setValue("value");
452 input.setType("String");
454 ObjectMapper mapper = new ObjectMapper();
455 String inputJson = null;
457 inputJson = mapper.writeValueAsString(inputs);
458 } catch (JsonProcessingException e) {
461 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/resourceInstance" + "/" +
462 resourceInstanceId + "/inputs";
463 when(componentsUtils.convertJsonToObjectUsingObjectMapper(inputJson, new User(), ComponentInstanceInput[].class,
464 null, ComponentTypeEnum.RESOURCE_INSTANCE)).thenReturn(Either.left(inputs));
465 when(componentInstanceBusinessLogic
466 .createOrUpdateInstanceInputValues(eq(ComponentTypeEnum.findByParamName(SERVICE_PARAM_NAME)),
467 eq(componentId), eq(resourceInstanceId), eq(Arrays.asList(inputs)), eq(USER_ID)))
468 .thenReturn(Either.right(new ResponseFormat(404)));
469 when(responseFormat.getStatus()).thenReturn(HttpStatus.NOT_FOUND_404);
470 when(componentsUtils.getResponseFormat(ActionStatus.RESOURCE_NOT_FOUND)).thenReturn(responseFormat);
471 Response response = target()
473 .request(MediaType.APPLICATION_JSON)
474 .header("USER_ID", USER_ID).post(Entity.entity(inputs, MediaType.APPLICATION_JSON));
475 assertThat(response.getStatus()).isEqualTo(HttpStatus.NOT_FOUND_404);
479 void testUpdateInstanceRequirement() {
481 String containerComponentType = "services";
482 String componentId = "componentId";
483 String componentInstanceId = "componentInstanceIdInstanceId";
484 String capabilityType = "capabilityType";
485 String requirementName = "requirementName";
486 RequirementDefinition requirementDefinition = new RequirementDefinition();
487 ObjectMapper mapper = new ObjectMapper();
488 String requirementJson = null;
490 requirementJson = mapper.writeValueAsString(requirementDefinition);
491 } catch (JsonProcessingException e) {
494 String path = "/v1/catalog/" + containerComponentType + "/" + componentId + "/componentInstances/" +
495 componentInstanceId + "/requirement/" + capabilityType + "/requirementName/" + requirementName;
497 .convertJsonToObjectUsingObjectMapper(eq(requirementJson), any(User.class), eq(RequirementDefinition.class),
498 eq(AuditingActionEnum.GET_TOSCA_MODEL), eq(ComponentTypeEnum.SERVICE)))
499 .thenReturn(Either.left(requirementDefinition));
500 when(componentInstanceBusinessLogic.updateInstanceRequirement(ComponentTypeEnum.SERVICE,
501 componentId, componentInstanceId, capabilityType, requirementName, requirementDefinition, USER_ID))
502 .thenReturn(Either.left(requirementDefinition));
503 when(componentsUtils.getResponseFormat(ActionStatus.OK)).thenReturn(responseFormat);
504 when(responseFormat.getStatus()).thenReturn(HttpStatus.OK_200);
506 Response response = target()
508 .request(MediaType.APPLICATION_JSON)
509 .header("USER_ID", USER_ID).put(Entity.entity(requirementDefinition, MediaType.APPLICATION_JSON));
510 assertThat(response.getStatus()).isEqualTo(HttpStatus.OK_200);