Have to review mapbox-java services-core module and add unit tests where required
Samples of code without unit tests:
|
public final class MapboxUtils { |
|
|
|
private MapboxUtils() { |
|
// Empty private constructor since only static methods are found inside class. |
|
} |
|
|
|
/** |
|
* Checks that the provided access token is not empty or null, and that it starts with |
|
* the right prefixes. Note that this method does not check Mapbox servers to verify that |
|
* it actually belongs to an account. |
|
* |
|
* @param accessToken A Mapbox access token. |
|
* @return true if the provided access token is valid, false otherwise. |
|
* @since 1.0.0 |
|
*/ |
|
public static boolean isAccessTokenValid(String accessToken) { |
|
return !TextUtils.isEmpty(accessToken) && !(!accessToken.startsWith("pk.") |
|
&& !accessToken.startsWith("sk.") && !accessToken.startsWith("tk.")); |
|
} |
|
} |
|
public static String formatCoordinate(double coordinate, int precision) { |
|
String pattern = "0." + new String(new char[precision]).replace("\0", "0"); |
|
DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(Locale.US); |
|
df.applyPattern(pattern); |
|
df.setRoundingMode(RoundingMode.FLOOR); |
|
return df.format(coordinate); |
|
} |
Have to review mapbox-java
services-coremodule and add unit tests where requiredSamples of code without unit tests:
mapbox-java/services-core/src/main/java/com/mapbox/core/utils/MapboxUtils.java
Lines 8 to 27 in 3bed27a
mapbox-java/services-core/src/main/java/com/mapbox/core/utils/TextUtils.java
Lines 82 to 88 in 3bed27a