Search in sources :

Example 1 with INCIDENTMboKeySetType

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);
}
Also used : Ticket(org.opennms.api.integration.ticketing.Ticket) CreateSHSIMPINCType(com.ibm.maximo.CreateSHSIMPINCType) INCIDENTMboKeySetType(com.ibm.maximo.INCIDENTMboKeySetType) INCIDENTKeyType(com.ibm.maximo.INCIDENTKeyType) CreateSHSIMPINCResponseType(com.ibm.maximo.CreateSHSIMPINCResponseType) MXStringType(com.ibm.maximo.MXStringType) Test(org.junit.Test)

Aggregations

CreateSHSIMPINCResponseType (com.ibm.maximo.CreateSHSIMPINCResponseType)1 CreateSHSIMPINCType (com.ibm.maximo.CreateSHSIMPINCType)1 INCIDENTKeyType (com.ibm.maximo.INCIDENTKeyType)1 INCIDENTMboKeySetType (com.ibm.maximo.INCIDENTMboKeySetType)1 MXStringType (com.ibm.maximo.MXStringType)1 Test (org.junit.Test)1 Ticket (org.opennms.api.integration.ticketing.Ticket)1