Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http-client-java, update test to fill exact param #4770

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 @@ -20,18 +20,18 @@ public class AccessTests {

@Test
public void test() {
publicClient.publicDecoratorInPublic("");
publicClient.noDecoratorInPublic("");
publicClient.publicDecoratorInPublic("sample");
publicClient.noDecoratorInPublic("sample");

internalClient.internalDecoratorInInternal("");
internalClient.noDecoratorInInternal("");
internalClient.publicDecoratorInInternal("");
internalClient.internalDecoratorInInternal("sample");
internalClient.noDecoratorInInternal("sample");
internalClient.publicDecoratorInInternal("sample");

sharedClient.publicMethod("");
sharedClient.internalWithResponse("", null).getValue().toObject(SharedModel.class);
sharedClient.publicMethod("sample");
sharedClient.internalWithResponse("sample", null).getValue().toObject(SharedModel.class);

relativeClient.operation("");
relativeClient.operation("Madge");
AbstractModel abstractModel = relativeClient.discriminator("real");
Assertions.assertTrue(abstractModel instanceof RealModel);
Assertions.assertInstanceOf(RealModel.class, abstractModel);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void testValid() {
public void testInvalid() {
ApiKeyClient client = new ApiKeyClientBuilder()
// AzureKeyCredentialPolicy from core requires HTTPS
.addPolicy(new AzureKeyCredentialPolicy("x-ms-api-key", new AzureKeyCredential("valid-key")))
.addPolicy(new AzureKeyCredentialPolicy("x-ms-api-key", new AzureKeyCredential("invalid-key")))
.buildClient();

// assert HttpResponseException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public void testManagedIdentityManager() {
Map<String, UserAssignedIdentity> userAssignedIdentityMap = new HashMap<>();
userAssignedIdentityMap.put(USER_ASSIGNED_IDENTITIES_KEY, new UserAssignedIdentity());
resource.update()
.withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
.withUserAssignedIdentities(userAssignedIdentityMap))
.withIdentity(
new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED)
.withUserAssignedIdentities(userAssignedIdentityMap))
.apply();
Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, resource.identity().type());
Assertions.assertNotNull(resource.identity().principalId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

package com.routes;

import java.util.List;
import java.util.Set;

import com.azure.core.http.policy.HttpLogDetailLevel;
import com.azure.core.http.policy.HttpLogOptions;
import java.util.List;
import java.util.Set;
import org.junit.jupiter.api.Test;

public class RouteTests {
Expand Down Expand Up @@ -79,10 +78,10 @@ public void testQueryExpansionExplode() {

@Test
public void buildQueryParametersQueryContinuationExplode() {
var client = new RoutesClientBuilder().httpLogOptions(new HttpLogOptions()
.setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)
.setAllowedQueryParamNames(Set.of("fixed", "param"))
).buildQueryParametersQueryContinuationExplodeClient();
var client = new RoutesClientBuilder()
.httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)
.setAllowedQueryParamNames(Set.of("fixed", "param")))
.buildQueryParametersQueryContinuationExplodeClient();

client.primitive("a");

Expand Down
Loading