本文整理汇总了Java中org.springframework.samples.petclinic.model.Owner.setFirstName方法的典型用法代码示例。如果您正苦于以下问题:Java Owner.setFirstName方法的具体用法?Java Owner.setFirstName怎么用?Java Owner.setFirstName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.samples.petclinic.model.Owner
的用法示例。
在下文中一共展示了Owner.setFirstName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldInsertOwner
import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Test
@Transactional
public void shouldInsertOwner() {
Collection<Owner> owners = this.clinicService.findOwnerByLastName("Schultz");
int found = owners.size();
Owner owner = new Owner();
owner.setFirstName("Sam");
owner.setLastName("Schultz");
owner.setAddress("4, Evans Street");
owner.setCity("Wollongong");
owner.setTelephone("4444444444");
this.clinicService.saveOwner(owner);
assertThat(owner.getId().longValue()).isNotEqualTo(0);
owners = this.clinicService.findOwnerByLastName("Schultz");
assertThat(owners.size()).isEqualTo(found + 1);
}
示例2: shouldInsertOwner
import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Test
@Transactional
public void shouldInsertOwner() {
Collection<Owner> owners = this.clinicService.findOwnerByLastName("Schultz");
int found = owners.size();
Owner owner = new Owner();
owner.setFirstName("Sam");
owner.setLastName("Schultz");
owner.setAddress("4, Evans Street");
owner.setCity("Wollongong");
owner.setTelephone("4444444444");
this.clinicService.saveOwner(owner);
assertThat(owner.getId().longValue()).isNotEqualTo(0);
owners = this.clinicService.findOwnerByLastName("Schultz");
assertThat(owners.size()).isEqualTo(found + 1);
}
示例3: insertOwner
import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Test
@Transactional
public void insertOwner() {
Collection<Owner> owners = this.clinicService.findOwnerByLastName("Schultz");
int found = owners.size();
Owner owner = new Owner();
owner.setFirstName("Sam");
owner.setLastName("Schultz");
owner.setAddress("4, Evans Street");
owner.setCity("Wollongong");
owner.setTelephone("4444444444");
this.clinicService.saveOwner(owner);
Assert.assertNotEquals("Owner Id should have been generated", owner.getId().longValue(), 0);
owners = this.clinicService.findOwnerByLastName("Schultz");
assertEquals("Verifying number of owners after inserting a new one.", found + 1, owners.size());
}
示例4: setup
import org.springframework.samples.petclinic.model.Owner; //导入方法依赖的package包/类
@Before
public void setup() {
this.mockMvc = MockMvcBuilders.standaloneSetup(ownerController).build();
george = new Owner();
george.setId(TEST_OWNER_ID);
george.setFirstName("George");
george.setLastName("Franklin");
george.setAddress("110 W. Liberty St.");
george.setCity("Madison");
george.setTelephone("6085551023");
given(this.clinicService.findOwnerById(TEST_OWNER_ID)).willReturn(george);
}