Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
HardNorth committed Dec 25, 2023
1 parent 3a07901 commit a03caa2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
import com.epam.ta.reportportal.ws.model.StartTestItemRQ;
import com.intuit.karate.core.Feature;
import com.intuit.karate.core.FeatureResult;
import com.intuit.karate.resource.Resource;
import io.reactivex.Maybe;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.concurrent.ConcurrentHashMap;

import static org.mockito.Mockito.*;
Expand Down Expand Up @@ -45,11 +48,14 @@ public void shouldFinishLaunch() {

@SuppressWarnings("unchecked")
@Test
public void shouldStartFeature() {
public void shouldStartFeature() throws URISyntaxException {
FeatureResult featureResult = mock(FeatureResult.class);
Feature feature = mock(Feature.class);
Resource resource = mock(Resource.class);
when(featureResult.getFeature()).thenReturn(feature);
when(featureResult.getCallNameForReport()).thenReturn("featureName");
when(feature.getResource()).thenReturn(resource);
when(resource.getUri()).thenReturn(new URI("file:///feature/simple.feature"));
when(launchMock.startTestItem(any(StartTestItemRQ.class))).thenReturn(mock(Maybe.class));
reportPortalPublisher.startFeature(featureResult);
verify(launchMock, times(1)).startTestItem(any(StartTestItemRQ.class));
Expand Down

0 comments on commit a03caa2

Please sign in to comment.