Search in sources :

Example 1 with UserRatingStability

use of org.haiku.haikudepotserver.dataobjects.UserRatingStability in project haikudepotserver by haiku.

the class MiscelaneousApiIT method testGetAllUserRatingStabilities.

@Test
public void testGetAllUserRatingStabilities() {
    // ------------------------------------
    GetAllUserRatingStabilitiesResult result = miscellaneousApi.getAllUserRatingStabilities(new GetAllUserRatingStabilitiesRequest());
    // ------------------------------------
    ObjectContext objectContext = serverRuntime.newContext();
    List<UserRatingStability> userRatingStabilities = UserRatingStability.getAll(objectContext);
    Assertions.assertThat(userRatingStabilities.size()).isEqualTo(result.userRatingStabilities.size());
    for (int i = 0; i < userRatingStabilities.size(); i++) {
        UserRatingStability userRatingStability = userRatingStabilities.get(i);
        GetAllUserRatingStabilitiesResult.UserRatingStability apiUserRatingStability = result.userRatingStabilities.get(i);
        Assertions.assertThat(userRatingStability.getCode()).isEqualTo(apiUserRatingStability.code);
        Assertions.assertThat(userRatingStability.getName()).isEqualTo(apiUserRatingStability.name);
    }
}
Also used : GetAllUserRatingStabilitiesResult(org.haiku.haikudepotserver.api1.model.miscellaneous.GetAllUserRatingStabilitiesResult) GetAllUserRatingStabilitiesRequest(org.haiku.haikudepotserver.api1.model.miscellaneous.GetAllUserRatingStabilitiesRequest) ObjectContext(org.apache.cayenne.ObjectContext) UserRatingStability(org.haiku.haikudepotserver.dataobjects.UserRatingStability) AbstractIntegrationTest(org.haiku.haikudepotserver.AbstractIntegrationTest) Test(org.junit.jupiter.api.Test)

Aggregations

ObjectContext (org.apache.cayenne.ObjectContext)1 AbstractIntegrationTest (org.haiku.haikudepotserver.AbstractIntegrationTest)1 GetAllUserRatingStabilitiesRequest (org.haiku.haikudepotserver.api1.model.miscellaneous.GetAllUserRatingStabilitiesRequest)1 GetAllUserRatingStabilitiesResult (org.haiku.haikudepotserver.api1.model.miscellaneous.GetAllUserRatingStabilitiesResult)1 UserRatingStability (org.haiku.haikudepotserver.dataobjects.UserRatingStability)1 Test (org.junit.jupiter.api.Test)1