Run Jmock-library automation tests on LambdaTest cloud grid
Perform automation testing on 3000+ real desktop and mobile devices online.
package com.wixpress.guineapig.services;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.wixpress.guineapig.dao.MetaDataDao;
import com.wixpress.guineapig.dto.SpecExposureIdViewDto;
import com.wixpress.guineapig.dto.UserAgentRegex;
import com.wixpress.guineapig.entities.ui.FilterOption;
import com.wixpress.guineapig.entities.ui.UiSpecForScope;
import com.wixpress.guineapig.spi.*;
import com.wixpress.guineapig.util.MockHardCodedScopesProvider;
import com.wixpress.guineapig.util.MockHardCodedScopesProvider$;
import com.wixpress.petri.experiments.domain.ExperimentSpec;
import com.wixpress.petri.experiments.domain.ScopeDefinition;
import com.wixpress.petri.petri.FullPetriClient;
import org.jmock.AbstractExpectations;
import org.jmock.Expectations;
import org.jmock.integration.junit4.JUnitRuleMockery;
import org.joda.time.DateTime;
import org.junit.Rule;
import org.junit.Test;
import scala.Some;
import scala.collection.JavaConversions;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import static com.wixpress.petri.petri.SpecDefinition.ExperimentSpecBuilder.aNewlyGeneratedExperimentSpec;
import static java.util.Arrays.asList;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.*;
public class MetaDataServiceTest {
@Rule
public JUnitRuleMockery context = new JUnitRuleMockery();
MetaDataDao metaDataDao = context.mock(MetaDataDao.class);
SpecExposureIdRetriever specExposureIdDao = context.mock(SpecExposureIdRetriever.class);
FullPetriClient fullPetriClient = context.mock(FullPetriClient.class);
Set<String> languagesSet = ImmutableSet.of("en", "fr", "de", "es", "pt");
SupportedLanguagesProvider supportedSupportedLanguagesProvider = new MockSupportedSupportedLanguagesProvider(languagesSet);
GlobalGroupsManagementService globalGroupsManagementService = context.mock(GlobalGroupsManagementService.class);
HardCodedScopesProvider hardCodedScopesProvider = new MockHardCodedScopesProvider();
MetaDataService metaDataService = new MetaDataService(
metaDataDao, fullPetriClient, hardCodedScopesProvider, specExposureIdDao, supportedSupportedLanguagesProvider, globalGroupsManagementService
);
private final String EDITOR_SCOPE = "editor";
ScopeDefinition editorScope = new ScopeDefinition(EDITOR_SCOPE, true);
private final String VIEWER_SCOPE = "viewer";
ScopeDefinition viewerScope = new ScopeDefinition(VIEWER_SCOPE, false);
private final ExperimentSpec viewerEditorSpec = aNewlyGeneratedExperimentSpec("f.q.n.Class1").
withTestGroups(asList("1", "2")).
withScopes(editorScope, viewerScope).build();
@Test
public void geoListContainsAllCountries() {
//ui supply code list examplw : ["IL","FR"]
//ui expects list of geo objects [{id:"IL",text:"Israel"},{id:"FR",text:"France"}]
List<FilterOption> fullList = metaDataService.getGeoList();
assertEquals(fullList.size(), Locale.getISOCountries().length + MetaDataService.COUNTRIES_GROUPS().size());
assertThat(fullList.get(0), is(MetaDataService.COUNTRIES_GROUPS().get(0)));
}
@Test
public void userAgentRegexListReadsValuesFromDao() {
final UserAgentRegex userAgentRegex = new UserAgentRegex("*test", "This is a test");
context.checking(new Expectations() {{
allowing(metaDataDao).get(UserAgentRegex.class);
will(AbstractExpectations.returnValue(ImmutableList.of(userAgentRegex)));
}});
List<FilterOption> fullList = metaDataService.getUserAgentRegexList();
assertEquals(fullList.get(0).id(), userAgentRegex.regex());
assertEquals(fullList.get(0).text(), userAgentRegex.description());
assertThat(fullList.size(), is(1));
}
@Test
public void userGroupsListReadFromGlobalGroupsManagementService() {
ImmutableList<String> userGroupsList = ImmutableList.of("group1");
context.checking(new Expectations() {{
allowing(globalGroupsManagementService).allGlobalGroups();
will(AbstractExpectations.returnValue(JavaConversions.asScalaBuffer(userGroupsList)));
}});
assertEquals(metaDataService.getUserGroupsList().get(0).id(), userGroupsList.get(0));
}
@Test
public void userGroupsListReturnsEmptyListWhenReadFromGlobalGroupsManagementServiceFails() {
context.checking(new Expectations() {{
allowing(globalGroupsManagementService).allGlobalGroups();
will(AbstractExpectations.throwException(new NullPointerException()));
}});
assertThat(metaDataService.getUserGroupsList().size(), is(0));
}
@Test
public void languagesListContainsAllWixLanguages() {
List<FilterOption> fullList = metaDataService.getLangList();
assertEquals(fullList.size(), languagesSet.size());
}
@Test
public void specWithMultipleScopesIsAddedCorrectly() {
context.checking(new Expectations() {{
allowing(specExposureIdDao).getAll();
will(AbstractExpectations.returnValue(Collections.EMPTY_LIST));
}});
ScopeDefinition newRegisteredScope = new ScopeDefinition("new-scope", true);
ExperimentSpec multipleScopeSpec = aNewlyGeneratedExperimentSpec("f.q.n.Class1").
withTestGroups(asList("1", "2")).
withScopes(editorScope, newRegisteredScope).build();
scala.collection.immutable.Map<String, scala.collection.immutable.List<UiSpecForScope>> map =
metaDataService.createScopeToSpecMap(asList(multipleScopeSpec));
assertThat(map.contains(EDITOR_SCOPE + ",new-scope"), is(true));
}
@Test
public void editorScopeIsAddedWhenKeyCaseChanged() {
context.checking(new Expectations() {{
allowing(specExposureIdDao).getAll();
will(AbstractExpectations.returnValue(Collections.EMPTY_LIST));
}});
ExperimentSpec viewerEditorSpec = aNewlyGeneratedExperimentSpec("SPEC_KEY").
withTestGroups(asList("1", "2")).
withScopes(editorScope, viewerScope).build();
scala.collection.immutable.Map<String, scala.collection.immutable.List<UiSpecForScope>> map =
metaDataService.createScopeToSpecMap(asList(viewerEditorSpec));
assertThat(map.get(EDITOR_SCOPE).get().head().getKey(), is(viewerEditorSpec.getKey()));
}
@Test
public void scopesMapAddsHardcodedScope() {
context.checking(new Expectations() {{
allowing(fullPetriClient).fetchSpecs();
will(AbstractExpectations.returnValue(ImmutableList.of(viewerEditorSpec)));
allowing(specExposureIdDao).getAll();
will(AbstractExpectations.returnValue(Collections.EMPTY_LIST));
allowing(fullPetriClient).fetchAllExperimentsGroupedByOriginalId();
will(AbstractExpectations.returnValue(Collections.EMPTY_LIST));
}});
java.util.Map<String, List<UiSpecForScope>> map = metaDataService.createScopeToSpecMap();
assertThat(map.size(), is(4));
assertTrue(map.containsKey(MockHardCodedScopesProvider$.MODULE$.HARD_CODED_SPEC_FOR_NON_REG()));
}
@Test
public void scopeMapExposureId() {
final ExperimentSpec specWithExposure = aNewlyGeneratedExperimentSpec("f.q.n.Class1")
.withScopes(editorScope)
.build();
final ExperimentSpec specWithoutExposure = aNewlyGeneratedExperimentSpec("f.q.n.Class2")
.withScopes(viewerScope)
.build();
final SpecExposureIdViewDto specExposure = new SpecExposureIdViewDto(
"f.q.n.Class1", new Some<>("GUID"), new DateTime(), new DateTime()
);
context.checking(new Expectations() {{
allowing(fullPetriClient).fetchSpecs();
will(AbstractExpectations.returnValue(asList(specWithExposure, specWithoutExposure)));
allowing(specExposureIdDao).getAll();
will(AbstractExpectations.returnValue(asList(specExposure)));
allowing(fullPetriClient).fetchAllExperimentsGroupedByOriginalId();
will(AbstractExpectations.returnValue(Collections.EMPTY_LIST));
}});
java.util.Map<String, List<UiSpecForScope>> map = metaDataService.createScopeToSpecMap();
assertThat(map.get(editorScope.getName()).get(0).getExposureId(), is("GUID"));
assertNull(map.get(viewerScope.getName()).get(0).getExposureId());
}
@Test
public void checkGetSpecExposureMapFromDB() {
context.checking(new Expectations() {{
allowing(specExposureIdDao).getAll();
will(AbstractExpectations.returnValue(asList()));
}});
metaDataService.getSpecExposureMapFromDB();
}
}
package com.wixpress.guineapig.services;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.natpryce.makeiteasy.MakeItEasy;
import com.natpryce.makeiteasy.Maker;
import com.wixpress.guineapig.dsl.ExperimentBuilders;
import com.wixpress.guineapig.entities.ui.ExperimentConverter;
import com.wixpress.guineapig.entities.ui.ExperimentReport;
import com.wixpress.guineapig.entities.ui.UiExperiment;
import com.wixpress.guineapig.spi.HardCodedScopesProvider;
import com.wixpress.guineapig.util.MockHardCodedScopesProvider;
import com.wixpress.guineapig.util.ReportMatchers;
import com.wixpress.petri.experiments.domain.*;
import com.wixpress.petri.laboratory.dsl.ExperimentMakers;
import com.wixpress.petri.petri.Clock;
import com.wixpress.petri.petri.ConductExperimentSummary;
import com.wixpress.petri.petri.FullPetriClient;
import com.wixpress.petri.petri.SpecDefinition;
import org.hamcrest.CoreMatchers;
import org.jmock.AbstractExpectations;
import org.jmock.Expectations;
import org.jmock.integration.junit4.JUnitRuleMockery;
import org.joda.time.DateTime;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import javax.annotation.Nullable;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static com.wixpress.guineapig.util.Matchers.isForAction;
import static com.wixpress.petri.experiments.domain.ExperimentSnapshotBuilder.anExperimentSnapshot;
import static com.wixpress.petri.laboratory.dsl.TestGroupMakers.TEST_GROUPS_WITH_SECOND_ALWAYS_WINNING;
import static java.util.Arrays.asList;
import static org.hamcrest.Matchers.empty;
public class ExperimentMgmtServiceTest {
@Rule
public JUnitRuleMockery context = new JUnitRuleMockery();
private final FullPetriClient fullPetriClient = context.mock(FullPetriClient.class);
private final Clock clock = context.mock(Clock.class);
private final EventPublisher experimentEventPublisher = context.mock(EventPublisher.class);
private final SpecService specService = context.mock(SpecService.class);
private final HardCodedScopesProvider hardCodedScopesProvider = new MockHardCodedScopesProvider();
private final ExperimentMgmtService ems = new ExperimentMgmtService(clock, experimentEventPublisher, fullPetriClient, hardCodedScopesProvider);
private final String someKey = "someKey";
private final DateTime now = new DateTime();
private String userName = "";
private Trigger trigger = new Trigger("", userName);
@Before
public void setup() {
assumingTimeSourceReturnsNow();
}
@Test
public void returnsEmptyListWhenPetriClientHasNoExperiments() throws Exception {
assumingPetriClientContains(new ArrayList<>());
Assert.assertThat(ems.getAllExperiments(), CoreMatchers.is(empty()));
}
@Test
public void convertsExperimentsIntoUIExperiments() throws Exception {
Experiment experiment = MakeItEasy.an(ExperimentMakers.Experiment, MakeItEasy.with(ExperimentMakers.id, 1), MakeItEasy.with(ExperimentMakers.key, "spec1")).make();
assumingPetriClientContains(asList(experiment));
Assert.assertThat(ems.getAllExperiments(), CoreMatchers.is(asList(experiment)));
}
@Test
public void returnsCorrectExperimentById() throws Exception {
Experiment experiment1 = MakeItEasy.an(ExperimentMakers.Experiment, MakeItEasy.with(ExperimentMakers.id, 1), MakeItEasy.with(ExperimentMakers.key, "spec1")).make();
Experiment experiment2 = MakeItEasy.an(ExperimentMakers.Experiment, MakeItEasy.with(ExperimentMakers.id, 2), MakeItEasy.with(ExperimentMakers.key, "spec2")).make();
assumingPetriClientContains(asList(experiment1, experiment2));
Assert.assertThat(ems.getExperimentById(2), CoreMatchers.is(experiment2));
}
@Test
public void returnsCorrectExperimentsReportById() throws Exception {
ConductExperimentSummary summary = new ConductExperimentSummary("localhost", 2, "true", 1L, 1L, new DateTime());
assumingPetriClientContains(ImmutableList.of(summary));
ExperimentReport experimentReport = ems.getExperimentReport(summary.experimentId());
Assert.assertThat(experimentReport, ReportMatchers.hasOneCountForValue("true"));
}
@Test
public void returnsDealerNonEditableExperimentById() throws Exception {
Experiment experimentOnDealerScope = ExperimentBuilders.createActiveOnNonEditableScope().but(
MakeItEasy.with(ExperimentMakers.id, 1),
MakeItEasy.with(ExperimentMakers.key, "anyKey"),
MakeItEasy.with(ExperimentMakers.fromSpec, false),
MakeItEasy.with(ExperimentMakers.scope, NOT_EDITABLE_SCOPE))
.make();
assumingPetriClientContains(asList(experimentOnDealerScope));
UiExperiment uiExperiment = convertToUiExperiment(ems.getExperimentById(1));
Assert.assertThat(uiExperiment.isEditable(), CoreMatchers.is(false));
}
@Test
public void terminateExperiment() {
final Experiment futureExperiment = ExperimentBuilders.createFuture().but(
MakeItEasy.with(ExperimentMakers.id, 1))
.make();
Assert.assertThat(terminateExperimentWithSpecActive(futureExperiment, true), CoreMatchers.is(true));
}
@Test
public void terminateNonOriginalExperimentTerminatesPausedOriginalToo() throws IOException, ClassNotFoundException {
final Maker<Experiment> experiment = ExperimentBuilders.createActiveOnNonEditableScope().but(MakeItEasy.with(ExperimentMakers.id, 1), MakeItEasy.with(ExperimentMakers.originalId, 1),
MakeItEasy.with(ExperimentMakers.paused, true));
final Experiment updatedExperiment = experiment.but(MakeItEasy.with(ExperimentMakers.description, "blah")).make();
context.checking(new Expectations() {{
allowing(fullPetriClient).fetchExperimentById(updatedExperiment.getId());
will(AbstractExpectations.returnValue(updatedExperiment));
allowing(fullPetriClient).fetchAllExperiments();
will(AbstractExpectations.returnValue(asList(updatedExperiment, experiment.make())));
}});
context.checking(new Expectations() {{
allowing(fullPetriClient).updateExperiment(with(updatedExperiment.terminateAsOf(clock.getCurrentDateTime(), trigger)));
will(AbstractExpectations.returnValue(updatedExperiment));
oneOf(fullPetriClient).updateExperiment(with(experiment.make().terminateAsOf(clock.getCurrentDateTime(), trigger)));
will(AbstractExpectations.returnValue(experiment.make()));
allowing(specService).isSpecActive("", ImmutableList.of());
will(AbstractExpectations.returnValue(true));
oneOf(experimentEventPublisher).publish(with(isForAction(ExperimentEvent.TERMINATED)));
}});
ems.terminateExperiment(updatedExperiment.getId(), "", userName);
}
@Test(expected = IllegalArgumentException.class)
public void recognizesInvalidFiltersForScope() throws IOException {
final ScopeDefinition someScope = ScopeDefinition.aScopeDefinitionForAllUserTypes("someScope");
final SpecDefinition.ExperimentSpecBuilder someSpec = SpecDefinition.ExperimentSpecBuilder.
aNewlyGeneratedExperimentSpec(someKey).withScopes(someScope);
final ExperimentSnapshot experimentSnapshot = anExperimentSnapshot().
withScopes(ImmutableList.of(someScope.getName())).
withKey(someKey).
withOnlyForLoggedInUsers(false).
withGroups(TEST_GROUPS_WITH_SECOND_ALWAYS_WINNING).
withFeatureToggle(false).
withStartDate(now).
withEndDate(now.plusMinutes(5)).
withFilters(asList(new WixEmployeesFilter())).
build();
context.checking(new Expectations() {{
allowing(fullPetriClient).fetchSpecs();
will(AbstractExpectations.returnValue(asList(someSpec.build())));
}});
ems.newExperiment(experimentSnapshot);
}
private boolean terminateExperimentWithSpecActive(final Experiment futureExperiment, final boolean isSpecActive) {
context.checking(new Expectations() {{
allowing(fullPetriClient).fetchAllExperiments();
will(AbstractExpectations.returnValue(asList(futureExperiment)));
allowing(fullPetriClient).fetchExperimentById(futureExperiment.getId());
will(AbstractExpectations.returnValue(futureExperiment));
}});
assumingPetriClientContains(asList(futureExperiment));
context.checking(new Expectations() {{
allowing(fullPetriClient).updateExperiment(with(futureExperiment.terminateAsOf(
clock.getCurrentDateTime(), new Trigger("terminate experiment", userName))));
will(AbstractExpectations.returnValue(futureExperiment));
oneOf(experimentEventPublisher).publish(with(isForAction(ExperimentEvent.TERMINATED)));
allowing(specService).isSpecActive(futureExperiment.getKey(), ImmutableList.of());
will(AbstractExpectations.returnValue(isSpecActive));
}});
return ems.terminateExperiment(futureExperiment.getId(), "terminate experiment", userName);
}
private void assumingTimeSourceReturnsNow() {
context.checking(new Expectations() {{
allowing(clock).getCurrentDateTime();
will(AbstractExpectations.returnValue(now));
}});
}
private void assumingPetriClientContains(final List<Experiment> contents) {
context.checking(new Expectations() {{
allowing(fullPetriClient).fetchAllExperimentsGroupedByOriginalId();
will(AbstractExpectations.returnValue(contents));
}});
}
private void assumingPetriClientContains(final ImmutableList<ConductExperimentSummary> reports) {
context.checking(new Expectations() {{
allowing(fullPetriClient).getExperimentReport(2);
will(AbstractExpectations.returnValue(reports));
}});
}
private UiExperiment convertToUiExperiment(Experiment experiment) throws JsonProcessingException, ClassNotFoundException {
ExperimentConverter converter = new ExperimentConverter(new IsEditablePredicate(), new NoOpFilterAdapterExtender());
return converter.convert(experiment);
}
public static final String NOT_EDITABLE_SCOPE = "NOT_EDITABLE_SCOPE";
public class IsEditablePredicate implements Predicate<Experiment> {
@Override
public boolean apply(@Nullable Experiment experiment) {
return !NOT_EDITABLE_SCOPE.equals(experiment.getScope());
}
}
}
/*
* Copyright (C) 2019 CLARIN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package eu.clarin.cmdi.vlo.importer.linkcheck;
import com.google.common.collect.ImmutableMap;
import eu.clarin.cmdi.rasa.DAO.CheckedLink;
import eu.clarin.cmdi.rasa.filters.CheckedLinkFilter;
import eu.clarin.cmdi.rasa.linkResources.CheckedLinkResource;
import eu.clarin.cmdi.vlo.importer.linkcheck.RasaResourceAvailabilityStatusChecker.RasaResourceAvailabilityStatusCheckerConfiguration;
import java.io.IOException;
import java.io.Writer;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.time.Duration;
import java.time.Instant;
import java.util.AbstractMap;
import java.util.Map;
import java.util.stream.Stream;
import static org.jmock.AbstractExpectations.any;
import static org.jmock.AbstractExpectations.returnValue;
import org.jmock.Expectations;
import org.jmock.Mockery;
import org.jmock.integration.junit4.JUnit4Mockery;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
/**
* @author Twan Goosen <twan@clarin.eu>
*/
public class RasaResourceAvailabilityStatusCheckerTest {
private final Mockery context = new JUnit4Mockery();
private CheckedLinkResource checkedLinkResource;
private RasaResourceAvailabilityStatusChecker instance;
private CheckedLinkFilter checkedLinkFilter;
private final ImmutableMap<String, CheckedLink> checkedLinksMap = ImmutableMap.<String, CheckedLink>builder()
.put(createResponseMapEntry("http://uri1", 200))
.put(createResponseMapEntry("http://uri2", 404))
.build();
@Before
public void setUp() throws SQLException {
checkedLinkResource = context.mock(CheckedLinkResource.class);
checkedLinkFilter = context.mock(CheckedLinkFilter.class);
instance = new RasaResourceAvailabilityStatusChecker(checkedLinkResource,
new RasaResourceAvailabilityStatusCheckerConfiguration(Duration.ofDays(10))) {
@Override
public void writeStatusSummary(Writer writer) throws IOException {
writer.write("Status - test " + getClass());
}
};
}
/**
* Test of getLinkStatusForRefs method, of class
* RasaResourceAvailabilityStatusChecker.
*/
@Test
public void testGetLinkStatusForRefs() throws Exception {
context.checking(new Expectations() {
{
atLeast(1).of(checkedLinkResource).getCheckedLinkFilter();
will(returnValue(checkedLinkFilter));
atLeast(1).of(checkedLinkResource).getMap(with(any(CheckedLinkFilter.class)));
will(returnValue(checkedLinksMap));
oneOf(checkedLinkFilter).setUrlIn(with(any(String[].class)));
oneOf(checkedLinkFilter).setCheckedBetween(with(any(Timestamp.class)), with(any(Timestamp.class)));
}
});
System.out.println("getLinkStatusForRefs");
Stream<String> hrefs = Stream.of("http://uri3", "http://uri2", "http://uri1");
Map<String, CheckedLink> result = instance.getLinkStatusForRefs(hrefs);
assertEquals(2, result.size());
assertNotNull(result.get("http://uri1"));
assertEquals("http://uri1", result.get("http://uri1").getUrl());
assertNotNull(result.get("http://uri1").getStatus());
assertEquals(200, result.get("http://uri1").getStatus().intValue());
assertNotNull(result.get("http://uri2"));
assertEquals("http://uri2", result.get("http://uri2").getUrl());
assertNotNull(result.get("http://uri2").getStatus());
assertEquals(404, result.get("http://uri2").getStatus().intValue());
}
@Test
public void testConstructConfig() {
final RasaResourceAvailabilityStatusCheckerConfiguration config
= new RasaResourceAvailabilityStatusCheckerConfiguration(Duration.ofDays(99));
Timestamp ageLimitLowerBound = config.getAgeLimitLowerBound();
Timestamp ageLimitUpperBound = config.getAgeLimitUpperBound();
assertTrue(ageLimitLowerBound.before(ageLimitUpperBound));
assertTrue(ageLimitLowerBound.before(Timestamp.from(Instant.now().minus(Duration.ofDays(98)))));
assertTrue(ageLimitLowerBound.after(Timestamp.from(Instant.now().minus(Duration.ofDays(100)))));
assertTrue(ageLimitUpperBound.before(Timestamp.from(Instant.now().plus(Duration.ofMinutes(1)))));
}
@Test(expected = IllegalArgumentException.class)
public void testConstructConfigIllegalAge1() {
final RasaResourceAvailabilityStatusCheckerConfiguration config
= new RasaResourceAvailabilityStatusCheckerConfiguration(Duration.ofDays(0));
}
@Test(expected = IllegalArgumentException.class)
public void testConstructConfigIllegalAge2() {
final RasaResourceAvailabilityStatusCheckerConfiguration config
= new RasaResourceAvailabilityStatusCheckerConfiguration(Duration.ofDays(-99));
}
public static AbstractMap.SimpleImmutableEntry<String, CheckedLink> createResponseMapEntry(
String url, int status) {
final CheckedLink checkedLink = new CheckedLink();
checkedLink.setUrl(url);
checkedLink.setStatus(status);
return new AbstractMap.SimpleImmutableEntry<>(url, checkedLink);
}
}
Accelerate Your Automation Test Cycles With LambdaTest
Leverage LambdaTest’s cloud-based platform to execute your automation tests in parallel and trim down your test execution time significantly. Your first 100 automation testing minutes are on us.