Skip to content

Commit

Permalink
feat: update spring boot and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mebo4b committed Nov 2, 2020
1 parent cba6b92 commit ea09118
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 46 deletions.
37 changes: 10 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.6.RELEASE</version>
<version>2.3.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

Expand All @@ -40,6 +40,11 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.1.6.Final</version>
</dependency>

<!-- OpenApi/Swagger dependencies -->
<dependency>
Expand Down Expand Up @@ -86,16 +91,6 @@
<artifactId>keycloak-admin-client</artifactId>
<version>4.4.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.1.4.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.1.4.Final</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
Expand All @@ -113,45 +108,33 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8</version>
<version>3.11</version>
</dependency>

<!-- Apache Commons Codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.13</version>
<version>1.15</version>
</dependency>

<!-- Jsoup -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.8.3</version>
<version>1.10.2</version>
</dependency>

<!-- Liquibase -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>3.6.3</version>
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.3</version>
<version>4.1.1</version>
</dependency>

<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.3.0</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ public class SecurityConfig extends KeycloakWebSecurityConfigurerAdapter {
@Value("${csrf.header.property}")
private String csrfHeaderProperty;

@Autowired
private Environment environment;

/**
* Processes HTTP requests and checks for a valid spring security authentication for the
* (Keycloak) principal (authorization header).
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application-testing.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Testing profile for unit tests
spring.main.allow-bean-definition-overriding=true

# Logging: SLF4J (via Lombok)
logging.level.root=INFO
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Currently active profile
spring.profiles.active=@activeSpringProfile@
spring.main.allow-bean-definition-overriding=true

# General app settings
server.port=8080
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import de.caritas.cob.messageservice.api.authorization.RoleAuthorizationAuthorityMapper;
import de.caritas.cob.messageservice.api.exception.InternalServerErrorException;
import de.caritas.cob.messageservice.api.facade.PostGroupMessageFacade;
import de.caritas.cob.messageservice.api.model.AttachmentDTO;
Expand Down Expand Up @@ -69,7 +70,7 @@

@RunWith(SpringRunner.class)
@WebMvcTest(MessageController.class)
@AutoConfigureMockMvc(secure = false)
@AutoConfigureMockMvc(addFilters = false)
public class MessageControllerTestIT {

private final String VALID_MESSAGE_REQUEST_BODY_WITHOUT_NOTIFICATION =
Expand Down Expand Up @@ -123,6 +124,9 @@ RC_TIMESTAMP, new UserDTO(RC_USER_ID, "test", "name"), false, new String[0], new
@MockBean
private DraftMessageService draftMessageService;

@MockBean
private RoleAuthorizationAuthorityMapper roleAuthorizationAuthorityMapper;

@Mock
private Logger logger;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

import static de.caritas.cob.messageservice.testhelper.TestConstants.USERNAME_DECODED;
import static de.caritas.cob.messageservice.testhelper.TestConstants.USERNAME_ENCODED;
import static de.caritas.cob.messageservice.testhelper.TestConstants.USERNAME_INVALID_ENCODED;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import de.caritas.cob.messageservice.api.exception.HelperException;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -43,14 +39,4 @@ public void decodeUsername_Should_ReturnDecodedUsername_WhenDecodedUsernameIsGiv
assertEquals(USERNAME_DECODED, userHelper.decodeUsername(USERNAME_DECODED));
}

@Test
public void decodeUsername_Should_ThrowHelperException_WhenDecodingFails() {
try {
userHelper.decodeUsername(USERNAME_INVALID_ENCODED);
fail("Expected exception: HelperException");
} catch (HelperException helperException) {
assertTrue("Excepted HelperException thrown", true);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class TestConstants {
public static final String ENCODING_PREFIX = "enc.";
public static final String USERNAME_ENCODED = ENCODING_PREFIX + "OVZWK4TOMFWWK...";
public static final String USERNAME_DECODED = "username";
public static final String USERNAME_INVALID_ENCODED = "enc.223======";

/*
* Messages
Expand Down

0 comments on commit ea09118

Please sign in to comment.