Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 18 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<profiles>
<profile>
<id>afrozaar</id>
<!-- <properties> <repository.home>https://maven-repostiory.afrozaar.com/artifactory</repository.home> <deploy-release>${repository.home}/libs-release-local</deploy-release>
<!-- <properties> <repository.home>https://maven-repostiory.afrozaar.com/artifactory</repository.home> <deploy-release>${repository.home}/libs-release-local</deploy-release>
<deploy-snapshot>${repository.home}/libs-snapshot-local</deploy-snapshot> </properties> -->

<properties>
Expand Down Expand Up @@ -150,64 +150,64 @@
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<version>4.13.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.6.5</version>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.6.5</version>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.0.0</version>
<version>3.22.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
<version>5.3.15</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
<version>31.0.1-jre</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.12</version>
<version>1.7.36</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.3</version>
<version>1.2.10</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.15</version>
<version>1.29</version>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock</artifactId>
<version>1.55</version>
<version>2.27.2</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -218,12 +218,12 @@
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.1</version>
<version>3.0.2</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.7.3</version>
<version>1.16.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void PostFieldProcessingTest() {

final Map<String, Object> 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);

Expand Down