aa7bfed331
Release package / release (push) Successful in 22m28s
Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #61
41 lines
794 B
Java
41 lines
794 B
Java
package com.drinkool.services;
|
|
|
|
import static io.restassured.RestAssured.*;
|
|
|
|
import com.drinkool.*;
|
|
import com.drinkool.dtos.*;
|
|
import io.quarkus.test.junit.QuarkusTest;
|
|
import io.restassured.http.ContentType;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
@QuarkusTest
|
|
public class AccountServiceTest {
|
|
|
|
@Test
|
|
void testSmsOtp() {
|
|
String phone = Utils.generateRandomPhone();
|
|
SmsOtp input = new SmsOtp();
|
|
input.phone = phone;
|
|
|
|
Signup signup = new Signup();
|
|
signup.phone = phone;
|
|
signup.name = "sms user";
|
|
signup.password = "password123";
|
|
|
|
given()
|
|
.contentType(ContentType.JSON)
|
|
.body(signup)
|
|
.when()
|
|
.post(Role.Customer + Url.Signup)
|
|
.then();
|
|
|
|
given()
|
|
.contentType(ContentType.JSON)
|
|
.body(input)
|
|
.when()
|
|
.post(Url.SmsOtp)
|
|
.then()
|
|
.statusCode(202);
|
|
}
|
|
}
|