Skip to content

Commit

Permalink
Add 'comments' column to 'application' entity (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrizzi authored Mar 8, 2021
1 parent 1cb64cf commit 18def1f
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ public class Application extends AbstractEntity {
@Filterable
public String description;
public String businessService;
@Filterable
public String comments;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alter table if exists application
add column comments varchar (5000);
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE application SET createUser = 'mrizzi', createTime = '2019-01-01 00:00:00.407', updateUser = 'mrizzi', updateTime = CURRENT_TIMESTAMP, deleted = false, comments = 'first' WHERE id = 1;
UPDATE application SET createUser = 'foo', createTime = '2020-01-01 00:00:00', updateUser = 'mrizzi', updateTime = CURRENT_TIMESTAMP, deleted = false, comments = 'first' WHERE id = 2;
UPDATE application SET createUser = 'foo', createTime = '2021-01-01 00:00:00', deleted = false, comments = '1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890' WHERE id = 3;

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package io.tackle.applicationinventory.resources;

import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.common.ResourceArg;
import io.quarkus.test.junit.QuarkusTest;
import io.tackle.commons.testcontainers.KeycloakTestResource;
import io.tackle.commons.testcontainers.PostgreSQLDatabaseTestResource;
import io.tackle.commons.tests.SecuredResourceTest;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.is;

@QuarkusTest
@QuarkusTestResource(value = PostgreSQLDatabaseTestResource.class,
initArgs = {
@ResourceArg(name = PostgreSQLDatabaseTestResource.DB_NAME, value = "application_inventory_db"),
@ResourceArg(name = PostgreSQLDatabaseTestResource.USER, value = "application_inventory"),
@ResourceArg(name = PostgreSQLDatabaseTestResource.PASSWORD, value = "application_inventory")
}
)
@QuarkusTestResource(value = KeycloakTestResource.class,
initArgs = {
@ResourceArg(name = KeycloakTestResource.IMPORT_REALM_JSON_PATH, value = "keycloak/quarkus-realm.json"),
@ResourceArg(name = KeycloakTestResource.REALM_NAME, value = "quarkus")
}
)
public class ApplicationResourceTest extends SecuredResourceTest {

@BeforeAll
public static void init() {
PATH = "/application";
}

@Test
public void testComments() {
given()
.accept("application/hal+json")
.queryParam("sort", "-id")
.when().get(PATH)
.then()
.statusCode(200)
.body("_embedded.application.comments[0].length()", is(1000));
}
}

0 comments on commit 18def1f

Please sign in to comment.