Search in sources :

Example 1 with AgreeUserUsageConditionsResult

use of org.haiku.haikudepotserver.api1.model.user.AgreeUserUsageConditionsResult in project haikudepotserver by haiku.

the class UserApiIT method testAgreeUserUsageConditions.

public void testAgreeUserUsageConditions() {
    ObjectContext context = serverRuntime.newContext();
    integrationTestSupportService.createBasicUser(context, "testuser", "yUe4o2Nwe009");
    setAuthenticatedUser("testuser");
    AgreeUserUsageConditionsRequest request = new AgreeUserUsageConditionsRequest();
    request.userUsageConditionsCode = "UUC2019V01";
    request.nickname = "testuser";
    // ------------------------------------
    AgreeUserUsageConditionsResult result = userApi.agreeUserUsageConditions(request);
    // ------------------------------------
    Assertions.assertThat(result).isNotNull();
    {
        User userAfter = User.getByNickname(context, "testuser");
        Assertions.assertThat(userAfter.tryGetUserUsageConditionsAgreement().get().getUserUsageConditions().getCode()).isEqualTo("UUC2019V01");
    }
}
Also used : AgreeUserUsageConditionsRequest(org.haiku.haikudepotserver.api1.model.user.AgreeUserUsageConditionsRequest) AgreeUserUsageConditionsResult(org.haiku.haikudepotserver.api1.model.user.AgreeUserUsageConditionsResult) User(org.haiku.haikudepotserver.dataobjects.User) ObjectContext(org.apache.cayenne.ObjectContext)

Aggregations

ObjectContext (org.apache.cayenne.ObjectContext)1 AgreeUserUsageConditionsRequest (org.haiku.haikudepotserver.api1.model.user.AgreeUserUsageConditionsRequest)1 AgreeUserUsageConditionsResult (org.haiku.haikudepotserver.api1.model.user.AgreeUserUsageConditionsResult)1 User (org.haiku.haikudepotserver.dataobjects.User)1