Skip to content

Commit

Permalink
Add Test Coverage And Remove Eclipse Config Files (#84)
Browse files Browse the repository at this point in the history
* Add Test Coverage And Remove Eclipse Config Files

* Automatic retries

* Revert "Automatic retries"

This reverts commit ee2c43b.

* allow null or empty for failed items list
  • Loading branch information
zromano authored Mar 13, 2024
1 parent 9092dea commit 7e69bdc
Show file tree
Hide file tree
Showing 13 changed files with 603 additions and 102 deletions.
8 changes: 0 additions & 8 deletions .settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 0 additions & 4 deletions .settings/org.eclipse.m2e.core.prefs

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [UNRELEASED] - TBD
### Added
- Added more test coverage
### Removed
- Eclipse Config Files


## [3.2.0] - 2023-11-15
### Added
- Added latest Checkstyle version,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/smartsheet/api/Trace.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ public static Set<Trace> parse(String traces) {
LoggerFactory.getLogger(Trace.class).warn("invalid trace in parse() - '{}'", part);
}
}
return results.size() > 0 ? results : Collections.<Trace>emptySet();
return !results.isEmpty() ? results : Collections.<Trace>emptySet();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,15 @@ public class OAuthFlowImpl implements OAuthFlow {
* @param jsonSerializer the json serializer
* @throws IllegalArgumentException If any argument is null, or empty string.
*/
public OAuthFlowImpl(String clientId, String clientSecret, String redirectURL, String authorizationURL,
String tokenURL, HttpClient httpClient, JsonSerializer jsonSerializer) {
public OAuthFlowImpl(
String clientId,
String clientSecret,
String redirectURL,
String authorizationURL,
String tokenURL,
HttpClient httpClient,
JsonSerializer jsonSerializer
) {
Util.throwIfNull(clientId, clientSecret, redirectURL, authorizationURL, tokenURL, httpClient, jsonSerializer);
Util.throwIfEmpty(clientId, clientSecret, redirectURL, authorizationURL, tokenURL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
* a collection of Stream-oriented utility methods
*/
public class StreamUtil {
private StreamUtil() {
// Empty private constructor since every method in this class is static
}

public static final int ONE_MB = 1 << 20;
public static final int ONE_KB = 1 << 10;
public static final int TEN_KB = 10 * ONE_KB;
Expand Down
50 changes: 50 additions & 0 deletions src/test/java/com/smartsheet/api/SmartsheetFactoryTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* Copyright (C) 2024 Smartsheet
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.smartsheet.api;

import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class SmartsheetFactoryTest {
@Test
void testStaticStrings() {
assertThat(SmartsheetFactory.DEFAULT_BASE_URI).isEqualTo("https://api.smartsheet.com/2.0/");
assertThat(SmartsheetFactory.GOV_BASE_URI).isEqualTo("https://api.smartsheetgov.com/2.0/");
}

@Nested
class CreateDefaultClientTests {
}

@Nested
class CreateDefaultGovAccountClientTests {
}

@Nested
class CustomTests {
@Test
void custom() {
// Act
SmartsheetBuilder result = SmartsheetFactory.custom();

// Assert
assertThat(result).isInstanceOf(SmartsheetBuilder.class);
}
}
}
Loading

0 comments on commit 7e69bdc

Please sign in to comment.