### Question:
AwardsPostedNotification extends BaseNotification<AwardsPostedNotificationViewModel> { @Override public void parseMessageData() throws JsonParseException { JsonObject jsonData = JSONHelper.getasJsonObject(messageData); if (!jsonData.has("event_key")) { throw new JsonParseException("Notification data does not contain 'event_key'"); } eventKey = jsonData.get("event_key").getAsString(); if (!jsonData.has("event_name")) { throw new JsonParseException("Notification data does not contain 'event_name'"); } eventName = jsonData.get("event_name").getAsString(); if (!jsonData.has("awards") || !jsonData.get("awards").isJsonArray()) { throw new JsonParseException("Notification data does not contain 'awards' list"); } JsonArray awardArray = jsonData.get("awards").getAsJsonArray(); for (JsonElement element : awardArray) { awards.add(gson.fromJson(element, Award.class)); } } AwardsPostedNotification(String messageData, AwardListWriter writer); String getEventName(); String getEventKey(); List<Award> getAwards(); @Override void parseMessageData(); @Override Notification buildNotification(Context context, FollowsChecker followsChecker); @Override void updateDataLocally(); @Override Intent getIntent(Context context); @Override int getNotificationId(); @Override View getView(Context c, LayoutInflater inflater, View convertView); @Nullable @Override AwardsPostedNotificationViewModel renderToViewModel(Context context, @Nullable Void aVoid);  }### Answer:
@Test(expected = JsonParseException.class) public void testNoEventKey() { mData.remove("event_key"); mNotification = new AwardsPostedNotification(mData.toString(), mWriter); mNotification.parseMessageData(); }
@Test(expected = JsonParseException.class) public void testNoEventName() { mData.remove("event_name"); mNotification = new AwardsPostedNotification(mData.toString(), mWriter); mNotification.parseMessageData(); }
@Test(expected = JsonParseException.class) public void testNoAwards() { mData.remove("awards"); mNotification = new AwardsPostedNotification(mData.toString(), mWriter); mNotification.parseMessageData(); }