Question: Thank you in advance for any help provided.
I have a method, inside a controller which ends with a classical redirect, as follows: 

```
redirect(action: 'login', params: params)

```

I would like to test this in my integration test. 
For the `action` part, I do as follows: 

```
assert creditProviderController.response.redirectedUrl.startsWith("/creditProvider/login")

```

First of all, isn't there anything cleaner to avoid the `startsWith()` call ?
And then, how can I test the `params` part ? 

I have been looking around and cannot find this answer. 

I wish you a pleasant day !

Answer: 
I would recommend testing the controller via a **unit** test that extends ControllerUnitTestCase. That gives you a very clean way to test your call to redirect(). For example:

```
assertEquals("login", redirectArgs.action)
assertNotNull(redirectArgs.params.username)

```

Test as much as reasonable via unit tests (especially the flow logic in controller actions), and use integration tests just to make sure everything plays nicely together and to verify the system state.
```
assert response.redirectedUrl == '/roleClientProfile/create?user.id=1'

```