@BeforeMethod public void setUp() { acceptVersion = AcceptAPIVersion.newBuilder() .withDefaultProtocolVersion("1.0") .withDefaultResourceVersion("2.1") .build(); }
@Test public void acceptsNullResourceVersion() { // Given acceptVersion = AcceptAPIVersion.newBuilder().withDefaultProtocolVersion("1.0").build(); AcceptAPIVersionContext context = new AcceptAPIVersionContext(new RootContext(), "name", acceptVersion); // Then assertNull(context.getResourceVersion()); }
@Test(expectedExceptions = NullPointerException.class) public void rejectsNullProtocolVersion() { // Given acceptVersion = AcceptAPIVersion.newBuilder().withDefaultResourceVersion("2.1").build(); new AcceptAPIVersionContext(new RootContext(), "name", acceptVersion); }