Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 636614826
  • Loading branch information
bart-at-google authored and Copybara-Service committed May 23, 2024
1 parent b784573 commit edcc9aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -49,17 +48,17 @@ public void setup() throws IOException {
}

@Test
public void run_callsSearchTasks_withTrackingId() throws Throwable {
public void run_callsGetTaskTrackingInfo_withTrackingId() throws Throwable {
DeliveryConsumerTokenValidationScript script =
new DeliveryConsumerTokenValidationScript(runtime, configuration, commandsFactory);
script.run(TEST_TRACKING_ID);

ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
verify(deliveryServiceCommandsSuccess, times(1)).searchTasks(captor.capture());
verify(deliveryServiceCommandsSuccess).getTaskTrackingInfo(captor.capture());
assertEquals(TEST_TRACKING_ID, captor.getValue());

runtime.wasExpectPermissionDeniedCalled();
verify(deliveryServiceCommandsFails, times(1)).searchTasks(captor.capture());
verify(deliveryServiceCommandsFails).getTaskTrackingInfo(captor.capture());
assertEquals(TEST_TRACKING_ID, captor.getValue());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

Expand Down Expand Up @@ -46,13 +45,13 @@ public void setup() throws IOException {
}

@Test
public void run_callsSearchTasks_withTrackingId() throws Throwable {
public void run_callsGetTaskTrackingInfo_withTrackingId() throws Throwable {
DeliveryFleetReaderTokenValidationScript script =
new DeliveryFleetReaderTokenValidationScript(runtime, configuration, commandsFactory);
script.run(TEST_TRACKING_ID);

ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);
verify(deliveryServiceCommands, times(1)).searchTasks(captor.capture());
verify(deliveryServiceCommands).getTaskTrackingInfo(captor.capture());
assertEquals(TEST_TRACKING_ID, captor.getValue());
}
}

0 comments on commit edcc9aa

Please sign in to comment.