Mockito.when(mockPlatform.getPolicyManager()).thenReturn(mockPolicyManager);
Mockito.when(mockPlatform.getComponentRegistry()).thenReturn(mockComponentRegistry);
Mockito.when(mockPlatform.getWindowManager()).thenReturn(mockWindowManager);
ExecutionResult mockResult = new ExecutionResult(new PolicyContext(), true, "");
Mockito.when(mockpoPolicyManager.execute(Mockito.anyString(), Mockito.any(PolicyContext.class))).thenReturn(mockResult);
Mockito.when(mockWindowManager.<Object>showInputDialog(
Mockito.anyString(), Mockito.anyString(), Mockito.<Object[]>any(), Mockito.any(), Mockito.anyMap()))
.thenAnswer(new Answer<Object>() {
@Override
public Object answer(InvocationOnMock invocation) throws Throwable {
return ((Object[])invocation.getArguments()[2])[0];