@Test
public void testSendsOrder() {
GoogleAnalytics analytics = mock( GoogleAnalytics.class );
GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker( analytics );
Order order = new Order( "foo", BigDecimal.ONE );
TrackingEvent event = new TrackingEvent( EventType.ORDER, createInfo(), order, 1 );
tracker.handleEvent( event );
ArgumentCaptor<Hit> hitCaptor = ArgumentCaptor.forClass( Hit.class );
ArgumentCaptor<AdvancedConfiguration> configCaptor = ArgumentCaptor.forClass( AdvancedConfiguration.class );
verify( analytics ).track( hitCaptor.capture(), eq( "clientId" ), configCaptor.capture() );
assertAdvancedConfiguration( configCaptor.getValue() );
assertEquals( order.getOrderId(), hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.TRANSACTION_ID ) ) );
assertEquals( Double.valueOf( 1 ), hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.TRANSACTION_REVENUE ) ) );
assertEquals( Double.valueOf( 0 ), hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.TRANSACTION_SHIPPING ) ) );
assertEquals( Double.valueOf( 0 ), hitCaptor.getValue().getParameter().get( getRequestKey( RequestKeys.TRANSACTION_TAX ) ) );
}