Skip to content

Commit

Permalink
Merge pull request #27 from tubbynl/feature/issue-24
Browse files Browse the repository at this point in the history
#24 Split integration tests by concept
  • Loading branch information
stil4m authored Oct 29, 2016
2 parents 63c794b + d8b1814 commit f97be10
Show file tree
Hide file tree
Showing 13 changed files with 593 additions and 469 deletions.
4 changes: 2 additions & 2 deletions src/main/java/nl/stil4m/mollie/DynamicClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public DynamicClientBuilder withMapper(ObjectMapper objectMapper) {
}

public DynamicClient build() {
final HttpClient client = this.client.orElseGet(() -> HttpClientBuilder.create().build());
final String endpoint = this.endpoint.orElseGet(() -> "https://api.mollie.com/v1");
final HttpClient client = this.client.orElseGet(HttpClientBuilder.create()::build);
final String endpoint = this.endpoint.orElse("https://api.mollie.com/v1");
final ObjectMapper objectMapper = this.objectMapper.orElseGet(ObjectMapper::new);
objectMapper.registerModule(new Jdk8Module());
return new DynamicClient(endpoint, new RequestExecutor(client, objectMapper));
Expand Down
1 change: 0 additions & 1 deletion src/main/java/nl/stil4m/mollie/concepts/Customers.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import nl.stil4m.mollie.domain.UpdateCustomer;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/nl/stil4m/mollie/domain/CreateCustomer.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Optional;

Expand Down
24 changes: 24 additions & 0 deletions src/test/java/nl/stil4m/mollie/ClientBuilderTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package nl.stil4m.mollie;


import static org.junit.Assert.assertNotNull;

import org.junit.Test;

public class ClientBuilderTest {

ClientBuilder builder = new ClientBuilder();


@Test(expected=IllegalArgumentException.class)
public void testBuildWithoutApiKey() {
builder.build();
}

@Test
public void testBuildWithApiKey() {
Client client = builder.withApiKey("test").build();

assertNotNull(client);
}
}
232 changes: 0 additions & 232 deletions src/test/java/nl/stil4m/mollie/ClientIntegrationTest.java

This file was deleted.

Loading

0 comments on commit f97be10

Please sign in to comment.