當前位置: 首頁>>代碼示例>>Java>>正文


Java ArgumentCaptor.forClass方法代碼示例

本文整理匯總了Java中org.mockito.ArgumentCaptor.forClass方法的典型用法代碼示例。如果您正苦於以下問題:Java ArgumentCaptor.forClass方法的具體用法?Java ArgumentCaptor.forClass怎麽用?Java ArgumentCaptor.forClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.mockito.ArgumentCaptor的用法示例。


在下文中一共展示了ArgumentCaptor.forClass方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: complexTest1

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void complexTest1() throws Exception {
    SmartLog.start(output)
            .level(LogLevel.DEBUG)
            .title("test-%s", "title")
            .format(new SimpleTextFormat("${title} - ${result}, var=${var}, trace: [${trace}] [${time} ms]"))
            .trace("trace1")
            .trace("trace2")
            .trace(WRITE_TIME, "trace3")
            .trace("trace%d", 4)
            .attach("var", "val")
            .result("test-result");

    SmartLog.finish();

    ArgumentCaptor<String> msgCaptor = ArgumentCaptor.forClass(String.class);
    Mockito.verify(logger).debug(msgCaptor.capture());

    Assertions.assertThat(msgCaptor.getValue())
            .matches("test-title - test-result, var=val, trace: \\[trace1; trace2; trace3 \\[\\d+ ms\\]; trace4\\] \\[\\d+ ms\\]");
}
 
開發者ID:ivnik,項目名稱:smartlog,代碼行數:22,代碼來源:SmartLogTest.java

示例2: onClick_Shortened

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void onClick_Shortened() throws Exception {
    // Given
    ShortenedOnClickListener listener = mock(ShortenedOnClickListener.class);

    ArgumentCaptor<View.OnClickListener> listenerCaptor = ArgumentCaptor.forClass(View.OnClickListener.class);

    // When
    BlueTapeDsl
            .onClick(listener)
            .bind(view);

    verify(view).setOnClickListener(listenerCaptor.capture());
    listenerCaptor.getValue().onClick(view);

    // Then
    verify(listener).onClick();
}
 
開發者ID:dmitry-zaitsev,項目名稱:BlueTape,代碼行數:19,代碼來源:BlueTapeDslTest.java

示例3: shouldProvideActionDefinition

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void shouldProvideActionDefinition() {
    @SuppressWarnings({"unchecked", "rawtypes"})
    final Class<Entity<Map<String, Object>>> entityType = (Class) Entity.class;
    final ArgumentCaptor<Entity<Map<String, Object>>> entity = ArgumentCaptor.forClass(entityType);

    final DynamicActionMetadata suggestions = new DynamicActionMetadata.Builder().putProperty("sObjectName",
        Arrays.asList(DynamicActionMetadata.ActionPropertySuggestion.Builder.of("Account", "Account"),
            DynamicActionMetadata.ActionPropertySuggestion.Builder.of("Contact", "Contact")))
        .build();
    when(invocationBuilder.post(entity.capture(), eq(DynamicActionMetadata.class))).thenReturn(suggestions);

    final ConnectorDescriptor definition = handler.enrichWithMetadata(SALESFORCE_CREATE_OR_UPDATE,
        Collections.emptyMap());

    final ConnectorDescriptor enrichedDefinitioin = new ConnectorDescriptor.Builder()
        .createFrom(createOrUpdateSalesforceObjectDescriptor)
        .replaceConfigurationProperty("sObjectName",
            c -> c.addEnum(ConfigurationProperty.PropertyValue.Builder.of("Account", "Account"),
                ConfigurationProperty.PropertyValue.Builder.of("Contact", "Contact")))
        .build();

    assertThat(definition).isEqualTo(enrichedDefinitioin);
}
 
開發者ID:syndesisio,項目名稱:syndesis,代碼行數:25,代碼來源:ConnectionActionHandlerTest.java

