Skip to content

Commit

Permalink
fix plural queries
Browse files Browse the repository at this point in the history
  • Loading branch information
elguardian committed Dec 15, 2023
1 parent ae67b96 commit 29440e6
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public UserTaskInstanceAttachmentTO(String eventId, Date eventDate, String event
this.businessKey = businessKey;
this.attachmentId = attachmentId;
this.attachmentName = attachmentName;
this.attachmentURI = URI.create(new String(attachmentURI));
if (attachmentURI != null) {
this.attachmentURI = URI.create(new String(attachmentURI));
}
this.eventType = eventType;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type Query {
GetAllUserTaskInstanceState (pagination: Pagination) : [UserTaskInstanceStateLog]
GetAllUserTaskInstanceAssignments (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceAssignmentLog]
GetAllUserTaskInstanceAttachments (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceAttachmentLog]
GetAllUserTaskInstanceComment (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceCommentLog]
GetAllUserTaskInstanceDeadline (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceDeadlineLog]
GetAllUserTaskInstanceVariable (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceVariableLog]
GetAllUserTaskInstanceComments (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceCommentLog]
GetAllUserTaskInstanceDeadlines (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceDeadlineLog]
GetAllUserTaskInstanceVariables (userTaskInstanceId : String!, pagination: Pagination) : [UserTaskInstanceVariableLog]
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public List<GraphQLSchemaQuery<?>> queries() {
return List.of(
new JPASimpleNamedQuery<UserTaskInstanceStateTO>("GetAllUserTaskInstanceState", UserTaskInstanceStateTO.class),
new JPASimpleNamedQuery<UserTaskInstanceAttachmentTO>("GetAllUserTaskInstanceAttachments", UserTaskInstanceAttachmentTO.class),
new JPASimpleNamedQuery<UserTaskInstanceCommentTO>("GetAllUserTaskInstanceComment", UserTaskInstanceCommentTO.class),
new JPASimpleNamedQuery<UserTaskInstanceVariableTO>("GetAllUserTaskInstanceVariable", UserTaskInstanceVariableTO.class),
new JPASimpleNamedQuery<UserTaskInstanceCommentTO>("GetAllUserTaskInstanceComments", UserTaskInstanceCommentTO.class),
new JPASimpleNamedQuery<UserTaskInstanceVariableTO>("GetAllUserTaskInstanceVariables", UserTaskInstanceVariableTO.class),
new JPAComplexNamedQuery<UserTaskInstanceAssignmentTO, Object[]>("GetAllUserTaskInstanceAssignments", new UserTaskInstanceAssignmentTOMapper()),
new JPAComplexNamedQuery<UserTaskInstanceDeadlineTO, Object[]>("GetAllUserTaskInstanceDeadline", new UserTaskInstanceDeadlineTOMapper()));
new JPAComplexNamedQuery<UserTaskInstanceDeadlineTO, Object[]>("GetAllUserTaskInstanceDeadlines", new UserTaskInstanceDeadlineTOMapper()));
}

public OffsetDateTime toDateTime(Date date) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-native-query>

<named-native-query name="GetAllUserTaskInstanceComment">
<named-native-query name="GetAllUserTaskInstanceComments">
<query>
SELECT
log.event_id,
Expand All @@ -621,7 +621,7 @@
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-native-query>

<named-native-query name="GetAllUserTaskInstanceDeadline">
<named-native-query name="GetAllUserTaskInstanceDeadlines">
<query>
SELECT log.event_id as eventId,
log.event_date as eventDate,
Expand All @@ -639,7 +639,7 @@
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-native-query>

<named-native-query name="GetAllUserTaskInstanceVariable" >
<named-native-query name="GetAllUserTaskInstanceVariables" >
<query>
SELECT
log.event_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ public void init() {
UserTaskInstanceAttachmentEventBody.EVENT_TYPE_ADDED);
publisher.publish(attEvent);

attEvent = newUserTaskInstanceAttachmentEvent(uEvent, "eventUser", "att2", "attName2", URI.create("http://localhost:8080/att2"),
UserTaskInstanceAttachmentEventBody.EVENT_TYPE_ADDED);
attEvent = newUserTaskInstanceAttachmentEvent(uEvent, "eventUser", "att2", "attName2", null,
UserTaskInstanceAttachmentEventBody.EVENT_TYPE_DELETED);
publisher.publish(attEvent);

UserTaskInstanceCommentDataEvent commentEvent;
Expand Down Expand Up @@ -193,7 +193,7 @@ public void testGetAllUserTaskInstanceAttachments() {
@Test
public void testGetAllUserTaskInstanceComment() {
String query =
"{ GetAllUserTaskInstanceComment (userTaskInstanceId : \\\"1\\\") { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, commentId, commentContent, eventType } }";
"{ GetAllUserTaskInstanceComments (userTaskInstanceId : \\\"1\\\") { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, commentId, commentContent, eventType } }";
query = wrapQuery(query);
List<Map<String, Object>> data = given()
.contentType(ContentType.JSON)
Expand All @@ -204,7 +204,7 @@ public void testGetAllUserTaskInstanceComment() {
.assertThat()
.statusCode(200)
.and()
.extract().path("data.GetAllUserTaskInstanceComment");
.extract().path("data.GetAllUserTaskInstanceComments");

assertThat(data).hasSize(1);

Expand All @@ -213,7 +213,7 @@ public void testGetAllUserTaskInstanceComment() {
@Test
public void testGetAllUserTaskInstanceDeadline() {
String query =
"{ GetAllUserTaskInstanceDeadline (userTaskInstanceId : \\\"1\\\") { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, eventType, notification } }";
"{ GetAllUserTaskInstanceDeadlines (userTaskInstanceId : \\\"1\\\") { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, eventType, notification } }";
query = wrapQuery(query);
List<Map<String, Object>> data = given()
.contentType(ContentType.JSON)
Expand All @@ -224,7 +224,7 @@ public void testGetAllUserTaskInstanceDeadline() {
.assertThat()
.statusCode(200)
.and()
.extract().path("data.GetAllUserTaskInstanceDeadline");
.extract().path("data.GetAllUserTaskInstanceDeadlines");

assertThat(data).hasSize(1);

Expand All @@ -233,7 +233,7 @@ public void testGetAllUserTaskInstanceDeadline() {
@Test
public void testGetAllUserTaskInstanceVariable() {
String query =
"{ GetAllUserTaskInstanceVariable (userTaskInstanceId : \\\"1\\\") { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, variableId, variableName, variableValue, variableType } }";
"{ GetAllUserTaskInstanceVariables (userTaskInstanceId : \\\"1\\\") { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, variableId, variableName, variableValue, variableType } }";
query = wrapQuery(query);
List<Map<String, Object>> data = given()
.contentType(ContentType.JSON)
Expand All @@ -244,7 +244,7 @@ public void testGetAllUserTaskInstanceVariable() {
.assertThat()
.statusCode(200)
.and()
.extract().path("data.GetAllUserTaskInstanceVariable");
.extract().path("data.GetAllUserTaskInstanceVariables");

assertThat(data).hasSize(3);

Expand Down

0 comments on commit 29440e6

Please sign in to comment.