@Test
public void when_staking_tokens_with_funds_against_unregistered_delegate__then_error_is_thrown() {

	RadixAddress address1 = RadixAddress.from("JEbhKQzBn4qJzWJFBbaPioA2GTeaQhuUjYWkanTE6N8VvvPpvM8");
	RadixAddress delegate = RadixAddress.from("23B6fH3FekJeP6e5guhZAk6n9z4fmTo5Tngo3a11Wg5R8gsWTV2x");
	RRI token = RRI.of(address1, "COOKIE");
	StakeTokensAction action = mock(StakeTokensAction.class);
	when(action.getAmount()).thenReturn(new BigDecimal(1));
	when(action.getFrom()).thenReturn(address1);
	when(action.getRRI()).thenReturn(token);
	when(action.getDelegate()).thenReturn(delegate);
	StakeTokensMapper mapper = new StakeTokensMapper();
	Stream<Particle> particles = Stream.of(
		new TransferrableTokensParticle(
			UInt256.MAX_VALUE,
			UInt256.ONE,
			address1,
			0,
			token,
			ImmutableMap.of()
		)
	);
	assertThatThrownBy(() -> mapper.mapToParticleGroups(action, particles))
		.isInstanceOf(StakeNotPossibleException.class);
}