Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public static <T, InnerT> Accepted<T> newAccepted(
activationResponse,
client.getSerializerAdapter(),
client.getHttpPipeline(),
client.getDefaultPollInterval(),
SdkContext.getDelayDuration(client.getDefaultPollInterval()),
innerType, innerType,
convertOperation);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import com.azure.resourcemanager.resources.fluent.inner.DeploymentExtendedInner;
import com.azure.resourcemanager.resources.fluent.inner.DeploymentInner;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.lang.reflect.Field;

public class TypeSerializationTests {

@Test
@Disabled("To fix later as swagger changes on DeploymentExtendedInner")
public void testDeploymentSerialization() throws Exception {
final String templateJson = "{ \"/subscriptions/<redacted>/resourceGroups/<redacted>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<redacted>\": {} }";

Expand All @@ -27,11 +27,15 @@ public void testDeploymentSerialization() throws Exception {
Assertions.assertTrue(deploymentJson.contains("Microsoft.ManagedIdentity"));
}

private static DeploymentInner createRequestFromInner(DeploymentImpl deployment) {
private static DeploymentInner createRequestFromInner(DeploymentImpl deployment) throws NoSuchFieldException, IllegalAccessException {
Field field = DeploymentImpl.class.getDeclaredField("deploymentCreateUpdateParameters");
field.setAccessible(true);
DeploymentInner implInner = (DeploymentInner) field.get(deployment);

DeploymentInner inner = new DeploymentInner()
.withProperties(new DeploymentProperties());
inner.properties().withMode(deployment.mode());
//inner.properties().withTemplate(deployment.template());
inner.properties().withTemplate(implInner.properties().template());
inner.properties().withTemplateLink(deployment.templateLink());
inner.properties().withParameters(deployment.parameters());
inner.properties().withParametersLink(deployment.parametersLink());
Expand Down