use of org.wso2.carbon.sequences.services.SequenceAdmin in project carbon-apimgt by wso2.
the class SequenceAdminServiceProxyTestCase method testGetSequence.
@Test
public void testGetSequence() {
SequenceAdminServiceProxy sequenceAdminServiceProxy = null;
try {
sequenceAdminServiceProxy = new SequenceAdminServiceProxy("abc.com");
SequenceAdmin sequenceAdmin = Mockito.mock(SequenceAdmin.class);
OMElement omElement = Mockito.mock(OMElement.class);
Mockito.when(sequenceAdmin.getSequenceForTenant("xyz", "abc.com")).thenReturn(omElement);
sequenceAdminServiceProxy.setSequenceAdmin(sequenceAdmin);
} catch (Exception e) {
fail("Exception while testing getSequence");
}
try {
Assert.assertNotNull(sequenceAdminServiceProxy.getSequence("xyz"));
} catch (AxisFault axisFault) {
fail("AxisFault while testing getSequence");
}
}
use of org.wso2.carbon.sequences.services.SequenceAdmin in project carbon-apimgt by wso2.
the class SequenceAdminServiceProxyTestCase method testIsExsistingSequence.
@Test
public void testIsExsistingSequence() {
SequenceAdminServiceProxy sequenceAdminServiceProxy = null;
try {
sequenceAdminServiceProxy = new SequenceAdminServiceProxy("abc.com");
SequenceAdmin sequenceAdmin = Mockito.mock(SequenceAdmin.class);
Mockito.when(sequenceAdmin.isExistingSequence("xyz")).thenReturn(true);
Mockito.when(sequenceAdmin.isExistingSequenceForTenant("xyz", "abc.com")).thenReturn(true);
sequenceAdminServiceProxy.setSequenceAdmin(sequenceAdmin);
} catch (Exception axisFault) {
// test for axisFault
}
try {
Assert.assertTrue(sequenceAdminServiceProxy.isExistingSequence("xyz"));
} catch (AxisFault axisFault) {
fail("AxisFault while testing getSequence");
}
try {
Assert.assertTrue(sequenceAdminServiceProxy.isExistingSequence("xyz"));
} catch (AxisFault axisFault) {
fail("AxisFault while testing getSequenceForTenant");
}
}
use of org.wso2.carbon.sequences.services.SequenceAdmin in project carbon-apimgt by wso2.
the class SequenceAdminServiceProxyTestCase method testDeleteSequence.
@Test
public void testDeleteSequence() {
SequenceAdminServiceProxy sequenceAdminServiceProxy = null;
try {
sequenceAdminServiceProxy = new SequenceAdminServiceProxy("abc.com");
SequenceAdmin sequenceAdmin = Mockito.mock(SequenceAdmin.class);
Mockito.doNothing().when(sequenceAdmin).deleteSequence("xyz");
sequenceAdminServiceProxy.setSequenceAdmin(sequenceAdmin);
} catch (Exception e) {
fail("Exception while testing deleteSequence");
}
try {
sequenceAdminServiceProxy.deleteSequence("xyz");
} catch (AxisFault axisFault) {
fail("AxisFault while testing deleteSequence");
}
try {
sequenceAdminServiceProxy.deleteSequence("xyz");
} catch (AxisFault axisFault) {
fail("AxisFault while testing deleteSequenceForTenant");
}
}
use of org.wso2.carbon.sequences.services.SequenceAdmin in project carbon-apimgt by wso2.
the class SequenceAdminServiceProxyTestCase method testAddSequence.
@Test
public void testAddSequence() {
SequenceAdminServiceProxy sequenceAdminServiceProxy = null;
try {
sequenceAdminServiceProxy = new SequenceAdminServiceProxy("abc.com");
SequenceAdmin sequenceAdmin = Mockito.mock(SequenceAdmin.class);
Mockito.doNothing().when(sequenceAdmin).addSequence(omElement);
sequenceAdminServiceProxy.setSequenceAdmin(sequenceAdmin);
} catch (Exception e) {
fail("Exception while testing addSequence");
}
try {
sequenceAdminServiceProxy.addSequence(omElement);
} catch (AxisFault e) {
fail("AxisFault while testing addSequence");
}
try {
sequenceAdminServiceProxy.addSequence(omElement);
} catch (AxisFault axisFault) {
fail("AxisFault while testing addSequenceForTenant");
}
}
Aggregations