### Question:
FireflyExtensionRepository { public FireflyExtensionModel findByName(String name) throws FireflyExtensionNotFoundException, FireflyNotInstalledException { final FlexibleSearchQuery query = new FlexibleSearchQuery( "SELECT {" + FireflyExtensionModel.PK + "} " + "FROM {" + FireflyExtensionModel._TYPECODE + "} " + "WHERE {" + FireflyExtensionModel.NAME + "} = ?name"); query.addQueryParameter("name", name); try { return searchService.searchUnique(query); } catch (FlexibleSearchException e) { throw new FireflyNotInstalledException(e); } catch (ModelNotFoundException e) { throw new FireflyExtensionNotFoundException(name); } }  FireflyExtensionModel findByName(String name); FireflyExtensionModel create(String name); void save(FireflyExtensionModel model);  }### Answer:
@Test public void shouldNotReturnNullWhileFindByName() throws Exception { final String name = "myName"; try { fireflyExtensionRepository.findByName(name); fail(); } catch (FireflyExtensionRepository.FireflyExtensionNotFoundException e) { assertEquals(name, e.getName()); } }