The simple answer to your question is that you can use a library like EasyMock to help you. In simple terms, it works like so:
This is the general idea of working with mocks.
Now, as it might become apparent, your code needs quite a few expectations. This is because you are doing a lot of db stuff in the action itself that could be refactored somewhere else. For example, you could have a personService with a delete method, where you'd encapsulate your code in, say, a deleteUser(String username). In the the action you would therefore only have to mock one method (the deleteUser one), and you can simulate what you want to happen in your action for an array of situations (what if that method throws an exception? what if the user doesn't exist?): it's just a matter of mocking the expectations.
Another (simpler) way would be to encapsulate that code in a helper method in the action, like:
You can then test it in your class by overriding that method for testing purposes.
For more on this, I suggest the reading of Lasse Koskela's excellent Test Driven, which explores these strategies in the context of TDD.