Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/gradle/junitVersion-5.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
big-andy-coates committed Aug 22, 2022
2 parents 7232a20 + 72fadb8 commit 5135f47
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import static org.junit.jupiter.params.ParameterizedTest.INDEX_PLACEHOLDER;
import static org.mockito.Mockito.mock;

import java.net.URI;
import java.util.Arrays;
import java.util.ConcurrentModificationException;
import java.util.Optional;
Expand Down Expand Up @@ -258,7 +259,13 @@ private interface BaseResource extends ResourceDescriptor {}

private interface BaseResource2 extends ResourceDescriptor {}

private static class TestResource implements BaseResource {}
private static class TestResource implements BaseResource {

@Override
public URI id() {
return null;
}
}

/** ResourceDescriptor - BaseResource - TestResource - TestResource2 */
private static class TestResource2 extends TestResource {}
Expand All @@ -270,5 +277,11 @@ private static class TestResource2 extends TestResource {}
private static class TestResource3 extends TestResource implements BaseResource {}

/** /- BaseResource -\ ResourceDescriptor -| |- TestResource4 \- BaseResource2 -\ */
private static class TestResource4 implements BaseResource, BaseResource2 {}
private static class TestResource4 implements BaseResource, BaseResource2 {

@Override
public URI id() {
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.net.URI;
import java.util.List;
import org.creekservice.api.base.type.temporal.AccurateClock;
import org.creekservice.api.base.type.temporal.Clock;
Expand All @@ -51,9 +52,11 @@
class CreekServicesTest {

@Mock private ServiceDescriptor serviceDescriptor;
@Mock private JavaNineExtensionInput java9Input;
@Mock private JavaNineExtensionProvider2.Internal java9Internal;
@Mock private JavaNineExtensionProvider2.Output java9Output;
private final JavaNineExtensionInput java9Input = new JavaNineExtensionInput();
private final JavaNineExtensionProvider2.Internal java9Internal =
new JavaNineExtensionProvider2.Internal();
private final JavaNineExtensionProvider2.Output java9Output =
new JavaNineExtensionProvider2.Output();

@BeforeEach
void setUp() {
Expand Down Expand Up @@ -153,5 +156,10 @@ void shouldNotThrowIfAllResourcesHandled() {

private static final class UnhandledExtensionOptions implements CreekExtensionOptions {}

private static final class UnhandledResourceDef implements ComponentInput {}
private static final class UnhandledResourceDef implements ComponentInput {
@Override
public URI id() {
return URI.create("kafka-topic://cluster/topic");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
package org.creekservice.test.api.java.nine.service.extension;


import java.net.URI;
import org.creekservice.api.platform.metadata.ComponentInput;

public final class JavaNineExtensionInput implements ComponentInput {}
public final class JavaNineExtensionInput implements ComponentInput {

private final URI id = URI.create("java9:test-resource");

@Override
public URI id() {
return id;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import static java.util.Objects.requireNonNull;

import java.net.URI;
import org.creekservice.api.platform.metadata.ComponentInternal;
import org.creekservice.api.platform.metadata.ComponentOutput;
import org.creekservice.api.platform.metadata.ServiceDescriptor;
Expand Down Expand Up @@ -61,7 +62,23 @@ public ServiceDescriptor serviceDescriptor() {
}
}

public static final class Internal implements ComponentInternal {}
public static final class Internal implements ComponentInternal {

public static final class Output implements ComponentOutput {}
private final URI id = URI.create("java9-2:test-resource");

@Override
public URI id() {
return id;
}
}

public static final class Output implements ComponentOutput {

private final URI id = URI.create("java9-2:test-resource");

@Override
public URI id() {
return id;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import java.net.URI;
import java.util.List;
import java.util.Optional;
import org.creekservice.api.base.type.temporal.AccurateClock;
Expand Down Expand Up @@ -164,5 +165,10 @@ void shouldNotThrowIfAllResourcesHandled() {

private static final class UnhandledExtensionOptions implements CreekExtensionOptions {}

private static final class UnhandledResourceDef implements ComponentInput {}
private static final class UnhandledResourceDef implements ComponentInput {
@Override
public URI id() {
return URI.create("kafka-topic://cluster/topic");
}
}
}

0 comments on commit 5135f47

Please sign in to comment.