Skip to content

Commit

Permalink
feat: improved test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
U117293 authored and U117293 committed Mar 17, 2023
1 parent 86a3130 commit 6d3b720
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,28 @@ void test_case_12() {
assertThat(loader.loadUuidGenerator(), instanceOf(OtherGenerator.class));
}

public static class OtherGenerator implements UuidGenerator {
@Override
public UUID get() {
return null;
}
/**
* | 13 | undefined | IncrementingUuidGenerator | IncrementingUuidGenerator
* used |
*/
@Test
void test_case_13() {
Options options = () -> null;
UuidGeneratorServiceLoader loader = new UuidGeneratorServiceLoader(
() -> new ServiceLoaderTestClassLoader(UuidGenerator.class,
IncrementingUuidGenerator.class),
options);
assertThat(loader.loadUuidGenerator(), instanceOf(IncrementingUuidGenerator.class));
}

public static class YetAnotherGenerator implements UuidGenerator {
public static class OtherGenerator implements UuidGenerator {
@Override
public UUID get() {
return null;
}
}

public static class NoSuchUuidGenerator implements UuidGenerator {
public NoSuchUuidGenerator() {
}

public static class YetAnotherGenerator implements UuidGenerator {
@Override
public UUID get() {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Testcases for `UuidGeneratorServiceLoader`

| # | uuid-generator property | Available services | Result |
|----|---------------------------|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| 1 | undefined | none | exception, no generators available |
| 2 | undefined | RandomUuidGenerator, IncrementingUuidGenerator | RandomUuidGenerator used |
| 3 | RandomUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator | RandomUuidGenerator used |
| 4 | undefined | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator | OtherGenerator used |
| 5 | RandomUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator | RandomUuidGenerator used |
| 6 | undefined | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator, YetAnotherGenerator | exception, cucumber couldn't decide multiple (non default) generators available |
| 7 | OtherGenerator | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator, YetAnotherGenerator | OtherGenerator used |
| 8 | IncrementingUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator, YetAnotherGenerator | IncrementingUuidGenerator used |
| 9 | IncrementingUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator | IncrementingUuidGenerator used |
| 10 | OtherGenerator | none | exception, generator OtherGenerator not available |
| 11 | undefined | OtherGenerator | OtherGenerator used |
| 12 | undefined | IncrementingUuidGenerator, OtherGenerator | OtherGenerator used |
| # | uuid-generator property | Available services | Result |
|-----|---------------------------|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|
| 1 | undefined | none | exception, no generators available |
| 2 | undefined | RandomUuidGenerator, IncrementingUuidGenerator | RandomUuidGenerator used |
| 3 | RandomUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator | RandomUuidGenerator used |
| 4 | undefined | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator | OtherGenerator used |
| 5 | RandomUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator | RandomUuidGenerator used |
| 6 | undefined | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator, YetAnotherGenerator | exception, cucumber couldn't decide multiple (non default) generators available |
| 7 | OtherGenerator | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator, YetAnotherGenerator | OtherGenerator used |
| 8 | IncrementingUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator, OtherGenerator, YetAnotherGenerator | IncrementingUuidGenerator used |
| 9 | IncrementingUuidGenerator | RandomUuidGenerator, IncrementingUuidGenerator | IncrementingUuidGenerator used |
| 10 | OtherGenerator | none | exception, generator OtherGenerator not available |
| 11 | undefined | OtherGenerator | OtherGenerator used |
| 12 | undefined | IncrementingUuidGenerator, OtherGenerator | OtherGenerator used |
| 13 | undefined | IncrementingUuidGenerator | IncrementingUuidGenerator used |

0 comments on commit 6d3b720

Please sign in to comment.