Search in sources :

Example 1 with ExtensionModelJsonSerializer

use of org.mule.runtime.extension.api.persistence.ExtensionModelJsonSerializer in project mule by mulesoft.

the class ExtensionModelJsonGeneratorTestCase method setup.

@Before
public void setup() throws IOException {
    generator = new ExtensionModelJsonSerializer(true);
    expectedJson = getResourceAsString("models/" + expectedSource, getClass()).trim();
}
Also used : ExtensionModelJsonSerializer(org.mule.runtime.extension.api.persistence.ExtensionModelJsonSerializer) Before(org.junit.Before)

Example 2 with ExtensionModelJsonSerializer

use of org.mule.runtime.extension.api.persistence.ExtensionModelJsonSerializer in project mule by mulesoft.

the class CoreExtensionModelSerializationTestCase method serializeDeserialize.

@Test
public void serializeDeserialize() throws Exception {
    ExtensionModel extensionModel = MuleExtensionModelProvider.getExtensionModel();
    ExtensionModelJsonSerializer jsonSerializer = new ExtensionModelJsonSerializer(true);
    String serialized = jsonSerializer.serialize(extensionModel);
    ExtensionModel deserialized = jsonSerializer.deserialize(serialized);
    assertThat(extensionModel, equalTo(deserialized));
}
Also used : ExtensionModelJsonSerializer(org.mule.runtime.extension.api.persistence.ExtensionModelJsonSerializer) ExtensionModel(org.mule.runtime.api.meta.model.ExtensionModel) Test(org.junit.Test)

Aggregations

ExtensionModelJsonSerializer (org.mule.runtime.extension.api.persistence.ExtensionModelJsonSerializer)2 Before (org.junit.Before)1 Test (org.junit.Test)1 ExtensionModel (org.mule.runtime.api.meta.model.ExtensionModel)1