Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow setting both apache http client and test parameters #22

Merged
merged 46 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
801347c
Allow setting both `apache http client` and `test` parameters
Sep 12, 2017
003b50c
Moved Mockito to test dependency.
twistedpair Sep 13, 2017
7bcf27b
Update README.md
ciceropablo Oct 10, 2017
a048c0d
added code of conduct
nightrainlily Oct 10, 2017
512939a
Remove oraclejdk7 from .travis.yml
maxymshg Oct 11, 2017
623c25d
Merge pull request #1 from maxymshg/fix-issue-28
maxymshg Oct 11, 2017
24c5304
Merge pull request #35 from maxymshg/master
thinkingserious Oct 11, 2017
3f8510e
Merge pull request #30 from ciceropablo/patch-1
thinkingserious Oct 12, 2017
9205ca4
Merge pull request #23 from twistedpair/master
thinkingserious Oct 12, 2017
317a74b
Version Bump v4.1.1: #23 Moved Mockito to test dependency.
thinkingserious Oct 12, 2017
bd6aa07
fixed formatting on code of conduct
nightrainlily Oct 13, 2017
6685bbb
Merge pull request #33 from nightrainlily/master
thinkingserious Oct 13, 2017
4ef886e
More SEO Friendly Section links
pushkyn Oct 21, 2017
c2e79bd
Update readme - moved logo to top, added ToC, license and other badges
pushkyn Oct 21, 2017
56503c7
Merge pull request #40 from pushkyn/seo-friendly-section-links
Oct 22, 2017
1cb5dec
Merge pull request #41 from pushkyn/update-readme
Oct 22, 2017
8b021dd
update contributing.md - fix typo
pushkyn Oct 23, 2017
9c68856
Merge pull request #43 from pushkyn/fix-contributing
Oct 24, 2017
a739fb7
Add opensdk8
kazoni Oct 24, 2017
a2a11ce
Update to openjdk8
kazoni Oct 24, 2017
e4eb4ff
updated jdk
diegorramos Oct 26, 2017
3a3481b
updated jdk
diegorramos Oct 26, 2017
7bda4ae
updated jdk
diegorramos Oct 26, 2017
8084d45
implemented task script with build check
diegorramos Oct 26, 2017
93daaaa
updated version gradle
diegorramos Oct 26, 2017
569993c
removed wrapper
diegorramos Oct 26, 2017
e9e078d
removed wrapper
diegorramos Oct 26, 2017
615d8df
removed gradle assemble
diegorramos Oct 26, 2017
31b6407
updated version gradle
diegorramos Oct 26, 2017
b8fd6e0
version gradle
diegorramos Oct 26, 2017
5dd0a07
updated version gradle
diegorramos Oct 26, 2017
f2c5e28
removed openjdk7, travis without support
diegorramos Oct 26, 2017
1b11adb
add github PR template
pushkyn Oct 26, 2017
8a42b32
Merge pull request #45 from kazoni/master
Oct 27, 2017
b1890ad
Merge branch 'master' into master
Oct 27, 2017
f942679
Merge branch 'master' into master
Oct 27, 2017
5a9d251
Merge pull request #48 from pushkyn/add-pull-request-template
Oct 27, 2017
b8d31ca
add usage.md
rohitdaryanani Oct 27, 2017
50ec375
Added TROUBLESHOOTING.md
mptap Oct 27, 2017
ea8d3a2
Merge pull request #46 from Polovinsky/master
Oct 28, 2017
d6fda6c
Merge pull request #55 from rohitdaryanani/master
Oct 28, 2017
69fc3d6
Merge pull request #56 from mptap/add-troubleshooting
Oct 28, 2017
4b832e8
change year for the license file
Oct 28, 2017
4baf706
Update PULL_REQUEST_TEMPLATE
Oct 28, 2017
c0d64f2
Merge pull request #64 from unluisco/master
Oct 28, 2017
d186c7f
Merge branch 'client_another_ctor' of https://github.com/maximn/java-…
mbernier Oct 28, 2017
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
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.


Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
e.g.
Fixes #1
Closes #2
-->
# Fixes #

