*/
package org.onap.holmes.rulemgt.dcae;
-import static org.easymock.EasyMock.anyObject;
-import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;
import static org.powermock.api.mockito.PowerMockito.when;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import javax.ws.rs.ProcessingException;
import org.junit.Before;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.powermock.modules.junit4.PowerMockRunner;
import org.powermock.reflect.Whitebox;
-@PrepareForTest({DcaeConfigurationPolling.class, MicroServiceConfig.class, ObjectMapper.class})
+@PrepareForTest({DcaeConfigurationPolling.class, MicroServiceConfig.class})
@RunWith(PowerMockRunner.class)
public class DcaeConfigurationPollingTest {
public void testDaceConfigurationPolling_getDcaeConfigurations_exception() throws Exception {
PowerMock.resetAll();
thrown.expect(CorrelationException.class);
- thrown.expectMessage("host");
+ thrown.expectMessage("syntax error, pos 1");
PowerMockito.mockStatic(MicroServiceConfig.class);
- when(MicroServiceConfig.getServiceAddrInfoFromCBS("holmes-rule-mgmt"))
+ when(MicroServiceConfig.getServiceConfigInfoFromCBS("holmes-rule-mgmt"))
.thenReturn("host");
PowerMock.createMock(DcaeConfigurationParser.class);
PowerMock.expectPrivate(DcaeConfigurationParser.class, "parse", "host")
PowerMock.resetAll();
thrown.expect(CorrelationException.class);
PowerMockito.mockStatic(MicroServiceConfig.class);
- when(MicroServiceConfig.getServiceAddrInfoFromCBS("holmes-rule-mgmt"))
+ when(MicroServiceConfig.getServiceConfigInfoFromCBS("holmes-rule-mgmt"))
.thenReturn("host");
PowerMock.createMock(DcaeConfigurationParser.class);
PowerMock.expectPrivate(DcaeConfigurationParser.class, "parse", "host")
public void testDaceConfigurationPolling_addAllCorrelationRules_connection_exception()
throws Exception {
PowerMock.resetAll();
- thrown.expect(ProcessingException.class);
+ thrown.expect(CorrelationException.class);
DcaeConfigurations dcaeConfigurations = new DcaeConfigurations();
Rule rule = new Rule("test", "test", "tset",1);
dcaeConfigurations.getDefaultRules().add(rule);