Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
Test expected exception
Browse files Browse the repository at this point in the history
  • Loading branch information
RockinRoel committed Oct 22, 2016
1 parent abe2460 commit b2a50ca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions shared/src/test/java/org/ulyssis/ipp/config/TestConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@
*/
package org.ulyssis.ipp.config;

import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException;
import com.google.common.collect.ImmutableList;

import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.ulyssis.ipp.utils.Serialization;
import org.ulyssis.ipp.TagId;

Expand Down Expand Up @@ -130,4 +133,13 @@ public void testSerializeTeamWithTags() throws Exception {
assertThat(json, sameJSONAs("{\"teamNb\":4,\"name\":\"Team four\",\"tags\":[\"abcd0123\",\"0123ABCD\"]}")
.allowingAnyArrayOrdering());
}

@Rule
public final ExpectedException exception = ExpectedException.none();

@Test
public void testNameNaamMixup() throws Exception {
exception.expect(UnrecognizedPropertyException.class);
Serialization.getJsonMapper().readValue("{\"teamNb\":3,\"naam\":\"My team\"}", Team.class);
}
}

0 comments on commit b2a50ca

Please sign in to comment.