示例4: shouldPassMakeRequest_toMessaging

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void shouldPassMakeRequest_toMessaging() throws ExecutionException, InterruptedException {
    final CoapPacket req = newCoapPacket().get().uriPath("/test").build();
    final ArgumentCaptor<Callback> callback = ArgumentCaptor.forClass(Callback.class);

    //when
    final CompletableFuture<CoapPacket> resp = server.makeRequest(req);

    //then
    verify(msg).makeRequest(eq(req), callback.capture(), eq(TransportContext.NULL));
    assertFalse(resp.isDone());

    //verify callback
    callback.getValue().call(newCoapPacket().ack(Code.C400_BAD_REQUEST).build());
    assertTrue(resp.isDone());
    assertEquals(Code.C400_BAD_REQUEST, resp.get().getCode());
}
 
開發者ID:ARMmbed,項目名稱:java-coap,代碼行數:18,代碼來源:CoapServerTest.java

示例5: testSingleKeyValueMissing

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
/**
 * Test compare value on data sets where there are missing data.
 *
 */
@Test
public void testSingleKeyValueMissing()  {
  SelectStatement left = select(field("stringKey"), field("nullableDateCol")).from(tableRef("SingleKeyLeft"));
  SelectStatement right = select(field("stringKey"), field("nullableDateCol")).from(tableRef("SingleKeyMissingRight"));

  CompareCallback callBackMock = mock(CompareCallback.class);
  ArgumentCaptor<ResultSetMismatch> rsMismatchCaptor = ArgumentCaptor.forClass(ResultSetMismatch.class);

  int result = resultSetComparer.compare(new int[]{1}, left, right, connection, callBackMock);

  verify(callBackMock, times(2)).mismatch(rsMismatchCaptor.capture());
  List<ResultSetMismatch> rsMismatches = rsMismatchCaptor.getAllValues();
  assertEquals("Row count should match", rsMismatches.size(), result);

  checkMismatch(rsMismatches.get(0), MISSING_RIGHT, "20140101", ResultSetComparer.RECORD_NOT_PRESENT, 2, "keyA");
  checkMismatch(rsMismatches.get(1), MISSING_LEFT, ResultSetComparer.RECORD_NOT_PRESENT, "20140401", 2, "keyD");
}
 
開發者ID:alfasoftware,項目名稱:morf,代碼行數:22,代碼來源:TestResultSetComparer.java

示例6: testGetStackPhysicalResourceId

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void testGetStackPhysicalResourceId() {
    final StackResource stackResource1 = new StackResource();
    stackResource1.setLogicalResourceId("logical1");
    stackResource1.setPhysicalResourceId("physical1");

    final StackResource stackResource2 = new StackResource();
    stackResource2.setLogicalResourceId("logical2");
    stackResource2.setPhysicalResourceId("physical2");

    final List<StackResource> stackResources = new ArrayList<>();
    stackResources.add(stackResource1);
    stackResources.add(stackResource2);

    final DescribeStackResourcesResult result = mock(DescribeStackResourcesResult.class);
    when(result.getStackResources()).thenReturn(stackResources);

    when(amazonCloudFormationClient.describeStackResources(any(DescribeStackResourcesRequest.class))).thenReturn(result);

    assertThat(awsHelperService.getStackPhysicalResourceId("testStackName", "logical2"), equalTo("physical2"));

    final ArgumentCaptor<DescribeStackResourcesRequest> argumentCaptor = ArgumentCaptor.forClass(DescribeStackResourcesRequest.class);
    verify(amazonCloudFormationClient).describeStackResources(argumentCaptor.capture());
    assertThat(argumentCaptor.getValue().getStackName(), equalTo("testStackName"));
}
 
開發者ID:shinesolutions,項目名稱:aem-orchestrator,代碼行數:26,代碼來源:AwsHelperServiceTest.java

