Skip to content

Commit

Permalink
[CI] Use JDK 21 as runtime (#4681)
Browse files Browse the repository at this point in the history
  • Loading branch information
valfirst authored Dec 20, 2023
1 parent 443d293 commit 13a0174
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ jobs:
restore-keys: |
tests-history-cache-
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21

- name: Warm up VIVIDUS test site
run: curl https://vividus-test-site-a92k.onrender.com/ &
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,10 @@
class DryRunAwareExecutorTests
{
@ParameterizedTest
@CsvSource(value = {"true, 17", "false, 19"})
@CsvSource({
"true, 17",
"false, 19"
})
void shouldReturnCorrectValue(boolean dryRun, int expectedValue)
{
var storyControls = mock(StoryControls.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,7 +34,7 @@ void testSetFormats()
{
List<Format> formats = List.of(Format.XML);
builder.setFormats(formats);
assertEquals(List.of(org.jbehave.core.reporters.Format.XML), builder.formats());
assertEquals(List.of(Format.XML), builder.formats());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BatchStorageTests

private BatchStorage batchStorage;

void initializeBatchStorage() throws IOException
private void initializeBatchStorage() throws IOException
{
var batchConfigurations = new HashMap<String, String>();
addBatchConfiguration(batchConfigurations, 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2022 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,6 @@
import java.util.LinkedList;
import java.util.List;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.vividus.model.RunningStory;
import org.vividus.testcontext.SimpleTestContext;
Expand Down Expand Up @@ -56,7 +55,7 @@ void testPutRunningStory()
runTestContext.setTestContext(new SimpleTestContext());
RunningStory runningStory = new RunningStory();
runTestContext.putRunningStory(runningStory, false);
Assertions.assertEquals(runningStory, runTestContext.getRunningStory());
assertEquals(runningStory, runTestContext.getRunningStory());
}

@Test
Expand All @@ -74,7 +73,7 @@ void testPutRunningGivenStory()
runTestContext.setTestContext(new SimpleTestContext());
RunningStory runningStory = new RunningStory();
runTestContext.putRunningStory(runningStory, true);
Assertions.assertEquals(runningStory, runTestContext.getRunningStory());
assertEquals(runningStory, runTestContext.getRunningStory());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,6 @@

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
Expand All @@ -33,7 +32,7 @@ class FluentTrimmedEnumConverterTests
@ParameterizedTest
void testConversion(String valueToConvert)
{
Assertions.assertEquals(ComparisonRule.EQUAL_TO,
assertEquals(ComparisonRule.EQUAL_TO,
fluentTrimmedEnumConverter.convertValue(valueToConvert, ComparisonRule.class));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,7 +46,7 @@ void testHasProperty()
}

@Test
void toTagsTest()
void shouldConvertMetaToTags()
{
String propertyName = "name2";
List<String> list = List.of("name1=value1", propertyName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,6 +34,7 @@
import java.util.List;
import java.util.Properties;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

Expand Down Expand Up @@ -73,7 +74,7 @@ class StoryTests
SCENARIO_TITLE, new org.jbehave.core.model.Meta(List.of(META_KEY + StringUtils.SPACE + META_VALUE)));

@Test
void shouldDeserializeStoryWithoutExamples() throws Exception
void shouldDeserializeStoryWithoutExamples() throws IOException
{
performTest((reporter, out) ->
{
Expand Down Expand Up @@ -102,7 +103,7 @@ void shouldDeserializeStoryWithoutExamples() throws Exception
}

@Test
void shouldDeserializeStoryExamples() throws Exception
void shouldDeserializeStoryExamples() throws IOException
{
performTest((reporter, out) ->
{
Expand Down Expand Up @@ -233,8 +234,9 @@ private void verifyParameters(Parameters parameters)
assertEquals(List.of(List.of(TABLE_VALUE + 1), List.of(TABLE_VALUE + 2)), parameters.getValues());
}

private static void performTest(FailableBiConsumer<StoryReporter, ByteArrayOutputStream, Exception> testables)
throws Exception
private static void performTest(
FailableBiConsumer<StoryReporter, ByteArrayOutputStream, JsonProcessingException> testables)
throws IOException
{
try (ByteArrayOutputStream out = new ByteArrayOutputStream();
PrintStream stream = new PrintStream(out, false, StandardCharsets.UTF_8))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class DeprecatedCompositeStepsReporterTests
"The step: \"%s\" is deprecated and will be removed in VIVIDUS %s. Use step: \"%s\"",
DEPRECATED_STEP_STRING, REMOVE_VERSION, ACTUAL_STEP_STRING);

@Spy private TestContext testContext = new SimpleTestContext();
@Spy private final TestContext testContext = new SimpleTestContext();
@Mock private LoggingStoryReporter nextReporter;
@Mock private DeprecatedStepNotificationFactory deprecatedStepNotificationFactory;
@InjectMocks private DeprecatedCompositeStepsReporter deprecatedCompositeStepsReporter;
Expand All @@ -68,7 +68,7 @@ void shouldResolveCommentInDeprecatedCompositeStep()
runBeforeStep();
assertEquals(DEPRECATION_INFO_RESOLVED, testContext.get(DEPRECATED_STEP_NOTIFICATION_KEY));
verify(nextReporter).beforeStep(argThat(s -> s.getExecutionType() == StepExecutionType.COMMENT
&& s.getStepAsString().equals(DEPRECATION_INFO_RESOLVED)));
&& DEPRECATION_INFO_RESOLVED.equals(s.getStepAsString())));
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void testGetFileResourcesWithDisabledResourceLoaderConfiguration() throws IOExce
var propertyParser = mock(IPropertyParser.class);
testResourceLoader = new TestResourceLoader(propertyParser, resourcePatternResolver, false);
var resource = mock(Resource.class);
Resource[] expectedResources = new Resource[] { resource };
Resource[] expectedResources = { resource };
when(resourcePatternResolver.getResources(TABLE_PATH + TABLE_NAME)).thenReturn(expectedResources);

var actualResources = testResourceLoader.getResources(TABLE_PATH, TABLE_NAME);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 the original author or authors.
* Copyright 2019-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,6 @@

class ComparisonRuleTests
{
private static final String INCORRECT_SIGN = "incorrectSign";
private static final int VARIABLE = 42;

static Stream<Arguments> getComparisonRule()
Expand Down

0 comments on commit 13a0174

Please sign in to comment.