TSK-1801: rename rest-parameter by replacing '.' by '-'

This commit is contained in:
ryzheboka 2022-02-11 11:16:17 +01:00 committed by Elena Mokeeva
parent 0dbc690346
commit 7378223b4b
6 changed files with 28 additions and 28 deletions

View File

@ -525,7 +525,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
// endregion // endregion
// region classificationKey // region classificationKey
/** Filter by the classification key of the task. This is an exact match. */ /** Filter by the classification key of the task. This is an exact match. */
@JsonProperty("classification.key") @JsonProperty("classification-key")
private final String[] classificationKeyIn; private final String[] classificationKeyIn;
/** Filter by the classification key of the task. This is an exact match. */ /** Filter by the classification key of the task. This is an exact match. */
@ -719,7 +719,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
// endregion // endregion
// region primaryObjectReferenceCompany // region primaryObjectReferenceCompany
/** Filter by the company of the primary object reference of the task. This is an exact match. */ /** Filter by the company of the primary object reference of the task. This is an exact match. */
@JsonProperty("por.company") @JsonProperty("por-company")
private final String[] porCompanyIn; private final String[] porCompanyIn;
/** /**
@ -747,7 +747,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
// endregion // endregion
// region primaryObjectReferenceSystem // region primaryObjectReferenceSystem
/** Filter by the system of the primary object reference of the task. This is an exact match. */ /** Filter by the system of the primary object reference of the task. This is an exact match. */
@JsonProperty("por.system") @JsonProperty("por-system")
private final String[] porSystemIn; private final String[] porSystemIn;
/** /**
@ -778,7 +778,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
* Filter by the system instance of the primary object reference of the task. This is an exact * Filter by the system instance of the primary object reference of the task. This is an exact
* match. * match.
*/ */
@JsonProperty("por.instance") @JsonProperty("por-instance")
private final String[] porInstanceIn; private final String[] porInstanceIn;
/** /**
@ -806,7 +806,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
// endregion // endregion
// region primaryObjectReferenceSystemType // region primaryObjectReferenceSystemType
/** Filter by the type of the primary object reference of the task. This is an exact match. */ /** Filter by the type of the primary object reference of the task. This is an exact match. */
@JsonProperty("por.type") @JsonProperty("por-type")
private final String[] porTypeIn; private final String[] porTypeIn;
/** /**
@ -834,7 +834,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
// endregion // endregion
// region primaryObjectReferenceSystemValue // region primaryObjectReferenceSystemValue
/** Filter by the value of the primary object reference of the task. This is an exact match. */ /** Filter by the value of the primary object reference of the task. This is an exact match. */
@JsonProperty("por.value") @JsonProperty("por-value")
private final String[] porValueIn; private final String[] porValueIn;
/** /**
@ -1477,7 +1477,7 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
"state-not", "state-not",
"classification-id", "classification-id",
"classification-id-not", "classification-id-not",
"classification.key", "classification-key",
"classification-key-not", "classification-key-not",
"classification-key-like", "classification-key-like",
"classification-key-not-like", "classification-key-not-like",
@ -1507,23 +1507,23 @@ public class TaskQueryFilterParameter implements QueryParameter<TaskQuery, Void>
"owner-like", "owner-like",
"owner-not-like", "owner-not-like",
"por", "por",
"por.company", "por-company",
"por-company-not", "por-company-not",
"por-company-like", "por-company-like",
"por-company-not-like", "por-company-not-like",
"por.system", "por-system",
"por-system-not", "por-system-not",
"por-system-like", "por-system-like",
"por-system-not-like", "por-system-not-like",
"por.instance", "por-instance",
"por-instance-not", "por-instance-not",
"por-instance-like", "por-instance-like",
"por-instance-not-like", "por-instance-not-like",
"por.type", "por-type",
"por-type-not", "por-type-not",
"por-type-like", "por-type-like",
"por-type-not-like", "por-type-not-like",
"por.value", "por-value",
"por-value-not", "por-value-not",
"por-value-like", "por-value-like",
"por-value-not-like", "por-value-not-like",

View File

@ -460,7 +460,7 @@ class TaskControllerIntTest {
void testGetAllTasksKeepingFilters() { void testGetAllTasksKeepingFilters() {
String url = String url =
restHelper.toUrl(RestEndpoints.URL_TASKS) restHelper.toUrl(RestEndpoints.URL_TASKS)
+ "?por.type=VNR&por.value=22334455&sort-by=POR_VALUE&order=DESCENDING"; + "?por-type=VNR&por-value=22334455&sort-by=POR_VALUE&order=DESCENDING";
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1")); HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
ResponseEntity<TaskSummaryPagedRepresentationModel> response = ResponseEntity<TaskSummaryPagedRepresentationModel> response =
@ -470,7 +470,7 @@ class TaskControllerIntTest {
assertThat((response.getBody()).getLink(IanaLinkRelations.SELF)).isNotNull(); assertThat((response.getBody()).getLink(IanaLinkRelations.SELF)).isNotNull();
assertThat(response.getBody().getRequiredLink(IanaLinkRelations.SELF).getHref()) assertThat(response.getBody().getRequiredLink(IanaLinkRelations.SELF).getHref())
.endsWith( .endsWith(
"/api/v1/tasks?por.type=VNR&por.value=22334455" "/api/v1/tasks?por-type=VNR&por-value=22334455"
+ "&sort-by=POR_VALUE&order=DESCENDING"); + "&sort-by=POR_VALUE&order=DESCENDING");
} }
@ -542,8 +542,8 @@ class TaskControllerIntTest {
// tasks and this test depends on the tasks as they are in sampledata // tasks and this test depends on the tasks as they are in sampledata
String url = String url =
restHelper.toUrl(RestEndpoints.URL_TASKS) restHelper.toUrl(RestEndpoints.URL_TASKS)
+ "?por.company=00&por.system=PASystem&por.instance=00&" + "?por-company=00&por-system=PASystem&por-instance=00&"
+ "por.type=VNR&por.value=22334455&sort-by=POR_TYPE&" + "por-type=VNR&por-value=22334455&sort-by=POR_TYPE&"
+ "order=ASCENDING&page-size=5&page=2"; + "order=ASCENDING&page-size=5&page=2";
HttpEntity<String> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1")); HttpEntity<String> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
@ -557,8 +557,8 @@ class TaskControllerIntTest {
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull(); assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
assertThat(response.getBody().getRequiredLink(IanaLinkRelations.SELF).getHref()) assertThat(response.getBody().getRequiredLink(IanaLinkRelations.SELF).getHref())
.endsWith( .endsWith(
"/api/v1/tasks?por.company=00&por.system=PASystem&por.instance=00&" "/api/v1/tasks?por-company=00&por-system=PASystem&por-instance=00&"
+ "por.type=VNR&por.value=22334455&sort-by=POR_TYPE&order=ASCENDING&" + "por-type=VNR&por-value=22334455&sort-by=POR_TYPE&order=ASCENDING&"
+ "page-size=5&page=2"); + "page-size=5&page=2");
assertThat(response.getBody().getLink(IanaLinkRelations.FIRST)).isNotNull(); assertThat(response.getBody().getLink(IanaLinkRelations.FIRST)).isNotNull();
assertThat(response.getBody().getLink(IanaLinkRelations.LAST)).isNotNull(); assertThat(response.getBody().getLink(IanaLinkRelations.LAST)).isNotNull();

View File

@ -30,7 +30,7 @@ class TaskControllerRestDocTest extends BaseRestDocTest {
@Test @Test
void getAllTasksDocTest() throws Exception { void getAllTasksDocTest() throws Exception {
mockMvc mockMvc
.perform(get(RestEndpoints.URL_TASKS + "?por.type=VNR&por.value=22334455&sort-by=NAME")) .perform(get(RestEndpoints.URL_TASKS + "?por-type=VNR&por-value=22334455&sort-by=NAME"))
.andExpect(MockMvcResultMatchers.status().isOk()); .andExpect(MockMvcResultMatchers.status().isOk());
} }

View File

@ -5,18 +5,18 @@ export interface TaskQueryFilterParameter {
'name-like'?: string[]; 'name-like'?: string[];
priority?: number[]; priority?: number[];
state?: TaskState[]; state?: TaskState[];
'classification.key'?: string[]; 'classification-key'?: string[];
'task-id'?: string[]; 'task-id'?: string[];
'workbasket-id'?: string[]; 'workbasket-id'?: string[];
'workbasket-key'?: string[]; 'workbasket-key'?: string[];
domain?: string[]; domain?: string[];
owner?: string[]; owner?: string[];
'owner-like'?: string[]; 'owner-like'?: string[];
'por.company'?: string[]; 'por-company'?: string[];
'por.system'?: string[]; 'por-system'?: string[];
'por.instance'?: string[]; 'por-instance'?: string[];
'por.type'?: string[]; 'por-type'?: string[];
'por.value'?: string[]; 'por-value'?: string[];
planned?: string[]; planned?: string[];
'planned-from'?: string[]; 'planned-from'?: string[];
'planned-until'?: string[]; 'planned-until'?: string[];

View File

@ -17,7 +17,7 @@ const emptyTaskFilter: TaskQueryFilterParameter = {
'owner-like': [], 'owner-like': [],
state: [], state: [],
priority: [], priority: [],
'por.value': [], 'por-value': [],
'wildcard-search-fields': [], 'wildcard-search-fields': [],
'wildcard-search-value': [] 'wildcard-search-value': []
}; };

View File

@ -17,8 +17,8 @@ export class TaskanaQueryParameters {
PRIORITY: 'priority', PRIORITY: 'priority',
STATE: 'state', STATE: 'state',
WORKBASKET_ID: 'workbasket-id', WORKBASKET_ID: 'workbasket-id',
TASK_PRIMARY_OBJ_REF_TYPE_LIKE: 'por.type', TASK_PRIMARY_OBJ_REF_TYPE_LIKE: 'por-type',
TASK_PRIMARY_OBJ_REF_VALUE_LIKE: 'por.value', TASK_PRIMARY_OBJ_REF_VALUE_LIKE: 'por-value',
// Access // Access
REQUIREDPERMISSION: 'required-permission', REQUIREDPERMISSION: 'required-permission',
ACCESSIDS: 'access-ids', ACCESSIDS: 'access-ids',