BackendOven extends AbstractOven { public String bake(String json) { try { Payload payload = objectMapper.readValue(json, Payload.class); Cake cake = createCake(payload.getCake()); bakeIngredient(payload.getRecipe(), cake); Cake cakeToSerialize = new Cake(cake); return objectMapper.writeValueAsString(cakeToSerialize); } catch (Exception e) { throw new RuntimeException("payload serialization error", e); } } BackendOven(); String bake(String json); void registerHook(BaseIngredientHook hook);  }
@Test(expected = RuntimeException.class) public void testBake_throwsOnMissingIngredientHook() { oven.bake("{\"recipe\":{\"Recipe\":{\"ingredients\":[{\"TestIngredient\":{}}]}}}"); }