@Test public void nullServiceWhenAuthenticateAllTokens() throws Exception { ServiceProperties sp = new ServiceProperties(); sp.setAuthenticateAllArtifacts(true); try { sp.afterPropertiesSet(); fail("Expected Exception"); } catch (IllegalArgumentException success) { } sp.setAuthenticateAllArtifacts(false); try { sp.afterPropertiesSet(); fail("Expected Exception"); } catch (IllegalArgumentException success) { } }