use of org.apache.axis2.clustering.ClusteringFault in project carbon-apimgt by wso2.
the class TenantLoadMessageSenderTest method testSendTenantRegistryLoadMessageFail.
@Test(expected = ClusteringFault.class)
public void testSendTenantRegistryLoadMessageFail() throws ClusteringFault {
ClusteringAgent clusteringAgent = PowerMockito.mock(ClusteringAgent.class);
ClusteringCommand command = PowerMockito.mock(ClusteringCommand.class);
List<ClusteringCommand> commandList = new ArrayList<ClusteringCommand>();
commandList.add(command);
ClusteringFault clusteringFault = PowerMockito.mock(ClusteringFault.class);
PowerMockito.when(clusteringAgent.sendMessage(Matchers.any(TenantLoadMessage.class), Matchers.anyBoolean())).thenThrow(clusteringFault);
tenantLoadMessageSender.sendTenantLoadMessage(clusteringAgent, 1, "a.com", 2);
}
use of org.apache.axis2.clustering.ClusteringFault in project carbon-apimgt by wso2.
the class TenantLoadMessageTest method testExecuteMessage.
@Test
public void testExecuteMessage() throws ClusteringFault {
System.setProperty(APIConstants.ENABLE_TENANT_LOAD_NOTIFICATION, "true");
PowerMockito.mockStatic(APIUtil.class);
PowerMockito.doNothing().when(APIUtil.class);
tenantLoadMessage.execute(new ConfigurationContext(new AxisConfiguration()));
}
use of org.apache.axis2.clustering.ClusteringFault in project carbon-apimgt by wso2.
the class TenantLoadMessageTest method testExecuteMessageWhenDisabled.
@Test
public void testExecuteMessageWhenDisabled() throws ClusteringFault {
System.setProperty(APIConstants.ENABLE_TENANT_LOAD_NOTIFICATION, "false");
tenantLoadMessage.execute(new ConfigurationContext(new AxisConfiguration()));
}
Aggregations