@Test public void count_repositoryPopulated_countedTwoSuppliers() { // given // repository was populated during the app init // when long count = supplierRepository.count(); // then assertThat(count, is(2L)); }
@Test public void findOne_repositoryPopulated_fetchedSupplierWithSpecifiedSupplierId() { // given // repository was populated during the app init // when BigInteger supplierId = new BigInteger("1"); Supplier supplier = supplierRepository.findOne(supplierId); // then assertThat(supplier, notNullValue()); assertThat(supplier.getSupplierId(), is(supplierId)); assertThat(supplier.getName(), is("ABC Pets")); Address address = supplier.getAddress(); assertThat(address, notNullValue()); assertThat(address.getAddress1(), is("600 Avon Way")); assertThat(address.getAddress2(), nullValue()); assertThat(address.getCity(), is("Los Angeles")); assertThat(address.getState(), is("CA")); assertThat(address.getZip(), is("94024")); assertThat(address.getCountry(), is("USA")); assertThat(address.getPhone(), is("212-947-0797")); }