Skip to content

Commit

Permalink
feat: move towards java 17 partial commit (part 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuzynow committed Apr 22, 2024
1 parent 8854780 commit 346d4a9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 29 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import de.caritas.cob.liveservice.api.config.SpringFoxConfig;
import org.keycloak.adapters.KeycloakConfigResolver;
import org.keycloak.adapters.springboot.KeycloakSpringBootConfigResolver;
import org.keycloak.adapters.springboot.KeycloakSpringBootProperties;
import org.keycloak.adapters.springsecurity.KeycloakConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.http.SessionCreationPolicy;
Expand Down Expand Up @@ -42,7 +44,7 @@ public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Excepti
.requestMatchers(new NegatedRequestMatcher(new AntPathRequestMatcher("/live/**")))
.permitAll();

//httpSecurity.oauth2ResourceServer().jwt().jwtAuthenticationConverter(jwtAuthConverter());
httpSecurity.oauth2ResourceServer().jwt().jwtAuthenticationConverter(jwtAuthConverter());
return httpSecurity.build();
}

Expand All @@ -66,4 +68,10 @@ public KeycloakConfigResolver keycloakConfigResolver() {
return new KeycloakSpringBootConfigResolver();
}

@Bean
@ConfigurationProperties(prefix = "keycloak", ignoreUnknownFields = false)
public KeycloakSpringBootProperties keycloakSpringBootProperties() {
return new KeycloakSpringBootProperties();
}

}
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
spring.main.allow-bean-definition-overriding=true
keycloak.auth-server-url=
keycloak.realm=
keycloak.resource=
keycloak.resource=resource1221
keycloak.disable-trust-manager=true

app.base.url=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import com.fasterxml.jackson.databind.ObjectMapper;
import de.caritas.cob.liveservice.api.controller.CustomSwaggerApiResourceController;
import de.caritas.cob.liveservice.api.model.LiveEventMessage;
import de.caritas.cob.liveservice.api.model.VideoCallRequestDTO;
import de.caritas.cob.liveservice.websocket.model.WebSocketUserSession;
Expand All @@ -43,9 +42,6 @@
@TestPropertySource(properties = "spring.profiles.active=testing")
class LiveServiceApplicationIT extends StompClientIntegrationTest {

@MockBean
private CustomSwaggerApiResourceController customSwaggerApiResourceController;

@Autowired
private SocketUserRegistry socketUserRegistry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import lombok.SneakyThrows;
import org.junit.runner.RunWith;
import org.keycloak.common.VerificationException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
Expand Down Expand Up @@ -57,8 +57,8 @@ public abstract class StompClientIntegrationTest extends AbstractJUnit4SpringCon
private final StompSessionHandlerAdapter sessionHandler = new StompSessionHandlerAdapter() {
};

@Value("${server.port}")
private Integer port;
@LocalServerPort
private int port;

private final WebSocketStompClient socketStompClient = new WebSocketStompClient(
new SockJsClient(singletonList(new WebSocketTransport(new StandardWebSocketClient()))));
Expand Down

0 comments on commit 346d4a9

Please sign in to comment.