APISonar


redis.clients.jedis.Jedis.time

> redis > clients > jedis > Jedis > time
redis APIs clients APIs jedis APIs Jedis APIs time APIs

Example 1
@Mock Jedis con1Mock;

	public void timeShouldBeExecutedOnArbitraryNode() {

		List<String> values = Arrays.asList("1449655759", "92217");
		when(con1Mock.time()).thenReturn(values);
		when(con2Mock.time()).thenReturn(values);
		when(con3Mock.time()).thenReturn(values);

		connection.time();

		verifyInvocationsAcross("time", times(1), con1Mock, con2Mock, con3Mock);
	}
Example 2
@Mock Jedis con2Mock;

	public void timeShouldBeExecutedOnSingleNode() {

		when(con2Mock.time()).thenReturn(Arrays.asList("1449655759", "92217"));

		connection.time(CLUSTER_NODE_2);

		verify(con2Mock, times(1)).time();
		verify(con2Mock, atLeast(1)).close();
		verify(con1Mock, atMost(1)).clusterNodes();
		verify(con1Mock, atMost(1)).close();

	}