use of com.hw.helper.ResourceOwner in project mt-auth by publicdevop2019.
the class BizUserApiSecurityTest method should_not_able_to_create_user_w_client_missing_right_role.
@Test
public void should_not_able_to_create_user_w_client_missing_right_role() throws JsonProcessingException {
ResourceOwner user = action.randomCreateUserDraft();
ResponseEntity<DefaultOAuth2AccessToken> registerTokenResponse = action.getJwtClientCredential(CLIENT_ID_RIGHT_ROLE_NOT_SUFFICIENT_RESOURCE_ID, EMPTY_CLIENT_SECRET);
String value = registerTokenResponse.getBody().getValue();
ResponseEntity<Void> pendingUser = action.createPendingUser(user, value, new PendingResourceOwner());
Assert.assertEquals(HttpStatus.FORBIDDEN, pendingUser.getStatusCode());
}
Aggregations