示例7: shouldCreateKubernetesPodWithPodLabels

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void shouldCreateKubernetesPodWithPodLabels() throws Exception {
    ArgumentCaptor<Pod> argumentCaptor = ArgumentCaptor.forClass(Pod.class);
    kubernetesAgentInstances.create(createAgentRequest, settings, mockedPluginRequest);
    verify(pods).create(argumentCaptor.capture());
    Pod elasticAgentPod = argumentCaptor.getValue();

    assertNotNull(elasticAgentPod.getMetadata());

    HashMap<String, String> labels = new HashMap<>();
    labels.put(Constants.CREATED_BY_LABEL_KEY, Constants.PLUGIN_ID);
    labels.put(Constants.JOB_ID_LABEL_KEY, createAgentRequest.jobIdentifier().getJobId().toString());
    labels.put(Constants.KUBERNETES_POD_KIND_LABEL_KEY, Constants.KUBERNETES_POD_KIND_LABEL_VALUE);
    labels.put(Constants.ENVIRONMENT_LABEL_KEY, createAgentRequest.environment());

    assertThat(elasticAgentPod.getMetadata().getLabels(), is(labels));
}
 
開發者ID:gocd,項目名稱:kubernetes-elastic-agents,代碼行數:18,代碼來源:KubernetesAgentInstancesIntegrationTest.java

示例8: successfulExecutionCallsResponseHandler

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void successfulExecutionCallsResponseHandler() throws Exception {
    // Given
    ArgumentCaptor<SdkHttpResponseHandler> sdkHttpResponseHandler = ArgumentCaptor.forClass(SdkHttpResponseHandler.class);

    expectRetrievalFromMocks();
    when(httpClient.prepareRequest(any(), any(), any(), sdkHttpResponseHandler.capture())).thenReturn(httpClientCall);
    when(responseHandler.handle(any(), any())).thenReturn(response); // Response handler call

    // When
    CompletableFuture<SdkResponse> responseFuture = syncClientHandler.execute(clientExecutionParams());
    sdkHttpResponseHandler.getValue().headersReceived(SdkHttpFullResponse.builder().statusCode(200).build());
    sdkHttpResponseHandler.getValue().complete();
    SdkResponse actualResponse = responseFuture.get(1, TimeUnit.SECONDS);

    // Then
    verifyNoMoreInteractions(errorResponseHandler); // No error handler calls
    verify(httpClientCall).run(); // Response handler is invoked
    assertThat(actualResponse).isEqualTo(response); // Response handler result returned
}
 
開發者ID:aws,項目名稱:aws-sdk-java-v2,代碼行數:21,代碼來源:AsyncClientHandlerImplTest.java

示例9: testHostResolveAttempt

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void testHostResolveAttempt() throws Exception {
  TaskAttemptImpl.RequestContainerTransition rct =
      new TaskAttemptImpl.RequestContainerTransition(false);

  EventHandler eventHandler = mock(EventHandler.class);
  String[] hosts = new String[3];
  hosts[0] = "192.168.1.1";
  hosts[1] = "host2";
  hosts[2] = "host3";
  TaskSplitMetaInfo splitInfo =
      new TaskSplitMetaInfo(hosts, 0, 128 * 1024 * 1024l);

  TaskAttemptImpl mockTaskAttempt =
      createMapTaskAttemptImplForTest(eventHandler, splitInfo);
  TaskAttemptImpl spyTa = spy(mockTaskAttempt);
  when(spyTa.resolveHost(hosts[0])).thenReturn("host1");
  spyTa.dataLocalHosts = spyTa.resolveHosts(splitInfo.getLocations());

  TaskAttemptEvent mockTAEvent = mock(TaskAttemptEvent.class);
  rct.transition(spyTa, mockTAEvent);
  verify(spyTa).resolveHost(hosts[0]);
  ArgumentCaptor<Event> arg = ArgumentCaptor.forClass(Event.class);
  verify(eventHandler, times(2)).handle(arg.capture());
  if (!(arg.getAllValues().get(1) instanceof ContainerRequestEvent)) {
    Assert.fail("Second Event not of type ContainerRequestEvent");
  }
  Map<String, Boolean> expected = new HashMap<String, Boolean>();
  expected.put("host1", true);
  expected.put("host2", true);
  expected.put("host3", true);
  ContainerRequestEvent cre =
      (ContainerRequestEvent) arg.getAllValues().get(1);
  String[] requestedHosts = cre.getHosts();
  for (String h : requestedHosts) {
    expected.remove(h);
  }
  assertEquals(0, expected.size());
}
 
