TSK-1677: fixed retrieval of all master classifications
Co-authored-by: Sofie Hofmann<29145005+sofie29@users.noreply.github.com>
This commit is contained in:
parent
89c541716d
commit
98f2a2f024
|
@ -1,5 +1,5 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Start DevMode ExampleRestApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
<configuration default="false" name="Start Demo App DevMode" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||||
<module name="taskana-rest-spring-example-boot" />
|
<module name="taskana-rest-spring-example-boot" />
|
||||||
<option name="SPRING_BOOT_MAIN_CLASS" value="pro.taskana.example.boot.ExampleRestApplication" />
|
<option name="SPRING_BOOT_MAIN_CLASS" value="pro.taskana.example.boot.ExampleRestApplication" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
<option name="ALTERNATIVE_JRE_PATH" />
|
|
@ -0,0 +1,18 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="Start Demo App No CSRF" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||||
|
<module name="taskana-rest-spring-example-boot" />
|
||||||
|
<option name="SPRING_BOOT_MAIN_CLASS" value="pro.taskana.example.boot.ExampleRestApplication" />
|
||||||
|
<option name="ALTERNATIVE_JRE_PATH" />
|
||||||
|
<option name="SHORTEN_COMMAND_LINE" value="NONE" />
|
||||||
|
<additionalParameters>
|
||||||
|
<param>
|
||||||
|
<option name="enabled" value="true" />
|
||||||
|
<option name="name" value="enableCsrf" />
|
||||||
|
<option name="value" value="false" />
|
||||||
|
</param>
|
||||||
|
</additionalParameters>
|
||||||
|
<method v="2">
|
||||||
|
<option name="Make" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -1,5 +1,5 @@
|
||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Start ExampleRestApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
<configuration default="false" name="Start Demo App" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
|
||||||
<module name="taskana-rest-spring-example-boot" />
|
<module name="taskana-rest-spring-example-boot" />
|
||||||
<option name="SPRING_BOOT_MAIN_CLASS" value="pro.taskana.example.boot.ExampleRestApplication" />
|
<option name="SPRING_BOOT_MAIN_CLASS" value="pro.taskana.example.boot.ExampleRestApplication" />
|
||||||
<option name="ALTERNATIVE_JRE_PATH" />
|
<option name="ALTERNATIVE_JRE_PATH" />
|
|
@ -137,7 +137,11 @@ public class ClassificationQueryFilterParameter
|
||||||
this.nameLike = nameLike;
|
this.nameLike = nameLike;
|
||||||
this.key = key;
|
this.key = key;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
this.domain = domain;
|
if (domain != null && domain.length == 0) {
|
||||||
|
this.domain = new String[] {""};
|
||||||
|
} else {
|
||||||
|
this.domain = domain;
|
||||||
|
}
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.custom1Like = custom1Like;
|
this.custom1Like = custom1Like;
|
||||||
this.custom2Like = custom2Like;
|
this.custom2Like = custom2Like;
|
||||||
|
|
|
@ -30,29 +30,45 @@ import pro.taskana.common.test.rest.TaskanaSpringBootTest;
|
||||||
@TaskanaSpringBootTest
|
@TaskanaSpringBootTest
|
||||||
class ClassificationControllerIntTest {
|
class ClassificationControllerIntTest {
|
||||||
|
|
||||||
private static final ParameterizedTypeReference<ClassificationSummaryPagedRepresentationModel>
|
private final RestHelper restHelper;
|
||||||
CLASSIFICATION_SUMMARY_PAGE_MODEL_TYPE =
|
|
||||||
new ParameterizedTypeReference<ClassificationSummaryPagedRepresentationModel>() {};
|
|
||||||
|
|
||||||
private static final ParameterizedTypeReference<ClassificationRepresentationModel>
|
@Autowired
|
||||||
CLASSIFICATION_REPRESENTATION_MODEL_TYPE =
|
ClassificationControllerIntTest(RestHelper restHelper) {
|
||||||
new ParameterizedTypeReference<ClassificationRepresentationModel>() {};
|
this.restHelper = restHelper;
|
||||||
|
}
|
||||||
|
|
||||||
private static final ParameterizedTypeReference<ClassificationSummaryRepresentationModel>
|
@Test
|
||||||
CLASSIFICATION_SUMMARY_REPRESENTATION_MODEL_TYPE =
|
void should_ReturnAllMasterClassifications_When_DomainIsSetWithEmptyString() {
|
||||||
new ParameterizedTypeReference<ClassificationSummaryRepresentationModel>() {};
|
String url = restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS) + "?domain=";
|
||||||
|
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
@Autowired RestHelper restHelper;
|
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
||||||
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(
|
||||||
|
ClassificationSummaryPagedRepresentationModel.class));
|
||||||
|
|
||||||
|
assertThat(response.getBody()).isNotNull();
|
||||||
|
assertThat(response.getBody().getContent())
|
||||||
|
.extracting(ClassificationSummaryRepresentationModel::getDomain)
|
||||||
|
.containsOnly("");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testGetClassification() {
|
void testGetClassification() {
|
||||||
String url =
|
String url =
|
||||||
restHelper.toUrl(
|
restHelper.toUrl(
|
||||||
RestEndpoints.URL_CLASSIFICATIONS_ID, "CLI:100000000000000000000000000000000002");
|
RestEndpoints.URL_CLASSIFICATIONS_ID, "CLI:100000000000000000000000000000000002");
|
||||||
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationRepresentationModel> response =
|
ResponseEntity<ClassificationRepresentationModel> response =
|
||||||
TEMPLATE.exchange(url, HttpMethod.GET, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(response.getBody()).isNotNull();
|
assertThat(response.getBody()).isNotNull();
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
||||||
|
@ -62,10 +78,15 @@ class ClassificationControllerIntTest {
|
||||||
@Test
|
@Test
|
||||||
void testGetAllClassifications() {
|
void testGetAllClassifications() {
|
||||||
String url = restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS);
|
String url = restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS);
|
||||||
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
||||||
TEMPLATE.exchange(url, HttpMethod.GET, auth, CLASSIFICATION_SUMMARY_PAGE_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(
|
||||||
|
ClassificationSummaryPagedRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(response.getBody()).isNotNull();
|
assertThat(response.getBody()).isNotNull();
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
||||||
|
@ -75,10 +96,15 @@ class ClassificationControllerIntTest {
|
||||||
void testGetAllClassificationsFilterByCustomAttribute() {
|
void testGetAllClassificationsFilterByCustomAttribute() {
|
||||||
String url =
|
String url =
|
||||||
restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS) + "?domain=DOMAIN_A&custom-1-like=RVNR";
|
restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS) + "?domain=DOMAIN_A&custom-1-like=RVNR";
|
||||||
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
||||||
TEMPLATE.exchange(url, HttpMethod.GET, auth, CLASSIFICATION_SUMMARY_PAGE_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(
|
||||||
|
ClassificationSummaryPagedRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(response.getBody()).isNotNull();
|
assertThat(response.getBody()).isNotNull();
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
||||||
|
@ -90,10 +116,15 @@ class ClassificationControllerIntTest {
|
||||||
String url =
|
String url =
|
||||||
restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS)
|
restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS)
|
||||||
+ "?domain=DOMAIN_A&sort-by=KEY&order=ASCENDING";
|
+ "?domain=DOMAIN_A&sort-by=KEY&order=ASCENDING";
|
||||||
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
||||||
TEMPLATE.exchange(url, HttpMethod.GET, auth, CLASSIFICATION_SUMMARY_PAGE_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(
|
||||||
|
ClassificationSummaryPagedRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(response.getBody()).isNotNull();
|
assertThat(response.getBody()).isNotNull();
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
||||||
|
@ -108,10 +139,15 @@ class ClassificationControllerIntTest {
|
||||||
String url =
|
String url =
|
||||||
restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS)
|
restHelper.toUrl(RestEndpoints.URL_CLASSIFICATIONS)
|
||||||
+ "?domain=DOMAIN_A&sort-by=KEY&order=ASCENDING&page-size=5&page=2";
|
+ "?domain=DOMAIN_A&sort-by=KEY&order=ASCENDING&page-size=5&page=2";
|
||||||
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
||||||
TEMPLATE.exchange(url, HttpMethod.GET, auth, CLASSIFICATION_SUMMARY_PAGE_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(
|
||||||
|
ClassificationSummaryPagedRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(response.getBody()).isNotNull();
|
assertThat(response.getBody()).isNotNull();
|
||||||
assertThat(response.getBody().getContent()).hasSize(5);
|
assertThat(response.getBody().getContent()).hasSize(5);
|
||||||
|
@ -142,7 +178,11 @@ class ClassificationControllerIntTest {
|
||||||
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationRepresentationModel.class));
|
||||||
assertThat(responseEntity).isNotNull();
|
assertThat(responseEntity).isNotNull();
|
||||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
||||||
|
|
||||||
|
@ -151,7 +191,11 @@ class ClassificationControllerIntTest {
|
||||||
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
responseEntity =
|
responseEntity =
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth2, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth2,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationRepresentationModel.class));
|
||||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +215,12 @@ class ClassificationControllerIntTest {
|
||||||
|
|
||||||
ThrowingCallable httpCall =
|
ThrowingCallable httpCall =
|
||||||
() ->
|
() ->
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.<ClassificationRepresentationModel>forType(
|
||||||
|
ClassificationRepresentationModel.class));
|
||||||
|
|
||||||
assertThatThrownBy(httpCall)
|
assertThatThrownBy(httpCall)
|
||||||
.isInstanceOf(HttpClientErrorException.class)
|
.isInstanceOf(HttpClientErrorException.class)
|
||||||
|
@ -196,7 +245,11 @@ class ClassificationControllerIntTest {
|
||||||
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(responseEntity).isNotNull();
|
assertThat(responseEntity).isNotNull();
|
||||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
||||||
|
@ -218,7 +271,11 @@ class ClassificationControllerIntTest {
|
||||||
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(responseEntity).isNotNull();
|
assertThat(responseEntity).isNotNull();
|
||||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
||||||
|
@ -240,13 +297,22 @@ class ClassificationControllerIntTest {
|
||||||
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
ResponseEntity<ClassificationRepresentationModel> responseEntity =
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationRepresentationModel.class));
|
||||||
assertThat(responseEntity).isNotNull();
|
assertThat(responseEntity).isNotNull();
|
||||||
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
assertThat(responseEntity.getStatusCode()).isEqualTo(HttpStatus.CREATED);
|
||||||
|
|
||||||
HttpEntity<?> auth2 = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
HttpEntity<?> auth2 = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
ResponseEntity<ClassificationSummaryPagedRepresentationModel> response =
|
||||||
TEMPLATE.exchange(url, HttpMethod.GET, auth2, CLASSIFICATION_SUMMARY_PAGE_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth2,
|
||||||
|
ParameterizedTypeReference.forType(
|
||||||
|
ClassificationSummaryPagedRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(response.getBody()).isNotNull();
|
assertThat(response.getBody()).isNotNull();
|
||||||
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
assertThat(response.getBody().getLink(IanaLinkRelations.SELF)).isNotNull();
|
||||||
|
@ -277,9 +343,13 @@ class ClassificationControllerIntTest {
|
||||||
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("businessadmin"));
|
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("businessadmin"));
|
||||||
|
|
||||||
ThrowingCallable httpCall =
|
ThrowingCallable httpCall =
|
||||||
() -> {
|
() ->
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
};
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.<ClassificationRepresentationModel>forType(
|
||||||
|
ClassificationRepresentationModel.class));
|
||||||
|
|
||||||
assertThatThrownBy(httpCall)
|
assertThatThrownBy(httpCall)
|
||||||
.isInstanceOf(HttpClientErrorException.class)
|
.isInstanceOf(HttpClientErrorException.class)
|
||||||
|
@ -299,9 +369,13 @@ class ClassificationControllerIntTest {
|
||||||
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("businessadmin"));
|
new HttpEntity<>(newClassification, RestHelper.generateHeadersForUser("businessadmin"));
|
||||||
|
|
||||||
ThrowingCallable httpCall =
|
ThrowingCallable httpCall =
|
||||||
() -> {
|
() ->
|
||||||
TEMPLATE.exchange(url, HttpMethod.POST, auth, CLASSIFICATION_REPRESENTATION_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
};
|
url,
|
||||||
|
HttpMethod.POST,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.<ClassificationRepresentationModel>forType(
|
||||||
|
ClassificationRepresentationModel.class));
|
||||||
|
|
||||||
assertThatThrownBy(httpCall)
|
assertThatThrownBy(httpCall)
|
||||||
.isInstanceOf(HttpClientErrorException.class)
|
.isInstanceOf(HttpClientErrorException.class)
|
||||||
|
@ -318,7 +392,10 @@ class ClassificationControllerIntTest {
|
||||||
|
|
||||||
ResponseEntity<ClassificationSummaryRepresentationModel> response =
|
ResponseEntity<ClassificationSummaryRepresentationModel> response =
|
||||||
TEMPLATE.exchange(
|
TEMPLATE.exchange(
|
||||||
url, HttpMethod.GET, auth, CLASSIFICATION_SUMMARY_REPRESENTATION_MODEL_TYPE);
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationSummaryRepresentationModel.class));
|
||||||
|
|
||||||
assertThat(response.getBody()).isNotNull();
|
assertThat(response.getBody()).isNotNull();
|
||||||
assertThat(response.getBody().getName()).isEqualTo("Zustimmungserklärung");
|
assertThat(response.getBody().getName()).isEqualTo("Zustimmungserklärung");
|
||||||
|
@ -334,13 +411,20 @@ class ClassificationControllerIntTest {
|
||||||
|
|
||||||
ResponseEntity<ClassificationSummaryRepresentationModel> response =
|
ResponseEntity<ClassificationSummaryRepresentationModel> response =
|
||||||
TEMPLATE.exchange(
|
TEMPLATE.exchange(
|
||||||
url, HttpMethod.DELETE, auth, CLASSIFICATION_SUMMARY_REPRESENTATION_MODEL_TYPE);
|
url,
|
||||||
|
HttpMethod.DELETE,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.forType(ClassificationSummaryRepresentationModel.class));
|
||||||
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NO_CONTENT);
|
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NO_CONTENT);
|
||||||
|
|
||||||
ThrowingCallable httpCall =
|
ThrowingCallable httpCall =
|
||||||
() ->
|
() ->
|
||||||
TEMPLATE.exchange(
|
TEMPLATE.exchange(
|
||||||
url, HttpMethod.GET, auth, CLASSIFICATION_SUMMARY_REPRESENTATION_MODEL_TYPE);
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.<ClassificationSummaryRepresentationModel>forType(
|
||||||
|
ClassificationSummaryRepresentationModel.class));
|
||||||
assertThatThrownBy(httpCall).isInstanceOf(HttpClientErrorException.class);
|
assertThatThrownBy(httpCall).isInstanceOf(HttpClientErrorException.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -352,12 +436,16 @@ class ClassificationControllerIntTest {
|
||||||
+ "&illegalParam=illegal"
|
+ "&illegalParam=illegal"
|
||||||
+ "&anotherIllegalParam=stillIllegal"
|
+ "&anotherIllegalParam=stillIllegal"
|
||||||
+ "&sort-by=NAME&order=DESCENDING&page-size=5&page=2";
|
+ "&sort-by=NAME&order=DESCENDING&page-size=5&page=2";
|
||||||
HttpEntity<Object> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
HttpEntity<?> auth = new HttpEntity<>(RestHelper.generateHeadersForUser("teamlead-1"));
|
||||||
|
|
||||||
ThrowingCallable httpCall =
|
ThrowingCallable httpCall =
|
||||||
() -> {
|
() ->
|
||||||
TEMPLATE.exchange(url, HttpMethod.GET, auth, CLASSIFICATION_SUMMARY_PAGE_MODEL_TYPE);
|
TEMPLATE.exchange(
|
||||||
};
|
url,
|
||||||
|
HttpMethod.GET,
|
||||||
|
auth,
|
||||||
|
ParameterizedTypeReference.<ClassificationSummaryPagedRepresentationModel>forType(
|
||||||
|
ClassificationSummaryPagedRepresentationModel.class));
|
||||||
|
|
||||||
assertThatThrownBy(httpCall)
|
assertThatThrownBy(httpCall)
|
||||||
.isInstanceOf(HttpServerErrorException.class)
|
.isInstanceOf(HttpServerErrorException.class)
|
||||||
|
|
Loading…
Reference in New Issue