@Test public void compareToTest() throws ComponentLookupException { Assert.assertEquals(0, this.mocker.getComponentUnderTest().compareTo(this.mocker.getComponentUnderTest())); Assert.assertTrue(this.mocker.getComponentUnderTest().compareTo(null) < 0); Assert.assertEquals(0, this.mocker.getComponentUnderTest().compareTo(new MockAccessLevel("nothing", 0, true))); Assert.assertTrue(this.mocker.getComponentUnderTest().compareTo(new MockAccessLevel("unknown", -1, true)) > 0); Assert.assertTrue(this.mocker.getComponentUnderTest().compareTo(new MockAccessLevel("manage", 30, true)) < 0); Assert.assertTrue(this.mocker.getComponentUnderTest().compareTo(mock(AccessLevel.class)) < 0); }
@Override public int compareTo(AccessLevel o) { if (o instanceof AbstractAccessLevel) { return super.compareTo(o); } return Integer.MIN_VALUE; }
NoAccessLevel extends AbstractAccessLevel { @Override public int compareTo(AccessLevel o) { if (o instanceof AbstractAccessLevel) { return super.compareTo(o); } return Integer.MIN_VALUE; } }
NoAccessLevel extends AbstractAccessLevel { @Override public int compareTo(AccessLevel o) { if (o instanceof AbstractAccessLevel) { return super.compareTo(o); } return Integer.MIN_VALUE; } NoAccessLevel(); }
NoAccessLevel extends AbstractAccessLevel { @Override public int compareTo(AccessLevel o) { if (o instanceof AbstractAccessLevel) { return super.compareTo(o); } return Integer.MIN_VALUE; } NoAccessLevel(); @Override String getName(); @Override int compareTo(AccessLevel o); }
NoAccessLevel extends AbstractAccessLevel { @Override public int compareTo(AccessLevel o) { if (o instanceof AbstractAccessLevel) { return super.compareTo(o); } return Integer.MIN_VALUE; } NoAccessLevel(); @Override String getName(); @Override int compareTo(AccessLevel o);  }