Skip to content

Commit

Permalink
LIBS-1228 - updated dependencies/image (compatibility to apple-chips) (
Browse files Browse the repository at this point in the history
…#20)

* LIBS-1228 - updated dependencies/image (compatibility to apple-chips)

* LIBS-1228 - fixed a test

* LIBS-1228 - fixed default in additional-spring-configuration-metadata

* LIBS-1228 - fixed a dependency
  • Loading branch information
Schubi1981 authored Mar 30, 2023
1 parent 4e0c350 commit 75aa4e0
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 36 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dependency>
<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-mysql</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>
<scope>test</scope>
</dependency>
```
Expand All @@ -25,7 +25,7 @@ Properties consumed (in `bootstrap.properties`):

- `embedded.container.mysql.enabled` (default is `true`)
- `embedded.container.mysql.startup-timeout` (default is `30`)
- `embedded.container.mysql.docker-image` (default is `mysql:8.0.28`)
- `embedded.container.mysql.docker-image` (default is `mysql:8.0.32`)
- `embedded.container.mysql.port` (default is `3306`)
- `embedded.container.mysql.root-password` (default is `root`)
- `embedded.container.mysql.database-name` (default is `embeddedMySqlDb`)
Expand Down
64 changes: 37 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.avides.springboot.springtainer</groupId>
<artifactId>springtainer-mysql</artifactId>
<version>1.3.0</version>
<version>1.4.0</version>

<name>springtainer-mysql</name>
<description>MySQL test-container</description>
Expand All @@ -24,6 +24,10 @@
<name>Julian Eggers</name>
<email>[email protected]</email>
</developer>
<developer>
<name>Martin Schumacher</name>
<email>[email protected]</email>
</developer>
</developers>

<scm>
Expand All @@ -47,23 +51,23 @@
<maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
<maven-release-plugin.version>3.0.0-M5</maven-release-plugin.version>
<maven-scm-provider-gitexe.version>1.11.2</maven-scm-provider-gitexe.version>
<maven-scm-provider-gitexe.version>1.11.3</maven-scm-provider-gitexe.version>
<exists-maven-plugin.version>0.6.0</exists-maven-plugin.version>
<github-release-plugin.version>1.4.0</github-release-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<!-- Spring -->
<spring.version>5.3.15</spring.version>
<spring-boot.version>2.6.3</spring-boot.version>
<mysql-connector-java.version>8.0.28</mysql-connector-java.version>
<spring.version>5.3.24</spring.version>
<spring-boot.version>2.6.14</spring-boot.version>
<mysql-connector-java.version>8.0.32</mysql-connector-java.version>
<!-- Other -->
<springtainer-common.version>1.3.1</springtainer-common.version>
<lombok.version>1.18.22</lombok.version>
<springtainer-common.version>1.4.0</springtainer-common.version>
<lombok.version>1.18.26</lombok.version>
<slf4j-api.version>1.7.36</slf4j-api.version>
<!-- Testing -->
<jacoco.version>0.8.7</jacoco.version>
<powermock.version>2.0.9</powermock.version>
<easymock.version>4.3</easymock.version>
<assertj-core.version>3.22.0</assertj-core.version>
<logback-classic.version>1.2.10</logback-classic.version>
<jacoco.version>0.8.8</jacoco.version>
<junit.version>4.13.2</junit.version>
<assertj-core.version>3.24.2</assertj-core.version>
<logback-classic.version>1.2.11</logback-classic.version>
</properties>

<dependencies>
Expand All @@ -90,13 +94,25 @@
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>${spring-boot.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql-connector-java.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j-api.version}</version>
<scope>provided</scope>
</dependency>

<!-- Testing -->
<dependency>
Expand All @@ -106,21 +122,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>${easymock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-easymock</artifactId>
<version>${powermock.version}</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -147,6 +151,12 @@
<artifactId>logback-classic</artifactId>
<version>${logback-classic.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public class MysqlProperties extends AbstractEmbeddedContainerProperties

public MysqlProperties()
{
setDockerImage("mysql:8.0.28");
setDockerImage("mysql:8.0.32");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"name": "embedded.container.mysql.docker-image",
"type": "java.lang.String",
"description": "Docker-image",
"defaultValue": "mysql:8.0.28"
"defaultValue": "mysql:8.0.32"
},
{
"name": "embedded.container.mysql.port",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
package com.avides.springboot.springtainer.mysql;

import static com.avides.springboot.springtainer.common.util.OSUtils.isMac;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeFalse;

import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;

@TestPropertySource(properties = "embedded.container.mysql.docker-image=mysql:8.0.18")
@TestPropertySource(properties = "embedded.container.mysql.docker-image=mysql:5.7.41")
public class EmbeddedMysqlContainerAutoConfigurationWith57IT extends AbstractIT
{
@BeforeClass
public static void setUp()
{
// these tests won't run on Macs with Apple-Chips due to the docker-image, which does not support them
assumeFalse(isMac());
}

@Test
public void testGeneratedProperties()
{
Expand Down Expand Up @@ -51,7 +61,7 @@ public void testCreatedDatabase()
@Test
public void testCheckVersion()
{
assertThat(jdbcTemplate.queryForObject("SELECT @@version", String.class)).startsWith("8.");
assertThat(jdbcTemplate.queryForObject("SELECT @@version", String.class)).isEqualTo("5.7.41");
}

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.TestPropertySource;

@TestPropertySource(properties = "embedded.container.mysql.docker-image=mysql:8.0.28")
@TestPropertySource(properties = "embedded.container.mysql.docker-image=mysql:8.0.32")
public class EmbeddedMysqlContainerAutoConfigurationWith80IT extends AbstractIT
{
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ public class MysqlPropertiesTest
@Test
public void testDefaults()
{
MysqlProperties properties = new MysqlProperties();
var properties = new MysqlProperties();
assertTrue(properties.isEnabled());
assertEquals(30, properties.getStartupTimeout());
assertEquals("mysql:8.0.28", properties.getDockerImage());
assertEquals("mysql:8.0.32", properties.getDockerImage());

assertEquals(3306, properties.getPort());
assertEquals("root", properties.getRootPassword());
Expand Down

0 comments on commit 75aa4e0

Please sign in to comment.