Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Haraldsen committed Jan 29, 2024
1 parent a70ad79 commit f1e7b80
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/ethlo/time/ParseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public ParseConfig withFractionSeparators(char... allowed)
return new ParseConfig(allowedDateTimeSeparators, allowed, failOnTrailingJunk);
}

public ParseConfig failOnTrailingJunk(boolean failOnTrailingJunk)
public ParseConfig withFailOnTrailingJunk(boolean failOnTrailingJunk)
{
return new ParseConfig(allowedDateTimeSeparators, allowedFractionSeparators, failOnTrailingJunk);
}
Expand Down
9 changes: 8 additions & 1 deletion src/test/java/com/ethlo/time/ParseConfigTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* #L%
*/

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;

import org.junit.jupiter.api.Test;
Expand All @@ -29,7 +30,13 @@ class ParseConfigTest
@Test
void testParseConfigInvalid1()
{
assertThrows(IllegalArgumentException.class, () -> ParseConfig.DEFAULT.withDateTimeSeparators((char[])null));
assertThrows(IllegalArgumentException.class, () -> ParseConfig.DEFAULT.withDateTimeSeparators((char[]) null));
assertThrows(IllegalArgumentException.class, () -> ParseConfig.DEFAULT.withDateTimeSeparators(new char[]{}));
}

@Test
void setAllowTrailingJunk()
{
assertThat(ParseConfig.DEFAULT.withFailOnTrailingJunk(true).isFailOnTrailingJunk()).isTrue();
}
}

0 comments on commit f1e7b80

Please sign in to comment.