use of com.ibm.maximo.INCIDENTMboKeySetType in project opennms by OpenNMS.
the class TsrmMockTest method testSaveWithMock.
@Test
public void testSaveWithMock() throws PluginException {
CreateSHSIMPINCType createIncidentType = new CreateSHSIMPINCType();
CreateSHSIMPINCResponseType incidentResponse = new CreateSHSIMPINCResponseType();
INCIDENTMboKeySetType incidentMboKeyType = new INCIDENTMboKeySetType();
INCIDENTKeyType incidentKey = new INCIDENTKeyType();
MXStringType incidentId = new MXStringType();
incidentId.setValue(INCIDENT_ID);
incidentKey.setTICKETID(incidentId);
incidentResponse.setINCIDENTMboKeySet(incidentMboKeyType);
incidentMboKeyType.getINCIDENT().add(incidentKey);
when(port.createSHSIMPINC(argThat(new CreateIncidentArg()))).thenReturn(incidentResponse);
port.createSHSIMPINC(createIncidentType);
Ticket ticket = new Ticket();
m_ticketer.saveOrUpdate(ticket);
verify(port).createSHSIMPINC(createIncidentType);
assertEquals(ticket.getId(), INCIDENT_ID);
}
Aggregations