import static java.util.Collections.emptyList;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
public class TypesUploadServletTest extends JerseyTest {
User user = new User();
user.setUserId(userId);
user.setRole(Role.ADMIN.name());
- Either<User, ActionStatus> eitherUser = Either.left(user);
- when(userAdmin.getUser(userId, false)).thenReturn(eitherUser);
+ when(userAdmin.getUser(userId)).thenReturn(user);
when(request.getHeader(Constants.USER_ID_HEADER)).thenReturn(userId);
when(responseFormat.getStatus()).thenReturn(HttpStatus.CREATED_201);
when(componentUtils.getResponseFormat(ActionStatus.CREATED)).thenReturn(responseFormat);
Response response = target().path("/v1/catalog/uploadType/capability").request(MediaType.APPLICATION_JSON).post(Entity.entity(multipartEntity, MediaType.MULTIPART_FORM_DATA), Response.class);
- assertEquals(HttpStatus.CREATED_201, response.getStatus());
+ assertEquals(response.getStatus(), HttpStatus.CREATED_201);
}