Created
July 18, 2012 15:31
-
-
Save jasongonzales23/3136949 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.codehaus.groovy.grails.web.json.JSONObject; | |
import grails.converters.JSON; | |
import groovy.util.GroovyTestCase; | |
import org.springframework.mock.web.MockHttpServletResponse; | |
public class UserServiceTests extends GroovyTestCase { | |
def userService; | |
@Override | |
protected void setUp() throws Exception { | |
super.setUp(); | |
userService = new UserService(); | |
} | |
void testHasBillingPermission_withErrorResponse() { | |
def json = new JSONObject() | |
json.code = "error.invalid.from.date" | |
def result = new ErrorResponseData(400, json) | |
println(result); | |
def request = [ | |
userId: 1, | |
billingPermissions: result | |
] | |
println(request); | |
def data = userService.hasBillingPermission(request, BillingPermissions.ADD_DW_ACCOUNT ); | |
println(data); | |
assert data == true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment