Skip to content

Instantly share code, notes, and snippets.

View ITUserTest.java
@Test
public void should_find_user_by_phone_with_corrected_field_and_date_of_birth_individual_user() {
String token = getJwtToken("0707070707");
User response =
given()
.header("Authorization", "Bearer " + token)
.pathParam("phone", "0707070707")
.contentType("application/json")
.when().get("/api/v1/users/{phone}")
View findUser.java
public class FindUserByPhoneHandler implements RequestHandler<Map<String, Object>, ApiGatewayResponse> {
private static final DynamoDBUserDao userDao = DynamoDBUserDao.instance();
@Override
public ApiGatewayResponse handleRequest(Map<String, Object> input, Context context) {
Tuple2<Jws<Claims>, ApiGatewayResponse> jwsParsed = JwtValidator.validateJwt(input, "admin|siteadmin|useradmin|agent|individual|global-admin");
if (jwsParsed._2 != null) {