use of org.folio.rest.jaxrs.model.User in project raml-module-builder by folio-org.
the class PgUtilIT method postDuplicateId400.
@Test
public void postDuplicateId400(TestContext testContext) {
String uuid = randomUuid();
post(testContext, "Anna", uuid, 201);
PgUtil.post("users", new User().withUsername("Elsa").withId(uuid), okapiHeaders, vertx.getOrCreateContext(), ResponseImpl.class, asyncAssertSuccess(testContext, 400, "id value already exists in table users: " + uuid));
}
use of org.folio.rest.jaxrs.model.User in project raml-module-builder by folio-org.
the class PgUtilIT method postResponseWithUser201Method.
@Test
public void postResponseWithUser201Method(TestContext testContext) {
String uuid = randomUuid();
PgUtil.post("users", new User().withUsername("Susi").withId(uuid), okapiHeaders, vertx.getOrCreateContext(), ResponseWithUserFor201Method.class, testContext.asyncAssertSuccess(result -> {
assertThat(result.getStatus(), is(201));
assertGetById(testContext, uuid, "Susi");
}));
}
use of org.folio.rest.jaxrs.model.User in project raml-module-builder by folio-org.
the class MetadataUtilTest method populateMetadataNoop.
@Test
void populateMetadataNoop() throws Exception {
String uuid = UUID.randomUUID().toString();
User user = new User().withId(uuid);
MetadataUtil.populateMetadata(user, headers());
assertThat(user.getId(), is(uuid));
}
use of org.folio.rest.jaxrs.model.User in project raml-module-builder by folio-org.
the class PostgresClientTest method pojo2JsonObject.
@Test
public void pojo2JsonObject() throws Exception {
String id = UUID.randomUUID().toString();
User user = new User().withId(id).withUsername("name").withVersion(5);
JsonObject json = PostgresClient.pojo2JsonObject(user);
assertThat(json.getMap(), is(Map.of("id", id, "username", "name", "_version", 5)));
}
use of org.folio.rest.jaxrs.model.User in project raml-module-builder by folio-org.
the class PgUtilIT method put409WhenOptimisticLockingVersionIsWrong.
@Test
public void put409WhenOptimisticLockingVersionIsWrong(TestContext testContext) {
String uuid = randomUuid();
post(testContext, "Pippilotta", uuid, 201);
getUser(uuid).compose(user -> PgUtil.put("users", user.withUsername("Momo").withVersion(5), uuid, okapiHeaders, vertx.getOrCreateContext(), Users.PutUsersByUserIdResponse.class)).onComplete(asyncAssertSuccess(testContext, 409, put -> assertGetById(testContext, uuid, "Pippilotta")));
}
Aggregations