diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c46ecc4 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +name: Build and test + +on: [ pull_request, push ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8, 11, 17 ] + + name: Java ${{ matrix.java }} build + + steps: + + - name: Setup Maven Action + uses: s4u/setup-maven-action@v1.6.0 + with: + java-version: ${{ matrix.java }} + + - name: Run docker image for integration tests + run: docker run -d --name wp_build_test -p 80:80 afrozaar/wordpress:latest + + - name: Alter hosts file + run: | + HOSTN=`hostname` + FIL=/etc/hosts + + echo "hostname: '$HOSTN'" + + if grep -q "$HOSTN" $FIL; then + if grep -q 'docker.dev' $FIL; then + echo "SKIPPING. 'docker.dev' already exists in $FIL" + else + echo "ADDING 'docker.dev' entry to $FIL" + sudo sed -i "s#$HOSTN#$HOSTN docker.dev #g" $FIL + fi + fi + + - run: mvn verify diff --git a/pom.xml b/pom.xml index a49aa66..1e1dd88 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ afrozaar - @@ -150,64 +150,64 @@ javax.annotation - jsr250-api - 1.0 + javax.annotation-api + 1.3.2 - org.codehaus.jackson - jackson-mapper-asl - 1.9.13 + com.fasterxml.jackson.core + jackson-databind + 2.13.1 junit junit - 4.11 + 4.13.2 test com.fasterxml.jackson.core jackson-annotations - 2.6.5 + 2.13.1 com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider - 2.6.5 + 2.13.1 org.assertj assertj-core - 3.0.0 + 3.22.0 org.springframework spring-web - 4.1.7.RELEASE + 5.3.15 com.google.guava guava - 18.0 + 31.0.1-jre org.slf4j slf4j-api - 1.7.12 + 1.7.36 ch.qos.logback logback-classic - 1.1.3 + 1.2.10 org.yaml snakeyaml - 1.15 + 1.29 com.github.tomakehurst wiremock - 1.55 + 2.27.2 test @@ -218,12 +218,12 @@ com.google.code.findbugs jsr305 - 3.0.1 + 3.0.2 org.testcontainers testcontainers - 1.7.3 + 1.16.3 test diff --git a/src/test/java/com/afrozaar/wordpress/wpapi/v2/ClientLiveIT.java b/src/test/java/com/afrozaar/wordpress/wpapi/v2/ClientLiveIT.java index dd37b60..0626170 100644 --- a/src/test/java/com/afrozaar/wordpress/wpapi/v2/ClientLiveIT.java +++ b/src/test/java/com/afrozaar/wordpress/wpapi/v2/ClientLiveIT.java @@ -12,7 +12,7 @@ import com.afrozaar.wordpress.wpapi.v2.request.SearchRequest; import com.afrozaar.wordpress.wpapi.v2.response.PagedResponse; import com.afrozaar.wordpress.wpapi.v2.util.Tuples.Tuple2; -import org.apache.commons.lang.RandomStringUtils; +import org.apache.commons.lang3.RandomStringUtils; import org.junit.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,7 +41,7 @@ import static com.afrozaar.wordpress.wpapi.v2.request.SearchRequest.Builder.aSearchRequest; import static com.afrozaar.wordpress.wpapi.v2.util.Tuples.tuple; import static java.lang.String.format; -import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic; +import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; diff --git a/src/test/java/com/afrozaar/wordpress/wpapi/v2/WordpressClientIT.java b/src/test/java/com/afrozaar/wordpress/wpapi/v2/WordpressClientIT.java index a52be40..5537897 100644 --- a/src/test/java/com/afrozaar/wordpress/wpapi/v2/WordpressClientIT.java +++ b/src/test/java/com/afrozaar/wordpress/wpapi/v2/WordpressClientIT.java @@ -67,7 +67,7 @@ public void PostFieldProcessingTest() { final Map fieldMap = ((Client) wordpress).fieldsFrom(post); - assertThat(fieldMap).containsOnlyKeys("title", "modified_gmt", "format", "author"); + assertThat(fieldMap).containsOnlyKeys("title", "modified_gmt", "format"); LOG.debug("map to post: {}", fieldMap);