開發者ID:naver,項目名稱:hadoop,代碼行數:40,代碼來源:TestTaskAttempt.java

示例10: updateOrganizationIntern_TechProviderToSupplier

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void updateOrganizationIntern_TechProviderToSupplier()
        throws Exception {
    // given
    final String ORG_NAME = "MyOrg";
    final BigDecimal OPERATOR_REVENUE_SHARE = BigDecimal.valueOf(35);
    VOOperatorOrganization org = givenOrganizationWithRoles("deadbeef",
            ORG_NAME, OPERATOR_REVENUE_SHARE, OrganizationRoleType.SUPPLIER);

    final Organization updatedOrg = givenOrgDomainObj("deadbeef", ORG_NAME,
            null, OrganizationRoleType.TECHNOLOGY_PROVIDER);
    addPaymentTypeInvoice(updatedOrg,
            OrganizationReferenceType.PLATFORM_OPERATOR_TO_SUPPLIER,
            OrganizationRoleType.SUPPLIER);

    SupportedCountry sc = new SupportedCountry();
    doReturn(updatedOrg).doReturn(sc).when(ds)
            .getReferenceByBusinessKey(any(Organization.class));
    mockAddOrganizationToRole(updatedOrg);

    // when
    VOOperatorOrganization resultOrg = opSrvBean.updateOrganizationIntern(
            org, null);

    // then
    assertTrue("Supplier role missing", resultOrg.getOrganizationRoles()
            .contains(OrganizationRoleType.SUPPLIER));
    assertEquals("Wrong operator revenue share", OPERATOR_REVENUE_SHARE,
            resultOrg.getOperatorRevenueShare());

    ArgumentCaptor<RevenueShareModel> argRevShareModel = ArgumentCaptor
            .forClass(RevenueShareModel.class);
    verify(ds).persist(argRevShareModel.capture());
    assertEquals("Wrong operator revenue share persisted",
            OPERATOR_REVENUE_SHARE, argRevShareModel.getValue()
                    .getRevenueShare());
    assertSame("Wrong operator price model in updated organization",
            updatedOrg.getOperatorPriceModel(), argRevShareModel.getValue());
}
 
開發者ID:servicecatalog,項目名稱:oscm,代碼行數:40,代碼來源:OperatorServiceBeanRevenueShareTest.java

示例11: testAggregate

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void testAggregate() throws Exception {
    ArgumentCaptor<JSONObject> queueCaptor = ArgumentCaptor.forClass(JSONObject.class);
    for (int i = 0; i < NUM_OF_RUNS; i++) {
        commentAggregator.forwardAggregate("all");
    }
    Mockito.verify(queueService, times(NUM_OF_RUNS)).enqueueComment(queueCaptor.capture());
    List<JSONObject> capturedModels = queueCaptor.getAllValues();

    List<String> fullnames = OuputValidator.checkIncrementalIds(capturedModels);
    Assert.assertTrue( OuputValidator.checkValidFullnames(fullnames)<=0);
}
 
開發者ID:nicolasmanic,項目名稱:JRockets,代碼行數:13,代碼來源:CommentAggregatorIntegrationTest.java

示例12: checkSettings_withSslException_shouldThrowCertificateValidationException

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test(expected = CertificateValidationException.class)
public void checkSettings_withSslException_shouldThrowCertificateValidationException() throws Exception {
    WebDavStore webDavStore = createDefaultWebDavStore();
    ArgumentCaptor<HttpGeneric> requestCaptor = ArgumentCaptor.forClass(HttpGeneric.class);
    when(mockHttpClient.executeOverride(requestCaptor.capture(), any(HttpContext.class)))
            .thenThrow(new SSLException("Test"));

    webDavStore.checkSettings();
}
 
開發者ID:philipwhiuk,項目名稱:q-mail,代碼行數:10,代碼來源:WebDavStoreTest.java

