Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Objects;
import java.util.Set;
import java.util.regex.Pattern;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

Expand All @@ -21,6 +22,7 @@ public final class DomainCollectionReleaseMetadata {
private final String expectedRelease;
private final Path metadata;

@Autowired
public DomainCollectionReleaseMetadata(
ObjectMapper mapper,
@Value("${GIT_COMMIT:}") String expectedRelease) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,22 @@
import java.nio.file.Path;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

class DomainCollectionReleaseMetadataTest {
private static final String RELEASE = "a".repeat(40);

@Test
void springSelectsTheProductionInjectionConstructor() {
try (var context = new AnnotationConfigApplicationContext()) {
context.registerBean(ObjectMapper.class);
context.register(DomainCollectionReleaseMetadata.class);
context.refresh();

assertThat(context.getBean(DomainCollectionReleaseMetadata.class)).isNotNull();
}
}

@Test
void targetReleaseRequiresRecurringDomainGate(@TempDir Path directory) throws Exception {
var metadata = directory.resolve("release.json");
Expand Down
Loading