Update Spring Boot to 2.3.2
-Update Spring Cloud to Hoxton.SR7 -Replace ResourceSupport by RepresentationModel (Spring Hateoas 1.0) -Replace ControllerLinkBuilder by WebMvcLinkBuilder (Spring Hateoas 1.0) -Move getId() from Identifiable to BaseEntity (Spring Hateoas 1.0) -Remove hamcrest.Factory -Use static Sort.by reference -Place http security anyRequest().authenticated() -Replace MockMvcRequestBuilders.fileUpload by MockMvcRequestBuilders.multipart -Deprecate MEDIA_TYPE_CBOR_UTF8 -Replace MEDIA_TYPE_CBOR_UTF8 by MEDIA_TYPE_CBOR in tests -Replace HAL_JSON_UTF8 by HAL_JSON in tests -Replace APPLICATION_JSON_UTF8 by APPLICATION_JSON in tests -Use org.mockito.junit.MockitoJUnitRunner -Remove overridden dependency versions -Removing not needed comments in pom.xml -Downgrade flyway-core to be MySQL 5.6 compatible -Add maven-site-plugin since it was removed with spring-boot 2.3 -Set servlet encoding properties -Introducing Test that verifies the charset inside the content-type of a response -Add @DirtiesContext to CorsTest and ContentTypeTest -Add content-type mockmvc test with adapted mockmvc config -Move encoding.force property to test class -Switch expected and actual parameter values in content-type test -Delete deprecated content-type test with TestRestTemplate -Exclude JUnit5 from spring-boot-starter-test -Upgrade allure-junit4 to 2.13.5 -Add aspectjweaver 1.9.6 to surefire test execution -Add flyway-core version to property -Use getRequiredLink() within MgmtBaseEntity.getId() Signed-off-by: Ammar Bikic <ammar.bikic@bosch.io>
This commit is contained in:
@@ -12,6 +12,11 @@ spring.security.user.name=admin
|
||||
spring.security.user.password={noop}admin
|
||||
spring.main.allow-bean-definition-overriding=true
|
||||
|
||||
# Http Encoding
|
||||
server.servlet.encoding.charset=UTF-8
|
||||
server.servlet.encoding.enabled=true
|
||||
server.servlet.encoding.force=true
|
||||
|
||||
# DDI authentication configuration
|
||||
hawkbit.server.ddi.security.authentication.anonymous.enabled=false
|
||||
hawkbit.server.ddi.security.authentication.targettoken.enabled=true
|
||||
|
||||
@@ -22,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.security.test.context.support.WithUserDetails;
|
||||
import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers;
|
||||
import org.springframework.test.annotation.DirtiesContext;
|
||||
import org.springframework.test.context.TestExecutionListeners;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.web.servlet.MockMvc;
|
||||
@@ -38,8 +39,9 @@ import io.qameta.allure.Story;
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(properties = {"hawkbit.dmf.rabbitmq.enabled=false", "hawkbit.server.security.cors.enabled=true",
|
||||
"hawkbit.server.security.cors.allowedOrigins=" + CorsTest.ALLOWED_ORIGIN_FIRST + "," + CorsTest.ALLOWED_ORIGIN_SECOND})
|
||||
@TestExecutionListeners(listeners = { MySqlTestDatabase.class, MsSqlTestDatabase.class },
|
||||
@TestExecutionListeners(listeners = { MySqlTestDatabase.class, MsSqlTestDatabase.class },
|
||||
mergeMode = MergeMode.MERGE_WITH_DEFAULTS)
|
||||
@DirtiesContext
|
||||
@Feature("Integration Test - Security")
|
||||
@Story("CORS")
|
||||
public class CorsTest {
|
||||
|
||||
Reference in New Issue
Block a user