Skip to content
Snippets Groups Projects
Commit c0e347b1 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7014 do not transmit saml token

Sub task: OZG-7276
parent 8daba697
No related branches found
No related tags found
No related merge requests found
......@@ -38,12 +38,11 @@ import org.springframework.web.util.UriTemplate;
@Component
class VorgangRemoteService {
static final String FIND_VORGANG_URI = "/api/vorgang/{vorgangId}/{samlToken}";
static final String FIND_VORGANG_URI = "/api/vorgang/{vorgangId}";
private final RestClient fachstellenProxyClient;
private final FachstellenProxyProperties fachstellenProxyProperties;
private final VorgangMapper vorgangMapper;
private final CurrentUserService currentUserService;
Vorgang findVorgang(String id, String collaborationManagerAddress) {
var response = fachstellenProxyClient.get().uri(buildFindVorgangUri(id))
......@@ -61,7 +60,7 @@ class VorgangRemoteService {
}
String buildFindVorgangUri(String vorgangId) {
return new UriTemplate(FIND_VORGANG_URI).expand(vorgangId, currentUserService.getSamlToken()).toString();
return new UriTemplate(FIND_VORGANG_URI).expand(vorgangId).toString();
}
private Vorgang buildVorgangResponse(CollaborationGrpcFindVorgangResponse response) {
......
......@@ -63,9 +63,6 @@ class VorgangRemoteServiceTest {
@Mock
private VorgangMapper vorgangMapper;
@Mock
private CurrentUserService currentUserService;
@Nested
class TestFindVorgang {
......@@ -138,22 +135,11 @@ class VorgangRemoteServiceTest {
@Test
void shouldReturnVorgangUri() {
when(currentUserService.getSamlToken()).thenReturn(UserTestFactory.SAML_TOKEN);
final String expectedUri = new UriTemplate(FIND_VORGANG_URI).expand(VorgangTestFactory.ID, UserTestFactory.SAML_TOKEN).toString();
final String uri = vorgangRemoteService.buildFindVorgangUri(VorgangTestFactory.ID);
assertThat(uri).isEqualTo(expectedUri);
}
@Test
void shouldThrowException() {
when(currentUserService.getSamlToken()).thenThrow(new SamlTokenNotFoundException());
assertThatExceptionOfType(SamlTokenNotFoundException.class).isThrownBy(
() -> vorgangRemoteService.buildFindVorgangUri(VorgangTestFactory.ID));
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment