|
Spring Framework example source code file (OwnerTests.java)
The Spring Framework OwnerTests.java source codepackage org.springframework.samples.petclinic; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import org.junit.Test; /** * JUnit test for the {@link Owner} class. * * @author Ken Krebs */ public class OwnerTests { @Test public void testHasPet() { Owner owner = new Owner(); Pet fido = new Pet(); fido.setName("Fido"); assertNull(owner.getPet("Fido")); assertNull(owner.getPet("fido")); owner.addPet(fido); assertEquals(fido, owner.getPet("Fido")); assertEquals(fido, owner.getPet("fido")); } } Other Spring Framework examples (source code examples)Here is a short list of links related to this Spring Framework OwnerTests.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.