Search in sources :

Example 6 with User

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));
}
Also used : User(com.alibaba.json.bvtVO.一个中文名字的包.User)

Example 7 with 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);
}
Also used : User(testapp.endpoint.ghissues.gh353.User) Test(org.junit.Test)

Example 8 with User

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);
}
Also used : User(org.openstack4j.model.identity.v3.User) Message(org.apache.camel.Message)

Example 9 with User

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());
}
Also used : User(org.openstack4j.model.identity.v3.User) ArrayList(java.util.ArrayList) UserProducer(org.apache.camel.component.openstack.keystone.producer.UserProducer) Before(org.junit.Before)

Example 10 with User

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());
}
Also used : User(org.openstack4j.model.identity.v3.User) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Aggregations

User (pl.plajer.villagedefense3.User)30 Player (org.bukkit.entity.Player)18 User (org.gluu.oxtrust.model.scim2.User)17 User (org.openstack4j.model.identity.v3.User)13 EventHandler (org.bukkit.event.EventHandler)11 Test (org.junit.Test)11 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)10 ScimPatchUser (org.gluu.oxtrust.model.scim2.ScimPatchUser)10 Date (java.util.Date)9 StatementBuilder (com.google.api.ads.admanager.axis.utils.v202205.StatementBuilder)8 Arena (pl.plajer.villagedefense3.arena.Arena)8 User (me.zhanghai.android.douya.network.api.info.apiv2.User)7 User (com.google.api.ads.admanager.axis.v202108.User)6 User (com.google.api.ads.admanager.axis.v202202.User)6 UserServiceInterface (com.google.api.ads.admanager.axis.v202202.UserServiceInterface)6 ArrayList (java.util.ArrayList)6 SimpleUser (me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser)6 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)6 User (com.google.api.ads.admanager.axis.v202205.User)5 UserServiceInterface (com.google.api.ads.admanager.axis.v202205.UserServiceInterface)5