use of com.google.api.ads.admanager.axis.v202205.User in project fastjson by alibaba.
the class Issue3132 method test_for_issue.
public void test_for_issue() throws Exception {
User user = new User();
user.setId(9);
user.setName("asdffsf");
System.out.println(JSONObject.toJSONString(user));
}
use of com.google.api.ads.admanager.axis.v202205.User in project actframework by actframework.
the class GHIssue353 method testPut.
@Test
public void testPut() throws Exception {
url("/gh/353").accept(H.Format.JSON).postJSON(user);
String s = resp().body().string();
User user2 = JSON.parseObject(s, User.class);
assertNotNull(user2._id());
checkRespCode();
reset();
Map<String, String> updates = C.Map("name", "Donald Mickey");
url("/gh/353/" + user2.getIdAsStr()).accept(H.Format.JSON).postJSON(updates).put();
s = resp().body().string();
User user3 = JSON.parseObject(s, User.class);
eq(user2.getId(), user3.getId());
eq("Donald Mickey", user3.name);
}
use of com.google.api.ads.admanager.axis.v202205.User in project camel by apache.
the class UserProducer method doUpdate.
private void doUpdate(Exchange exchange) {
final Message msg = exchange.getIn();
final User in = messageToUser(msg);
final User out = osV3Client.identity().users().update(in);
msg.setBody(out);
}
use of com.google.api.ads.admanager.axis.v202205.User in project camel by apache.
the class UserProducerTest method setUp.
@Before
public void setUp() {
producer = new UserProducer(endpoint, client);
when(userService.create(any(User.class))).thenReturn(testOSuser);
when(userService.get(anyString())).thenReturn(testOSuser);
List<User> getAllList = new ArrayList<>();
getAllList.add(testOSuser);
getAllList.add(testOSuser);
doReturn(getAllList).when(userService).list();
dummyUser = createUser();
when(testOSuser.getName()).thenReturn(dummyUser.getName());
when(testOSuser.getDescription()).thenReturn(dummyUser.getDescription());
when(testOSuser.getPassword()).thenReturn(dummyUser.getPassword());
when(testOSuser.getDomainId()).thenReturn(dummyUser.getDomainId());
when(testOSuser.getEmail()).thenReturn(dummyUser.getEmail());
}
use of com.google.api.ads.admanager.axis.v202205.User in project camel by apache.
the class UserProducerTest method updateTest.
@Test
public void updateTest() throws Exception {
final String id = "myID";
msg.setHeader(OpenstackConstants.OPERATION, OpenstackConstants.UPDATE);
when(testOSuser.getId()).thenReturn(id);
final String newDescription = "ndesc";
when(testOSuser.getDescription()).thenReturn(newDescription);
when(userService.update(any(User.class))).thenReturn(testOSuser);
msg.setBody(testOSuser);
producer.process(exchange);
ArgumentCaptor<User> captor = ArgumentCaptor.forClass(User.class);
verify(userService).update(captor.capture());
assertEqualsUser(testOSuser, captor.getValue());
assertNotNull(captor.getValue().getId());
assertEquals(newDescription, msg.getBody(User.class).getDescription());
}
Aggregations