Added codecov support.

This commit is contained in:
Alexey Zinchenko 2019-06-16 14:42:42 +03:00
parent c44e97745f
commit 6e0ddc2a83
4 changed files with 26 additions and 5 deletions

View File

@ -1,8 +1,11 @@
language: java
install: mvn install -DskipTests -Dgpg.skip
script: mvn test -Dmaven.skip.deploy=true -Dgpg.skip
script: mvn cobertura:cobertura -Dmaven.skip.deploy=true -Dgpg.skip
jdk:
- openjdk8
- openjdk11
- openjdk11
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@ -1,4 +1,4 @@
# OpenWeatherMap Java API [![Build Status][ci-shield]][ci-link]
# OpenWeatherMap Java API [![Build Status][ci-shield]][ci-link] [![codecov][codecov-shield]][codecov-link]
Java API for OpenWeatherMap services.
### Implemented features:
@ -51,4 +51,8 @@ compile('com.github.prominence:openweathermap-api:2.0-SNAPSHOT')
MIT
[ci-shield]: https://travis-ci.org/Prominence/openweathermap-java-api.svg?branch=master
[ci-link]: https://travis-ci.org/Prominence/openweathermap-java-api
[ci-link]: https://travis-ci.org/Prominence/openweathermap-java-api
[codecov-shield]: https://codecov.io/gh/Prominence/openweathermap-java-api/branch/master/graph/badge.svg
[codecov-link]: https://codecov.io/gh/Prominence/openweathermap-java-api

13
pom.xml
View File

@ -130,6 +130,19 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.7</version>
<configuration>
<quiet>true</quiet>
<formats>
<format>html</format>
<format>xml</format>
</formats>
<check />
</configuration>
</plugin>
</plugins>
</build>

View File

@ -32,6 +32,7 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public final class RequestUtils {
@ -78,7 +79,7 @@ public final class RequestUtils {
private static String getRawResponse(InputStream inputStream) {
StringBuilder result = new StringBuilder();
try(BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
try(BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8))) {
String line;
while ((line = reader.readLine()) != null) {
result.append(line);