Skip to content

Commit

Permalink
GMS-85 Fix of integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-szrnka committed Dec 19, 2023
1 parent 9a54ae1 commit c9195a7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.github.gms.controller.security;

import io.github.gms.abstraction.AbstractAdminRoleSecurityTest;
import io.github.gms.secure.dto.GetSecureValueDto;
import io.github.gms.secure.dto.IdNamePairListDto;
import io.github.gms.secure.dto.KeystoreDto;
import io.github.gms.secure.dto.KeystoreListDto;
Expand Down Expand Up @@ -49,11 +50,13 @@ void testListFailWithHttp403() {

@Test
void testGetValueFailWithHttp403() {
HttpEntity<Void> requestEntity = new HttpEntity<>(TestUtils.getHttpHeaders(jwt));
GetSecureValueDto dto = new GetSecureValueDto();
dto.setEntityId(DemoData.KEYSTORE_ID);
HttpEntity<GetSecureValueDto> requestEntity = new HttpEntity<>(dto, TestUtils.getHttpHeaders(jwt));

// assert
HttpClientErrorException.Forbidden exception = assertThrows(HttpClientErrorException.Forbidden.class, () ->
executeHttpGet("/secure/keystore/value/" + DemoData.KEYSTORE_ID, requestEntity, String.class));
executeHttpPost("/secure/keystore/value", requestEntity, String.class));

assertTrue(exception.getMessage().startsWith("403"));
}
Expand Down

0 comments on commit c9195a7

Please sign in to comment.