Search in sources :

Example 1 with ExecuteCredentialResetResponseType

use of com.evolveum.midpoint.xml.ns._public.common.api_types_3.ExecuteCredentialResetResponseType in project midpoint by Evolveum.

the class TestPrismSerialization method testSerializeExecuteCredentialResetResponseType.

@Test
public void testSerializeExecuteCredentialResetResponseType() throws Exception {
    PrismContext prismContext = getPrismContext();
    SingleLocalizableMessage localizableMessage = new SingleLocalizableMessage("execute.reset.credential.bad.request", null, "Failed to execute reset password. Bad request.");
    LocalizableMessageType localizableMessageBean = LocalizationUtil.createLocalizableMessageType(localizableMessage);
    ExecuteCredentialResetResponseType response = new ExecuteCredentialResetResponseType();
    response.setMessage(localizableMessageBean);
    QName fakeQName = new QName(PrismConstants.NS_TYPES, "object");
    prismContext.adopt(response);
    String xml = prismContext.xmlSerializer().serializeAnyData(response, fakeQName);
    System.out.println(xml);
}
Also used : PrismTestUtil.getPrismContext(com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext) QName(javax.xml.namespace.QName) ExecuteCredentialResetResponseType(com.evolveum.midpoint.xml.ns._public.common.api_types_3.ExecuteCredentialResetResponseType) SingleLocalizableMessage(com.evolveum.midpoint.util.SingleLocalizableMessage) Test(org.testng.annotations.Test)

Aggregations

PrismTestUtil.getPrismContext (com.evolveum.midpoint.prism.util.PrismTestUtil.getPrismContext)1 SingleLocalizableMessage (com.evolveum.midpoint.util.SingleLocalizableMessage)1 ExecuteCredentialResetResponseType (com.evolveum.midpoint.xml.ns._public.common.api_types_3.ExecuteCredentialResetResponseType)1 QName (javax.xml.namespace.QName)1 Test (org.testng.annotations.Test)1