Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Jan 21, 2025
1 parent 66a0569 commit ef046f7
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ protected List<ParameterResource> getMethodParameters(@Nonnull final FrameworkMe
Object target = getTargetFor(runner, method);
if (target instanceof ArtifactParams) {
//noinspection Guava
com.google.common.base.Optional<Map<String, Object>> params = ((ArtifactParams) target).getParameters();
Optional<Map<String, Object>> params = ((ArtifactParams) target).getParameters();
if (params.isPresent()) {
for (Map.Entry<String, Object> param : params.get().entrySet()) {
ParameterResource parameter = new ParameterResource();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.epam.reportportal.service.tree.TestItemTree;
import com.epam.ta.reportportal.ws.model.FinishTestItemRQ;
import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ;
import com.google.common.collect.Sets;
import org.junit.AfterClass;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -36,6 +35,7 @@
import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;

import static java.util.Optional.ofNullable;
Expand All @@ -51,7 +51,8 @@ public class RetrieveByDescriptionFeatureTest {
public TestRule rule = new TestWatcher() {
@Override
protected void finished(@Nonnull Description description) {
ofNullable(ItemTreeUtils.retrieveLeaf(description,
ofNullable(ItemTreeUtils.retrieveLeaf(
description,
ParallelRunningContext.getCurrent().getItemTree()
)).ifPresent(testItemLeaves::add);
}
Expand All @@ -71,8 +72,9 @@ private static void addSaucelabsAttribute() {
FinishTestItemRQ request = new FinishTestItemRQ();
request.setEndTime(Calendar.getInstance().getTime());
request.setStatus("PASSED");
request.setAttributes(Sets.newHashSet(new ItemAttributesRQ(SLID, SLID_VALUE)));
ItemTreeReporter.finishItem(ReportPortalListener.getReportPortal().getClient(),
request.setAttributes(Collections.singleton(new ItemAttributesRQ(SLID, SLID_VALUE)));
ItemTreeReporter.finishItem(
ReportPortalListener.getReportPortal().getClient(),
request,
ParallelRunningContext.getCurrent().getItemTree().getLaunchId(),
testItemLeaves.get(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.epam.reportportal.junit.features.ignore;

import com.epam.reportportal.annotations.ParameterKey;
import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import org.junit.Ignore;
Expand All @@ -30,6 +29,7 @@

import java.util.Collections;
import java.util.Map;
import java.util.Optional;

@RunWith(Parameterized.class)
public class ParameterizedIgnoredTest implements ArtifactParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.junit.features.parameters;

import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import com.nordstrom.automation.junit.AtomicTest;
Expand All @@ -30,6 +29,7 @@
import org.junit.runner.RunWith;

import java.util.Map;
import java.util.Optional;

@RunWith(JUnitParamsRunner.class)
public class JUnitParamsNullValueTest implements ArtifactParams {
Expand Down Expand Up @@ -66,7 +66,7 @@ public Optional<Map<String, Object>> getParameters() {
String param = (String) params[0];
return Param.mapOf(Param.param("param", param));
} catch (IllegalAccessException | NoSuchFieldException e) {
return Optional.absent();
return Optional.empty();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.junit.features.parameters;

import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import com.nordstrom.automation.junit.AtomicTest;
Expand All @@ -30,6 +29,7 @@
import org.junit.runner.RunWith;

import java.util.Map;
import java.util.Optional;

@RunWith(JUnitParamsRunner.class)
public class JUnitParamsSimpleTest implements ArtifactParams {
Expand Down Expand Up @@ -62,7 +62,7 @@ public Optional<Map<String, Object>> getParameters() {
String param = (String) params[0];
return Param.mapOf(Param.param("param", param));
} catch (IllegalAccessException | NoSuchFieldException e) {
return Optional.absent();
return Optional.empty();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.junit.features.parameters;

import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import com.nordstrom.automation.junit.AtomicTest;
Expand All @@ -30,6 +29,7 @@
import org.junit.runner.RunWith;

import java.util.Map;
import java.util.Optional;

@RunWith(JUnitParamsRunner.class)
public class JUnitParamsTwoParamsTest implements ArtifactParams {
Expand Down Expand Up @@ -61,7 +61,7 @@ public Optional<Map<String, Object>> getParameters() {
Object[] params = LifecycleHooks.getFieldValue(callable, "val$params");
return Param.mapOf(Param.param("param1", params[0]), Param.param("param2", params[1]));
} catch (IllegalAccessException | NoSuchFieldException e) {
return Optional.absent();
return Optional.empty();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.junit.features.parameters;

import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import org.junit.Rule;
Expand All @@ -28,6 +27,7 @@

import java.util.Collections;
import java.util.Map;
import java.util.Optional;

@RunWith(Parameterized.class)
public class StandardParametersNullValueTest implements ArtifactParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.junit.features.parameters;

import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import org.junit.Rule;
Expand All @@ -28,6 +27,7 @@

import java.util.Collections;
import java.util.Map;
import java.util.Optional;

@RunWith(Parameterized.class)
public class StandardParametersSimpleTest implements ArtifactParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.junit.features.parameters;

import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import org.junit.Rule;
Expand All @@ -28,6 +27,7 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

@RunWith(Parameterized.class)
public class StandardParametersTwoParamsTest implements ArtifactParams {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.epam.reportportal.junit.features.retry;

import com.google.common.base.Optional;
import com.nordstrom.automation.junit.ArtifactParams;
import com.nordstrom.automation.junit.AtomIdentity;
import org.junit.Rule;
Expand All @@ -28,6 +27,7 @@

import java.util.Collections;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;

@RunWith(Parameterized.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
package com.epam.reportportal.junit.utils;

import com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.Set;
Expand All @@ -34,7 +34,7 @@
*/
public class SystemAttributesFetcherTest {

private static List<String> expectedKeys = Lists.newArrayList("jvm", "os", "agent", "skippedIssue");
private static final List<String> expectedKeys = Arrays.asList("jvm", "os", "agent", "skippedIssue");

@Test
public void systemAttributesFetchingTest() {
Expand Down

0 comments on commit ef046f7

Please sign in to comment.