示例13: testFireConnectEvent_noUserInteract

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void testFireConnectEvent_noUserInteract() {
    ArgumentCaptor<PairConnectEvent> argumentCaptor = ArgumentCaptor.forClass(PairConnectEvent.class);
    for (PairConnectEventTypes type : PairConnectEventTypes.values()) {
        instance.fireConnectEvent(type, SOURCE, TARGET, false);
    }
    verifyInteraction(argumentCaptor, false);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:9,代碼來源:ConnectionEventHandlerJUnitTest.java

示例14: createThumbnailPassesParametersToActionService

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
/**
 * This test method ensures that the parameters on thumbnail-create are
 * passed through the RenditionService to the ActionService
 */
@Test
public void createThumbnailPassesParametersToActionService()
{
    // As most of the services are mocked out, the actual values used here
    // don't matter.
    final Map<String, Serializable> parametersUnderTest = new HashMap<String, Serializable>();
    parametersUnderTest.put(ImageRenderingEngine.PARAM_RESIZE_WIDTH, new Integer(42));
    parametersUnderTest.put(ImageRenderingEngine.PARAM_RESIZE_HEIGHT, new Integer(93));
    parametersUnderTest.put(ImageRenderingEngine.PARAM_COMMAND_OPTIONS, "foo");
    parametersUnderTest.put(ImageRenderingEngine.PARAM_MAINTAIN_ASPECT_RATIO, Boolean.TRUE);
    parametersUnderTest.put(ImageRenderingEngine.PARAM_RESIZE_TO_THUMBNAIL, Boolean.FALSE);
    parametersUnderTest.put(ImageRenderingEngine.PARAM_ALLOW_ENLARGEMENT, Boolean.TRUE);
    parametersUnderTest.put(AbstractRenderingEngine.PARAM_TARGET_CONTENT_PROPERTY, ContentModel.PROP_CONTENT);
    parametersUnderTest.put(RenditionService.PARAM_DESTINATION_NODE, dummyNodeRef2);
    parametersUnderTest.put(PagedSourceOptionsSerializer.PARAM_SOURCE_START_PAGE, new Integer(2));
    parametersUnderTest.put(PagedSourceOptionsSerializer.PARAM_SOURCE_END_PAGE, new Integer(2));
    parametersUnderTest.put(TemporalSourceOptionsSerializer.PARAM_SOURCE_TIME_OFFSET, "00:00:00.5");
    

    ImageTransformationOptions imageTransOpts = new ImageTransformationOptions();
    imageTransOpts.setTargetNodeRef(dummyNodeRef2);
    
    imageTransOpts.setTargetContentProperty((QName) parametersUnderTest.get(ImageRenderingEngine.PARAM_TARGET_CONTENT_PROPERTY));
    imageTransOpts.setCommandOptions((String) parametersUnderTest.get(ImageRenderingEngine.PARAM_COMMAND_OPTIONS));

    ImageResizeOptions resizeOptions = new ImageResizeOptions();
    resizeOptions.setHeight((Integer) parametersUnderTest.get(ImageRenderingEngine.PARAM_RESIZE_HEIGHT));
    resizeOptions.setWidth((Integer) parametersUnderTest.get(ImageRenderingEngine.PARAM_RESIZE_WIDTH));
    resizeOptions.setMaintainAspectRatio((Boolean) parametersUnderTest.get(ImageRenderingEngine.PARAM_MAINTAIN_ASPECT_RATIO));
    resizeOptions.setResizeToThumbnail((Boolean) parametersUnderTest.get(ImageRenderingEngine.PARAM_RESIZE_TO_THUMBNAIL));
    resizeOptions.setAllowEnlargement((Boolean) parametersUnderTest.get(ImageRenderingEngine.PARAM_ALLOW_ENLARGEMENT));
    imageTransOpts.setResizeOptions(resizeOptions);
    
    PagedSourceOptions pagedSourceOptions = new PagedSourceOptions();
    pagedSourceOptions.setStartPageNumber((Integer) parametersUnderTest.get(PagedSourceOptionsSerializer.PARAM_SOURCE_START_PAGE));
    pagedSourceOptions.setEndPageNumber((Integer) parametersUnderTest.get(PagedSourceOptionsSerializer.PARAM_SOURCE_END_PAGE));
    imageTransOpts.addSourceOptions(pagedSourceOptions);
    
    TemporalSourceOptions temporalSourceOptions = new TemporalSourceOptions();
    temporalSourceOptions.setOffset((String) parametersUnderTest.get(TemporalSourceOptionsSerializer.PARAM_SOURCE_TIME_OFFSET));
    imageTransOpts.addSourceOptions(temporalSourceOptions);
    
    ThumbnailParentAssociationDetails assocDetails = new ThumbnailParentAssociationDetails(dummyNodeRef3,
                ContentModel.ASSOC_CONTAINS, QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI,
                            "homerSimpson"));
    
    // Now request the creation of the the thumbnail.
    thumbnailService.createThumbnail(dummyNodeRef1, ContentModel.PROP_CONTENT, MimetypeMap.MIMETYPE_IMAGE_JPEG,
                imageTransOpts, "bartSimpson", assocDetails);

    
    ArgumentCaptor<Action> argument = ArgumentCaptor.forClass(Action.class);
    verify(mockActionService).executeAction(argument.capture(), any(NodeRef.class), anyBoolean(), anyBoolean());
    final Action action = argument.getValue();
    final RenditionDefinition renditionDefn = (RenditionDefinition)action;
    Map<String, Serializable> parameters = renditionDefn.getParameterValues();
    
    for (String s : parametersUnderTest.keySet())
    {
        if (parameters.keySet().contains(s) == false || parameters.get(s) == null || parameters.get(s).toString().length() == 0)
        {
            fail("Missing parameter " + s);
        }
        assertEquals("Parameter " + s + " had wrong value.",
                parametersUnderTest.get(s), parameters.get(s));
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:72,代碼來源:ThumbnailServiceImplParameterTest.java

示例15: testAdditionNode

import org.mockito.ArgumentCaptor; //導入方法依賴的package包/類
@Test
public void testAdditionNode() {
  createAnimatedGraphWithAdditionNode(50, 100d, 1000d);

  Callback animationCallback = mock(Callback.class);
  JavaOnlyArray frames = JavaOnlyArray.of(0d, 1d);
  mNativeAnimatedNodesManager.startAnimatingNode(
    1,
    1,
    JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 101d),
    animationCallback);

  mNativeAnimatedNodesManager.startAnimatingNode(
    2,
    2,
    JavaOnlyMap.of("type", "frames", "frames", frames, "toValue", 1010d),
    animationCallback);

  ArgumentCaptor<ReactStylesDiffMap> stylesCaptor =
    ArgumentCaptor.forClass(ReactStylesDiffMap.class);

  reset(mUIImplementationMock);
  mNativeAnimatedNodesManager.runUpdates(nextFrameTime());
  verify(mUIImplementationMock).synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());
  assertThat(stylesCaptor.getValue().getDouble("translateX", Double.NaN)).isEqualTo(1100d);

  reset(mUIImplementationMock);
  mNativeAnimatedNodesManager.runUpdates(nextFrameTime());
  verify(mUIImplementationMock)
    .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());
  assertThat(stylesCaptor.getValue().getDouble("translateX", Double.NaN)).isEqualTo(1100d);

  reset(mUIImplementationMock);
  mNativeAnimatedNodesManager.runUpdates(nextFrameTime());
  verify(mUIImplementationMock)
    .synchronouslyUpdateViewOnUIThread(eq(50), stylesCaptor.capture());
  assertThat(stylesCaptor.getValue().getDouble("translateX", Double.NaN)).isEqualTo(1111d);

  reset(mUIImplementationMock);
  mNativeAnimatedNodesManager.runUpdates(nextFrameTime());
  verifyNoMoreInteractions(mUIImplementationMock);
}
 
開發者ID:qq565999484,項目名稱:RNLearn_Project1,代碼行數:43,代碼來源:NativeAnimatedNodeTraversalTest.java


注:本文中的org.mockito.ArgumentCaptor.forClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。