@Test public void testEquals() { new EqualsTester() .addEqualityGroup(Status.CLIENT_ERROR_BAD_REQUEST) .addEqualityGroup(Status.INFORMATIONAL_CONTINUE) .addEqualityGroup(Status.SERVER_ERROR_BAD_GATEWAY) .addEqualityGroup(Status.SUCCESS_ACCEPTED) .addEqualityGroup(Status.forCode(550), Status.forCode(550)) .testEquals(); }
@Test public void testForCode_withInvalid() { try { Status.forCode(1000); fail("Expected IllegalArgumentException"); } catch (final IllegalArgumentException expected) { } try { Status.forCode(10); fail("Expected IllegalArgumentException"); } catch (final IllegalArgumentException expected) { } try { Status.forCode(-200); fail("Expected IllegalArgumentException"); } catch (final IllegalArgumentException expected) { } }