### Checklist
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
- [ ] I have read the [Contribution Guide] and my PR follows them.
- [ ] I updated my branch with the master branch.
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
- [ ] I have added in line documentation to the code I modified

### Short description of what this PR does:
-
-

If you have questions, please send an email to [Sendgrid](mailto:[email protected]), or file a Github Issue in this repository.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
language: java
sudo: false
jdk:
- oraclejdk8
- oraclejdk7
- openjdk7
- openjdk8
before_script:
- chmod a+x gradlew
script:
- ./gradlew build check
after_script:
- "./gradlew build"
- "./scripts/s3upload.sh"
env:
global:
Expand All @@ -22,4 +23,4 @@ notifications:
Build %{build_number}</a> on branch <i>%{branch}</i> by %{author}: <strong>%{message}</strong>
<a href="https://github.com/sendgrid/%{repository}/commits/%{commit}">View on GitHub</a>'
format: html
notify: true
notify: true
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## [4.1.1] - 2016-10-11
### Added
- [Pull #23](https://github.com/sendgrid/java-http-client/pull/23): Moved Mockito to test dependency.
- BIG thanks to [Joseph Lust](https://github.com/twistedpair) for the pull request!

## [4.1.0] - 2016-10-11
### Added
- [Pull #17](https://github.com/sendgrid/java-http-client/pull/17): Assign server response outside try block
Expand Down
41 changes: 41 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# SendGrid Community Code of Conduct

The SendGrid open source community is made up of members from around the globe with a diverse set of skills, personalities, and experiences. It is through these differences that our community experiences successes and continued growth. When you're working with members of the community, we encourage you to follow these guidelines, which help steer our interactions and strive to maintain a positive, successful and growing community.

### Be Open
Members of the community are open to collaboration, whether it's on pull requests, code reviews, approvals, issues or otherwise. We're receptive to constructive comments and criticism, as the experiences and skill sets of all members contribute to the whole of our efforts. We're accepting of all who wish to take part in our activities, fostering an environment where anyone can participate, and everyone can make a difference.

### Be Considerate
Members of the community are considerate of their peers, which include other contributors and users of SendGrid. We're thoughtful when addressing the efforts of others, keeping in mind that often the labor was completed with the intent of the good of the community. We're attentive in our communications, whether in person or online, and we're tactful when approaching differing views.

### Be Respectful
Members of the community are respectful. We're respectful of others, their positions, their skills, their commitments and their efforts. We're respectful of the volunteer efforts that permeate the SendGrid community. We're respectful of the processes outlined in the community, and we work within them. When we disagree, we are courteous in raising our issues. Overall, we're good to each other. We contribute to this community not because we have to, but because we want to. If we remember that, these guidelines will come naturally.

## Additional Guidance

### Disclose Potential Conflicts of Interest
Community discussions often involve interested parties. We expect participants to be aware when they are conflicted due to employment or other projects they are involved in and disclose those interests to other project members. When in doubt, over-disclose. Perceived conflicts of interest are important to address so that the community’s decisions are credible even when unpopular, difficult or favorable to the interests of one group over another.

### Interpretation
This Code is not exhaustive or complete. It is not a rulebook; it serves to distill our common understanding of a collaborative, shared environment and goals. We expect it to be followed in spirit as much as in the letter. When in doubt, try to abide by [SendGrid’s cultural values](https://sendgrid.com/blog/employee-engagement-the-4h-way) defined by our “4H’s”: Happy, Hungry, Humble and Honest.

### Enforcement
Most members of the SendGrid community always comply with this Code, not because of the existence of this Code, but because they have long experience participating in open source communities where the conduct described above is normal and expected. However, failure to observe this Code may be grounds for suspension, reporting the user for abuse or changing permissions for outside contributors.

## If you have concerns about someone’s conduct
**Initiate Direct Contact** - It is always appropriate to email a community member (if contact information is available), mention that you think their behavior was out of line, and (if necessary) point them to this Code.

**Discuss Publicly** - Discussing publicly is always acceptable. Note, though, that approaching the person directly may be better, as it tends to make them less defensive, and it respects the time of other community members, so you probably want to try direct contact first.

**Contact the Moderators** - You can reach the SendGrid moderators by emailing [email protected].

## Submission to SendGrid Repositories
Finally, just a reminder, changes to the SendGrid repositories will only be accepted upon completion of the [SendGrid Contributor Agreement](https://cla.sendgrid.com).

## Attribution

SendGrid thanks the following, on which it draws for content and inspiration:

* [Python Community Code of Conduct](https://www.python.org/psf/codeofconduct/)
* [Open Source Initiative General Code of Conduct](https://opensource.org/codeofconduct)
* [Apache Code of Conduct](https://www.apache.org/foundation/policies/conduct.html)
32 changes: 16 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ Hello! Thank you for choosing to help contribute to one of the SendGrid open sou

- [CLAs and CCLAs](#cla)
- [Roadmap & Milestones](#roadmap)
- [Feature Request](#feature_request)
- [Submit a Bug Report](#submit_a_bug_report)
- [Improvements to the Codebase](#improvements_to_the_codebase)
- [Understanding the Code Base](#understanding_the_codebase)
- [Feature Request](#feature-request)
- [Submit a Bug Report](#submit-a-bug-report)
- [Improvements to the Codebase](#improvements-to-the-codebase)
- [Understanding the Code Base](#understanding-the-codebase)
- [Testing](#testing)
- [Style Guidelines & Naming Conventions](#style_guidelines_and_naming_conventions)
- [Creating a Pull Request](#creating_a_pull_request)
- [Style Guidelines & Naming Conventions](#style-guidelines-and-naming-conventions)
- [Creating a Pull Request](#creating-a-pull-request)

<a name="roadmap"></a>
We use [Milestones](https://github.com/sendgrid/java-http-client/milestones) to help define current roadmaps, please feel free to grab an issue from the current milestone. Please indicate that you have begun work on it to avoid collisions. Once a PR is made, community review, comments, suggestions and additional PRs are welcomed and encouraged.
Expand All @@ -26,7 +26,7 @@ When you create a Pull Request, after a few seconds, a comment will appear with

There are a few ways to contribute, which we'll enumerate below:

<a name="feature_request"></a>
<a name="feature-request"></a>
## Feature Request

If you'd like to make a feature request, please read this section.
Expand All @@ -36,7 +36,7 @@ The GitHub issue tracker is the preferred channel for library feature requests,
- Please **search for existing issues** in order to ensure we don't have duplicate bugs/feature requests.
- Please be respectful and considerate of others when commenting on issues

<a name="submit_a_bug_report"></a>
<a name="submit-a-bug-report"></a>
## Submit a Bug Report

Note: DO NOT include your credentials in ANY code examples, descriptions, or media you make public.
Expand All @@ -53,7 +53,7 @@ Before you decide to create a new issue, please try the following:

In order to make the process easier, we've included a [sample bug report template](https://github.com/sendgrid/java-http-client/.github/ISSUE_TEMPLATE) (borrowed from [Ghost](https://github.com/TryGhost/Ghost/)). The template uses [GitHub flavored markdown](https://help.github.com/articles/github-flavored-markdown/) for formatting.

<a name="improvements_to_the_codebase"></a>
<a name="improvements-to-the-codebase"></a>
## Improvements to the Codebase

We welcome direct contributions to the java-http-client code base. Thank you!
Expand All @@ -64,7 +64,7 @@ We welcome direct contributions to the java-http-client code base. Thank you!

##### Prerequisites #####

- Java version Oracle JDK 7, 8 or OpenJDK 7
- Java version Oracle JDK 8 or OpenJDK 7
- Please see [build.gradle](https://github.com/sendgrid/java-http-client/blob/master/build.gradle)

##### Initial setup: #####
Expand All @@ -89,10 +89,10 @@ source ./sendgrid.env
```bash
./gradlew build
cd examples
javac -classpath {path_to}/sendgrid-java-http-client-4.1.0-jar.jar:. Example.java && java -classpath {path_to}/sendgrid-java-http-client-4.1.0-jar.jar:. Example
javac -classpath {path_to}/sendgrid-java-http-client-4.1.1-jar.jar:. Example.java && java -classpath {path_to}/sendgrid-java-http-client-4.1.1-jar.jar:. Example
```

<a name="understanding_the_codebase"></a>
<a name="understanding-the-codebase"></a>
## Understanding the Code Base

**/examples**
Expand Down Expand Up @@ -131,7 +131,7 @@ Run the tests:
./gradlew test -i
```

<a name="style_guidelines_and_naming_conventions"></a>
<a name="style-guidelines-and-naming-conventions"></a>
## Style Guidelines & Naming Conventions

Generally, we follow the style guidelines as suggested by the official language. However, we ask that you conform to the styles that already exist in the library. If you wish to deviate, please explain your reasoning.
Expand All @@ -141,8 +141,8 @@ Please run your code through:
- [FindBugs](http://findbugs.sourceforge.net/)
- [CheckStyle](http://checkstyle.sourceforge.net/) with [Google's Java Style Guide](http://checkstyle.sourceforge.net/reports/google-java-style.html).


## Creating a Pull Request<a name="creating_a_pull_request"></a>
<a name="creating-a-pull-request"></a>
## Creating a Pull Request

1. [Fork](https://help.github.com/fork-a-repo/) the project, clone your fork,
and configure the remotes:
Expand All @@ -151,7 +151,7 @@ Please run your code through:
# Clone your fork of the repo into the current directory
git clone https://github.com/sendgrid/java-http-client
# Navigate to the newly cloned directory
cd sendgrid-python
cd java-http-client
# Assign the original repo to a remote called "upstream"
git remote add upstream https://github.com/sendgrid/java-http-client
```
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 SendGrid, Inc.
Copyright (c) 2016-2017 SendGrid, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
69 changes: 38 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
[![Build Status](https://travis-ci.org/sendgrid/java-http-client.svg?branch=master)](https://travis-ci.org/sendgrid/java-http-client) [![Maven](https://maven-badges.herokuapp.com/maven-central/com.sendgrid/java-http-client/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.sendgrid/java-http-client)
![SendGrid Logo](https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)

[![Build Status](https://travis-ci.org/sendgrid/java-http-client.svg?branch=master)](https://travis-ci.org/sendgrid/java-http-client)
[![Maven Central](https://img.shields.io/maven-central/v/com.sendgrid/java-http-client.svg)](http://mvnrepository.com/artifact/com.sendgrid/java-http-client)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
[![Twitter Follow](https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow)](https://twitter.com/sendgrid)
[![GitHub contributors](https://img.shields.io/github/contributors/sendgrid/java-http-client.svg)](https://github.com/sendgrid/java-http-client/graphs/contributors)

**Quickly and easily access any RESTful or RESTful-like API.**

If you are looking for the SendGrid API client library, please see [this repo](https://github.com/sendgrid/sendgrid-java).

# Table of Contents

* [Announcements](#announcements)
* [Installation](#installation)
* [Quick Start](#quick-start)
* [Usage](#usage)
* [Roadmap](#roadmap)
* [How to Contribute](#contribute)
* [About](#about)
* [License](#license)

<a name="announcements"></a>
# Announcements

All updates to this project is documented in our [CHANGELOG](https://github.com/sendgrid/java-http-client/blob/master/CHANGELOG.md).

<a name="installation"></a>
# Installation

## Prerequisites

- Java version Oracle JDK 7, 8 or OpenJDK 7
- Java version Oracle JDK 8 or OpenJDK 7

## Install via Maven w/ Gradle

```groovy
...
dependencies {
...
compile 'com.sendgrid:java-http-client:4.1.0'
compile 'com.sendgrid:java-http-client:4.1.1'
}

repositories {
Expand All @@ -35,20 +54,21 @@ repositories {
<dependency>
<groupId>com.sendgrid</groupId>
<artifactId>java-http-client</artifactId>
<version>3.0.0</version>
<version>4.1.1</version>
</dependency>
```

`mvn install`

## Install via Fat Jar

[Download](http://repo1.maven.org/maven2/com/sendgrid/java-http-client/4.1.0/java-http-client-4.1.0-jar.jar)
[sendgrid-java-latest.jar](http://dx.sendgrid.com/downloads/java-http-client/java-http-client-latest.jar)

## Dependencies

- Please see the [build.gradle file](https://github.com/sendgrid/java-http-client/blob/master/build.gradle)

<a name="quick-start"></a>
# Quick Start

Here is a quick example:
Expand Down Expand Up @@ -95,46 +115,33 @@ try {
}
```

<a name="usage"></a>
# Usage
[Library Usage Documentation](USAGE.md)

- [Example Code](https://github.com/sendgrid/java-http-client/tree/master/examples)

The example uses SendGrid, you can get your free account [here](https://sendgrid.com/free?source=java-http-client).

First, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).

```bash
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
```

```bash
mvn package
cd examples
javac -classpath {path_to}/sendgrid-java-http-client-4.0.0-jar.jar:. Example.java && java -classpath {path_to}/sendgrid-java-http-client-4.0.0-jar.jar:. Example
```

## Roadmap
<a name="roadmap"></a>
# Roadmap

If you are intersted in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/java-http-client/milestones). We would love to hear your feedback.
If you are interested in the future direction of this project, please take a look at our [milestones](https://github.com/sendgrid/java-http-client/milestones). We would love to hear your feedback.

## How to Contribute
<a name="contribute"></a>
# How to Contribute

We encourage contribution to our projects please see our [CONTRIBUTING](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md) guide for details.

Quick links:

- [Feature Request](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#feature_request)
- [Bug Reports](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#submit_a_bug_report)
- [Feature Request](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#feature-request)
- [Bug Reports](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#submit-a-bug-report)
- [Sign the CLA to Create a Pull Request](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#cla)
- [Improvements to the Codebase](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#improvements_to_the_codebase)
- [Improvements to the Codebase](https://github.com/sendgrid/java-http-client/blob/master/CONTRIBUTING.md#improvements-to-the-codebase)

<a name="about"></a>
# About

java-http-client is guided and supported by the SendGrid [Developer Experience Team](mailto:[email protected]).

java-http-client is maintained and funded by SendGrid, Inc. The names and logos for java-http-client are trademarks of SendGrid, Inc.

![SendGrid Logo]
(https://uiux.s3.amazonaws.com/2016-logos/email-logo%402x.png)
# License
[The MIT License (MIT)](LICENSE.txt)
18 changes: 18 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
If you have a non-library SendGrid issue, please contact our [support team](https://support.sendgrid.com).

If you can't find a solution below, please open an [issue](https://github.com/sendgrid/java-http-client/issues).

## Table of Contents

* [Viewing the Request Body](#request-body)

<a name="request-body"></a>
## Viewing the Request Body

When debugging or testing, it may be useful to examine the raw request body to compare against the [documented format](https://sendgrid.com/docs/API_Reference/api_v3.html).

You can do this right before you call `request.setBody(mail.build())` like so:

```java
System.out.println(mail.build());
```
19 changes: 19 additions & 0 deletions USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Usage

- [Example Code](https://github.com/sendgrid/java-http-client/tree/master/examples)

The example uses SendGrid, you can get your free account [here](https://sendgrid.com/free?source=java-http-client).

First, update your environment with your [SENDGRID_API_KEY](https://app.sendgrid.com/settings/api_keys).

```bash
echo "export SENDGRID_API_KEY='YOUR_API_KEY'" > sendgrid.env
echo "sendgrid.env" >> .gitignore
source ./sendgrid.env
```

```bash
mvn package
cd examples
javac -classpath {path_to}/sendgrid-java-http-client-4.0.0-jar.jar:. Example.java && java -classpath {path_to}/sendgrid-java-http-client-4.0.0-jar.jar:. Example
```
Loading