target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void unknownConversions() { assertThrows(RuntimeException.class, () -> { final TypeSchema ts = new TypeSchema(); final TypeRegistry mockRegistry = new TypeRegistryImpl(); ts.put("type", "integer"); ts.put("format", "int63"); ts.getTypeClass(mockRegistry); }); assertThrows(RuntimeException.class, () -> { fi... | public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) { clz = char.class; } else { clz = String.clas... | TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {... | TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {... | TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {... | TypeSchema extends HashMap<String, Object> { public Class<?> getTypeClass(final TypeRegistry typeRegistry) { Class<?> clz = null; String type = getType(); if (type == null) { type = "object"; } if (type.contentEquals("string")) { final String format = getFormat(); if (format != null && format.contentEquals("uint16")) {... |
@Test public void validate() { final TypeSchema ts = TypeSchema.typeConvert(org.hyperledger.fabric.contract.MyType.class); final DataTypeDefinition dtd = new DataTypeDefinitionImpl(org.hyperledger.fabric.contract.MyType.class); MetadataBuilder.addComponent(dtd); final JSONObject json = new JSONObject(); ts.validate(jso... | public void validate(final JSONObject obj) { final JSONObject toValidate = new JSONObject(); toValidate.put("prop", obj); JSONObject schemaJSON; if (this.containsKey("schema")) { schemaJSON = new JSONObject((Map) this.get("schema")); } else { schemaJSON = new JSONObject(this); } final JSONObject rawSchema = new JSONObj... | TypeSchema extends HashMap<String, Object> { public void validate(final JSONObject obj) { final JSONObject toValidate = new JSONObject(); toValidate.put("prop", obj); JSONObject schemaJSON; if (this.containsKey("schema")) { schemaJSON = new JSONObject((Map) this.get("schema")); } else { schemaJSON = new JSONObject(this... | TypeSchema extends HashMap<String, Object> { public void validate(final JSONObject obj) { final JSONObject toValidate = new JSONObject(); toValidate.put("prop", obj); JSONObject schemaJSON; if (this.containsKey("schema")) { schemaJSON = new JSONObject((Map) this.get("schema")); } else { schemaJSON = new JSONObject(this... | TypeSchema extends HashMap<String, Object> { public void validate(final JSONObject obj) { final JSONObject toValidate = new JSONObject(); toValidate.put("prop", obj); JSONObject schemaJSON; if (this.containsKey("schema")) { schemaJSON = new JSONObject((Map) this.get("schema")); } else { schemaJSON = new JSONObject(this... | TypeSchema extends HashMap<String, Object> { public void validate(final JSONObject obj) { final JSONObject toValidate = new JSONObject(); toValidate.put("prop", obj); JSONObject schemaJSON; if (this.containsKey("schema")) { schemaJSON = new JSONObject((Map) this.get("schema")); } else { schemaJSON = new JSONObject(this... |
@Test public void systemContract() { final SystemContract system = new SystemContract(); final ChaincodeStub stub = new ChaincodeStubNaiveImpl(); system.getMetadata(new Context(stub)); } | public static String getMetadata() { return metadata().toString(); } | MetadataBuilder { public static String getMetadata() { return metadata().toString(); } } | MetadataBuilder { public static String getMetadata() { return metadata().toString(); } private MetadataBuilder(); } | MetadataBuilder { public static String getMetadata() { return metadata().toString(); } private MetadataBuilder(); static void validate(); static void initialize(final RoutingRegistry registry, final TypeRegistry typeRegistry); static void addComponent(final DataTypeDefinition datatype); @SuppressWarnings("serial") sta... | MetadataBuilder { public static String getMetadata() { return metadata().toString(); } private MetadataBuilder(); static void validate(); static void initialize(final RoutingRegistry registry, final TypeRegistry typeRegistry); static void addComponent(final DataTypeDefinition datatype); @SuppressWarnings("serial") sta... |
@Test public void toBuffer() { final TypeRegistry tr = TypeRegistry.getRegistry(); tr.addDataType(MyType.class); MetadataBuilder.addComponent(tr.getDataType("MyType")); final JSONTransactionSerializer serializer = new JSONTransactionSerializer(); byte[] bytes = serializer.toBuffer("hello world", TypeSchema.typeConvert(... | @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JSONArray array = normalizeArray(new JSONArray(value), ts); b... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... |
@Test public void fromBufferObject() { final byte[] buffer = "[{\"value\":\"hello\"},{\"value\":\"world\"}]".getBytes(StandardCharsets.UTF_8); final TypeRegistry tr = TypeRegistry.getRegistry(); tr.addDataType(MyType.class); MetadataBuilder.addComponent(tr.getDataType("MyType")); final JSONTransactionSerializer seriali... | @Override public Object fromBuffer(final byte[] buffer, final TypeSchema ts) { try { final String stringData = new String(buffer, StandardCharsets.UTF_8); Object value = null; value = convert(stringData, ts); return value; } catch (InstantiationException | IllegalAccessException e) { final ContractRuntimeException cre ... | JSONTransactionSerializer implements SerializerInterface { @Override public Object fromBuffer(final byte[] buffer, final TypeSchema ts) { try { final String stringData = new String(buffer, StandardCharsets.UTF_8); Object value = null; value = convert(stringData, ts); return value; } catch (InstantiationException | Ille... | JSONTransactionSerializer implements SerializerInterface { @Override public Object fromBuffer(final byte[] buffer, final TypeSchema ts) { try { final String stringData = new String(buffer, StandardCharsets.UTF_8); Object value = null; value = convert(stringData, ts); return value; } catch (InstantiationException | Ille... | JSONTransactionSerializer implements SerializerInterface { @Override public Object fromBuffer(final byte[] buffer, final TypeSchema ts) { try { final String stringData = new String(buffer, StandardCharsets.UTF_8); Object value = null; value = convert(stringData, ts); return value; } catch (InstantiationException | Ille... | JSONTransactionSerializer implements SerializerInterface { @Override public Object fromBuffer(final byte[] buffer, final TypeSchema ts) { try { final String stringData = new String(buffer, StandardCharsets.UTF_8); Object value = null; value = convert(stringData, ts); return value; } catch (InstantiationException | Ille... |
@Test public void fromBufferErrors() { final TypeRegistry tr = new TypeRegistryImpl(); tr.addDataType(MyType.class); MetadataBuilder.addComponent(tr.getDataType("MyType")); final JSONTransactionSerializer serializer = new JSONTransactionSerializer(); final TypeSchema ts = TypeSchema.typeConvert(MyType[].class); seriali... | @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JSONArray array = normalizeArray(new JSONArray(value), ts); b... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... | JSONTransactionSerializer implements SerializerInterface { @Override public byte[] toBuffer(final Object value, final TypeSchema ts) { logger.debug(() -> "Schema to convert is " + ts); byte[] buffer = null; if (value != null) { final String type = ts.getType(); if (type != null) { switch (type) { case "array": final JS... |
@Test public void testGetObjectType() { final CompositeKey key = new CompositeKey("abc", Arrays.asList("def", "ghi", "jkl", "mno")); assertThat(key.getObjectType(), is(equalTo("abc"))); } | public String getObjectType() { return objectType; } | CompositeKey { public String getObjectType() { return objectType; } } | CompositeKey { public String getObjectType() { return objectType; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); } | CompositeKey { public String getObjectType() { return objectType; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); String getObjectType(); List<String> getAttributes(); @Override String toString(); static CompositeKey parseCompos... | CompositeKey { public String getObjectType() { return objectType; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); String getObjectType(); List<String> getAttributes(); @Override String toString(); static CompositeKey parseCompos... |
@Test public void testMapLevel() { assertEquals("Error maps", Level.SEVERE, proxyMapLevel("ERROR")); assertEquals("Critical maps", Level.SEVERE, proxyMapLevel("critical")); assertEquals("Warn maps", Level.WARNING, proxyMapLevel("WARNING")); assertEquals("Info maps", Level.INFO, proxyMapLevel("INFO")); assertEquals("Con... | private static Level mapLevel(final String level) { if (level != null) { switch (level.toUpperCase().trim()) { case "ERROR": case "CRITICAL": return Level.SEVERE; case "WARNING": return Level.WARNING; case "INFO": return Level.INFO; case "NOTICE": return Level.CONFIG; case "DEBUG": return Level.FINEST; default: return ... | Logging { private static Level mapLevel(final String level) { if (level != null) { switch (level.toUpperCase().trim()) { case "ERROR": case "CRITICAL": return Level.SEVERE; case "WARNING": return Level.WARNING; case "INFO": return Level.INFO; case "NOTICE": return Level.CONFIG; case "DEBUG": return Level.FINEST; defaul... | Logging { private static Level mapLevel(final String level) { if (level != null) { switch (level.toUpperCase().trim()) { case "ERROR": case "CRITICAL": return Level.SEVERE; case "WARNING": return Level.WARNING; case "INFO": return Level.INFO; case "NOTICE": return Level.CONFIG; case "DEBUG": return Level.FINEST; defaul... | Logging { private static Level mapLevel(final String level) { if (level != null) { switch (level.toUpperCase().trim()) { case "ERROR": case "CRITICAL": return Level.SEVERE; case "WARNING": return Level.WARNING; case "INFO": return Level.INFO; case "NOTICE": return Level.CONFIG; case "DEBUG": return Level.FINEST; defaul... | Logging { private static Level mapLevel(final String level) { if (level != null) { switch (level.toUpperCase().trim()) { case "ERROR": case "CRITICAL": return Level.SEVERE; case "WARNING": return Level.WARNING; case "INFO": return Level.INFO; case "NOTICE": return Level.CONFIG; case "DEBUG": return Level.FINEST; defaul... |
@Test public void testFormatError() { final Exception e1 = new Exception("Computer says no"); assertThat(Logging.formatError(e1), containsString("Computer says no")); final NullPointerException npe1 = new NullPointerException("Nothing here"); npe1.initCause(e1); assertThat(Logging.formatError(npe1), containsString("Com... | public static String formatError(final Throwable throwable) { if (throwable == null) { return null; } final StringWriter buffer = new StringWriter(); buffer.append(throwable.getMessage()).append(System.lineSeparator()); throwable.printStackTrace(new PrintWriter(buffer)); final Throwable cause = throwable.getCause(); if... | Logging { public static String formatError(final Throwable throwable) { if (throwable == null) { return null; } final StringWriter buffer = new StringWriter(); buffer.append(throwable.getMessage()).append(System.lineSeparator()); throwable.printStackTrace(new PrintWriter(buffer)); final Throwable cause = throwable.getC... | Logging { public static String formatError(final Throwable throwable) { if (throwable == null) { return null; } final StringWriter buffer = new StringWriter(); buffer.append(throwable.getMessage()).append(System.lineSeparator()); throwable.printStackTrace(new PrintWriter(buffer)); final Throwable cause = throwable.getC... | Logging { public static String formatError(final Throwable throwable) { if (throwable == null) { return null; } final StringWriter buffer = new StringWriter(); buffer.append(throwable.getMessage()).append(System.lineSeparator()); throwable.printStackTrace(new PrintWriter(buffer)); final Throwable cause = throwable.getC... | Logging { public static String formatError(final Throwable throwable) { if (throwable == null) { return null; } final StringWriter buffer = new StringWriter(); buffer.append(throwable.getMessage()).append(System.lineSeparator()); throwable.printStackTrace(new PrintWriter(buffer)); final Throwable cause = throwable.getC... |
@Test public void testSetLogLevel() { final java.util.logging.Logger l = java.util.logging.Logger.getLogger("org.hyperledger.fabric.test"); final java.util.logging.Logger another = java.util.logging.Logger.getLogger("acme.wibble"); final Level anotherLevel = another.getLevel(); Logging.setLogLevel("debug"); assertThat(... | public static void setLogLevel(final String newLevel) { final Level l = mapLevel(newLevel); final LogManager logManager = LogManager.getLogManager(); final ArrayList<String> allLoggers = Collections.list(logManager.getLoggerNames()); allLoggers.add("org.hyperledger"); allLoggers.stream().filter(name -> name.startsWith(... | Logging { public static void setLogLevel(final String newLevel) { final Level l = mapLevel(newLevel); final LogManager logManager = LogManager.getLogManager(); final ArrayList<String> allLoggers = Collections.list(logManager.getLoggerNames()); allLoggers.add("org.hyperledger"); allLoggers.stream().filter(name -> name.s... | Logging { public static void setLogLevel(final String newLevel) { final Level l = mapLevel(newLevel); final LogManager logManager = LogManager.getLogManager(); final ArrayList<String> allLoggers = Collections.list(logManager.getLoggerNames()); allLoggers.add("org.hyperledger"); allLoggers.stream().filter(name -> name.s... | Logging { public static void setLogLevel(final String newLevel) { final Level l = mapLevel(newLevel); final LogManager logManager = LogManager.getLogManager(); final ArrayList<String> allLoggers = Collections.list(logManager.getLoggerNames()); allLoggers.add("org.hyperledger"); allLoggers.stream().filter(name -> name.s... | Logging { public static void setLogLevel(final String newLevel) { final Level l = mapLevel(newLevel); final LogManager logManager = LogManager.getLogManager(); final ArrayList<String> allLoggers = Collections.list(logManager.getLoggerNames()); allLoggers.add("org.hyperledger"); allLoggers.stream().filter(name -> name.s... |
@Test public void testGetAttributes() { final CompositeKey key = new CompositeKey("abc", Arrays.asList("def", "ghi", "jkl", "mno")); assertThat(key.getObjectType(), is(equalTo("abc"))); assertThat(key.getAttributes(), hasSize(4)); assertThat(key.getAttributes(), contains("def", "ghi", "jkl", "mno")); } | public List<String> getAttributes() { return attributes; } | CompositeKey { public List<String> getAttributes() { return attributes; } } | CompositeKey { public List<String> getAttributes() { return attributes; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); } | CompositeKey { public List<String> getAttributes() { return attributes; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); String getObjectType(); List<String> getAttributes(); @Override String toString(); static CompositeKey parse... | CompositeKey { public List<String> getAttributes() { return attributes; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); String getObjectType(); List<String> getAttributes(); @Override String toString(); static CompositeKey parse... |
@Test public void testToString() { final CompositeKey key = new CompositeKey("abc", Arrays.asList("def", "ghi", "jkl", "mno")); assertThat(key.toString(), is(equalTo("\u0000abc\u0000def\u0000ghi\u0000jkl\u0000mno\u0000"))); } | @Override public String toString() { return compositeKey; } | CompositeKey { @Override public String toString() { return compositeKey; } } | CompositeKey { @Override public String toString() { return compositeKey; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); } | CompositeKey { @Override public String toString() { return compositeKey; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); String getObjectType(); List<String> getAttributes(); @Override String toString(); static CompositeKey pars... | CompositeKey { @Override public String toString() { return compositeKey; } CompositeKey(final String objectType, final String... attributes); CompositeKey(final String objectType, final List<String> attributes); String getObjectType(); List<String> getAttributes(); @Override String toString(); static CompositeKey pars... |
@Test public void run() { final LocalDate now = LocalDate.now(); when(dateTimeProvider.getCurrentDate()).thenReturn(now); subject.run(); verify(accessControlListDao, times(1)).removePermanentBlocksBefore(argThat(new BaseMatcher<LocalDate>() { @Override public boolean matches(Object item) { return item.equals(now.minusY... | @Override @Scheduled(cron = "0 0 0 * * *") @SchedulerLock(name = "AutomaticPermanentBlocksCleanup") public void run() { final LocalDate eventRemoveDate = dateTimeProvider.getCurrentDate().minusMonths(3); LOGGER.debug("Removing block events before {}", eventRemoveDate); accessControlListDao.removeBlockEventsBefore(event... | AutomaticPermanentBlocksCleanup implements DailyScheduledTask { @Override @Scheduled(cron = "0 0 0 * * *") @SchedulerLock(name = "AutomaticPermanentBlocksCleanup") public void run() { final LocalDate eventRemoveDate = dateTimeProvider.getCurrentDate().minusMonths(3); LOGGER.debug("Removing block events before {}", even... | AutomaticPermanentBlocksCleanup implements DailyScheduledTask { @Override @Scheduled(cron = "0 0 0 * * *") @SchedulerLock(name = "AutomaticPermanentBlocksCleanup") public void run() { final LocalDate eventRemoveDate = dateTimeProvider.getCurrentDate().minusMonths(3); LOGGER.debug("Removing block events before {}", even... | AutomaticPermanentBlocksCleanup implements DailyScheduledTask { @Override @Scheduled(cron = "0 0 0 * * *") @SchedulerLock(name = "AutomaticPermanentBlocksCleanup") public void run() { final LocalDate eventRemoveDate = dateTimeProvider.getCurrentDate().minusMonths(3); LOGGER.debug("Removing block events before {}", even... | AutomaticPermanentBlocksCleanup implements DailyScheduledTask { @Override @Scheduled(cron = "0 0 0 * * *") @SchedulerLock(name = "AutomaticPermanentBlocksCleanup") public void run() { final LocalDate eventRemoveDate = dateTimeProvider.getCurrentDate().minusMonths(3); LOGGER.debug("Removing block events before {}", even... |
@Test public void translate_to_uuid_username_not_stored_in_context() { final RpslObject object = RpslObject.parse("mntner: TEST-MNT\nauth: SSO username@test.net"); when(updateContext.getSsoTranslationResult("username@test.net")).thenReturn("BBBB-1234-CCCC-DDDD"); final RpslObject result = subject.translateFromCacheAuth... | public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } } | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } @Autowired SsoTranslator(final CrowdClient crowdClient); } | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } @Autowired SsoTranslator(final CrowdClient crowdClient); void populateCacheAuthToUsername(final UpdateContext updateContext, final... | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } @Autowired SsoTranslator(final CrowdClient crowdClient); void populateCacheAuthToUsername(final UpdateContext updateContext, final... |
@Test public void translate_to_username_uuid_stored_in_context_already() { final RpslObject object = RpslObject.parse("mntner: TEST-MNT\nauth: SSO aadd-2132-aaa-fff"); when(updateContext.getSsoTranslationResult("aadd-2132-aaa-fff")).thenReturn("username@test.net"); final RpslObject result = subject.translateFromCacheAu... | public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } } | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } @Autowired SsoTranslator(final CrowdClient crowdClient); } | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } @Autowired SsoTranslator(final CrowdClient crowdClient); void populateCacheAuthToUsername(final UpdateContext updateContext, final... | SsoTranslator { public RpslObject translateFromCacheAuthToUuid(final UpdateContext updateContext, final RpslObject rpslObject) { return translateAuthFromCache(updateContext, rpslObject); } @Autowired SsoTranslator(final CrowdClient crowdClient); void populateCacheAuthToUsername(final UpdateContext updateContext, final... |
@Test public void populate_not_maintainer_object() { final RpslObject object = RpslObject.parse("aut-num: AS1234"); when(update.getSubmittedObject()).thenReturn(object); subject.populateCacheAuthToUuid(updateContext, update); verifyZeroInteractions(updateContext); } | public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, final String authTok... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... |
@Test public void populate_no_sso_auth() { final RpslObject object = RpslObject.parse("mntner: TEST-MNT\nauth: MD5-PW aaff1232431"); when(update.getSubmittedObject()).thenReturn(object); subject.populateCacheAuthToUuid(updateContext, update); verifyZeroInteractions(updateContext); } | public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, final String authTok... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... |
@Test public void populate_sso_auth() { final RpslObject object = RpslObject.parse("mntner: TEST-MNT\nauth: SSO user@test.net"); when(update.getSubmittedObject()).thenReturn(object); when(updateContext.hasSsoTranslationResult("user@test.net")).thenReturn(true); subject.populateCacheAuthToUuid(updateContext, update); ve... | public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, final String authTok... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... | SsoTranslator { public void populateCacheAuthToUuid(final UpdateContext updateContext, final Update update) { final RpslObject submittedObject = update.getSubmittedObject(); SsoHelper.translateAuth(submittedObject, new AuthTranslator() { @Override @CheckForNull public RpslAttribute translate(final String authType, fina... |
@Test public void filter_mnt_routes_from_autnum() { final RpslObject autnum = RpslObject.parse( "aut-num: AS3333\n" + "as-name: TEST-AS\n" + "org: ORG-TEST1-TEST\n" + " # Transit:\n" + "import: from AS3333 action pref=700; accept ANY # preserve \n" + "export: to AS3333 announce AS3333:AS-TEST # formatting \n" + "admin-... | public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject; } updateContext.addMessage(update, UpdateMessages.mntR... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... |
@Test public void no_mnt_routes_in_autnum() { final RpslObject autnum = RpslObject.parse( "aut-num: AS3333\n" + "as-name: TEST-AS\n" + "org: ORG-TEST1-TEST\n" + " # Transit:\n" + "import: from AS3333 action pref=700; accept ANY\n" + "export: to AS3333 announce AS3333:AS-TEST\n" + "admin-c: AA1-TEST\n" + "tech-c: AA1-TE... | public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject; } updateContext.addMessage(update, UpdateMessages.mntR... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... |
@Test public void dont_filter_mnt_routes_from_inetnum() { final RpslObject inetnum = RpslObject.parse( "inetnum: 192.0.0.0 - 192.255.255.255\n" + "netname: TEST-NET-NAME\n" + "descr: TEST network\n" + "country: NL\n" + "org: ORG-LIR1-TEST\n" + "admin-c: TP1-TEST\n" + "tech-c: TP1-TEST\n" + "status: ALLOCATED UNSPECIFIE... | public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject; } updateContext.addMessage(update, UpdateMessages.mntR... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... | MntRoutesAttributeTransformer implements Transformer { public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { if ((rpslObject.getType() != ObjectType.AUT_NUM) || !rpslObject.containsAttribute(AttributeType.MNT_ROUTES)) { return rpslObject;... |
@Test public void dont_transform_no_short_format_attributes() { final RpslObject mntner = RpslObject.parse( "mntner: MINE-MNT\n" + "admin-c: AA1-TEST\n" + "auth: MD5-PW $1$/7f2XnzQ$p5ddbI7SXq4z4yNrObFS/0 # emptypassword\n" + "mnt-by: MINE-MNT\n" + "source: TEST\n"); final RpslObject updatedObject = subject.transform(mn... | @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute> iterator = builder.getAttributes().listIterato... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... |
@Test public void transform_short_format_attributes() { final RpslObject mntner = RpslObject.parse( "mntner: MINE-MNT\n" + "admin-c: AA1-TEST\n" + "auth: MD5-PW $1$/7f2XnzQ$p5ddbI7SXq4z4yNrObFS/0 # emptypassword\n" + "mb: MINE-MNT # mb\n" + "*mb: MINE-MNT # star mb\n" + "mnt-by: MINE-MNT\n" + "source: TEST\n"); final R... | @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute> iterator = builder.getAttributes().listIterato... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... | ShortFormatTransformer implements Transformer { @Override public RpslObject transform(final RpslObject rpslObject, final Update update, final UpdateContext updateContext, final Action action) { final RpslObjectBuilder builder = new RpslObjectBuilder(rpslObject); boolean updated = false; final ListIterator<RpslAttribute... |
@Test public void transform_inetnum_prefix() { final RpslObject rpslObject = RpslObject.parse("inetnum: 193/8"); final RpslObject result = attributeSanitizer.sanitize(rpslObject, objectMessages); assertThat(result.getValueForAttribute(AttributeType.INETNUM).toString(), is("193.0.0.0 - 193.255.255.255")); verify(objectM... | public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null; final Sanitizer sani... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... |
@Test public void getException() { final String response = subject.createExceptionResponse(updateContext, origin); assertThat(response, containsString("" + "> From: Andre Kampert <cac37ak@ripe.net>\n" + "> Subject: delete route 194.39.132.0/24\n" + "> Date: Thu, 14 Jun 2012 10:04:42 +0200\n" + "> Reply-To: cac37ak@ripe... | public String createExceptionResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_EXCEPTION, updateContext, velocityContext, origin); } | ResponseFactory { public String createExceptionResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_EXCEPTION, updateContext, velocityContext, origin); } } | ResponseFactory { public String createExceptionResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_EXCEPTION, updateContext, velocityContext, origin); } @Autowired ResponseFactory(
final DateTimeProvide... | ResponseFactory { public String createExceptionResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_EXCEPTION, updateContext, velocityContext, origin); } @Autowired ResponseFactory(
final DateTimeProvide... | ResponseFactory { public String createExceptionResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_EXCEPTION, updateContext, velocityContext, origin); } @Autowired ResponseFactory(
final DateTimeProvide... |
@Test public void getAck_no_errors() { final RpslObject rpslObject = RpslObject.parse("mntner: DEV-ROOT-MNT"); updateResults.add(new UpdateResult(rpslObject, rpslObject, Action.DELETE, UpdateStatus.SUCCESS, new ObjectMessages(), 0, false)); final Ack ack = new Ack(updateResults, ignoredParagraphs); final String respons... | public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContext, velocityContext... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... |
@Test public void getAck_skipped_paragraphs() { final Paragraph paragraph1 = new Paragraph("paragraph 1"); final Paragraph paragraph2 = new Paragraph("paragraph 2"); ignoredParagraphs.add(paragraph1); ignoredParagraphs.add(paragraph2); final Ack ack = new Ack(updateResults, ignoredParagraphs); final String response = s... | public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContext, velocityContext... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... |
@Test public void getAck_errors() { final String rpslObjectString = "" + "route: 194.39.132.0/24\n" + "descr: Description\n" + "origin: AS1\n" + "notify: notify@test.com\n" + "mnt-by: TEST-MNT\n" + "source: RIPE\n" + "delete: no longer required\n"; final RpslObject rpslObject = RpslObject.parse(rpslObjectString); final... | public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContext, velocityContext... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... | ResponseFactory { public String createAckResponse(final UpdateContext updateContext, final Origin origin, final Ack ack) { final VelocityContext velocityContext = new VelocityContext(); velocityContext.put("ack", ack); velocityContext.put("updateContext", updateContext); return createResponse(TEMPLATE_ACK, updateContex... |
@Test public void createHelpResponse() { final String response = subject.createHelpResponse(updateContext, origin); assertThat(response, containsString("" + "> From: Andre Kampert <cac37ak@ripe.net>\n" + "> Subject: delete route 194.39.132.0/24\n" + "> Date: Thu, 14 Jun 2012 10:04:42 +0200\n" + "> Reply-To: cac37ak@rip... | public String createHelpResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_HELP, updateContext, velocityContext, origin); } | ResponseFactory { public String createHelpResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_HELP, updateContext, velocityContext, origin); } } | ResponseFactory { public String createHelpResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_HELP, updateContext, velocityContext, origin); } @Autowired ResponseFactory(
final DateTimeProvider dateTime... | ResponseFactory { public String createHelpResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_HELP, updateContext, velocityContext, origin); } @Autowired ResponseFactory(
final DateTimeProvider dateTime... | ResponseFactory { public String createHelpResponse(final UpdateContext updateContext, final Origin origin) { final VelocityContext velocityContext = new VelocityContext(); return createResponse(TEMPLATE_HELP, updateContext, velocityContext, origin); } @Autowired ResponseFactory(
final DateTimeProvider dateTime... |
@Test public void notification_success() { final RpslObject object1 = RpslObject.parse("mntner: DEV-ROOT1-MNT"); final Update update1 = new Update(new Paragraph(object1.toString()), Operation.UNSPECIFIED, Lists.<String>newArrayList(), object1); final PreparedUpdate create1 = new PreparedUpdate(update1, null, object1, A... | public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new VelocityContext(); velo... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... |
@Test public void notification_success_with_user_in_the_session() { when(updateContext.getUserSession()).thenReturn(new UserSession("test@ripe.net", "Test User", true,"2033-01-30T16:38:27.369+11:00")); final RpslObject object1 = RpslObject.parse("mntner: DEV-ROOT1-MNT"); final Update update1 = new Update(new Paragraph(... | public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new VelocityContext(); velo... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... |
@Test public void notification_success_with_effective_sso_credentials() { when(updateContext.getUserSession()).thenReturn(new UserSession("test@ripe.net", "Test User", true,"2033-01-30T16:38:27.369+11:00")); final RpslObject object1 = RpslObject.parse("mntner: DEV-ROOT1-MNT"); final Update update1 = new Update(new Para... | public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new VelocityContext(); velo... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... |
@Test public void notification_success_with_effective_pgp_credentials() { final RpslObject object1 = RpslObject.parse("mntner: DEV-ROOT1-MNT"); final Update update1 = new Update(new Paragraph(object1.toString()), Operation.UNSPECIFIED, Lists.<String>newArrayList(), object1); final PreparedUpdate create1 = new PreparedU... | public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new VelocityContext(); velo... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... |
@Test public void notification_success_filter_auth() { final RpslObject object = RpslObject.parse("" + "mntner: DEV-MNT\n" + "auth: MD5-PW $1$YmPozTxJ$s3eGZRVrKVGdSDTeEZJu "source: RIPE" ); final Update update = new Update(new Paragraph(object.toString()), Operation.UNSPECIFIED, Lists.<String>newArrayList(), object); f... | public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new VelocityContext(); velo... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... |
@Test public void transform_inetnum_prefix_with_comment() { final RpslObject rpslObject = RpslObject.parse("inetnum: 193/8 # Comment"); final RpslObject result = attributeSanitizer.sanitize(rpslObject, objectMessages); assertThat(result.toString(), is("inetnum: 193.0.0.0 - 193.255.255.255 # Comment\n")); verify(objectM... | public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null; final Sanitizer sani... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... |
@Test public void notification_success_reference() { final RpslObject object1 = RpslObject.parse("mntner: DEV-ROOT1-MNT"); final Update update1 = new Update(new Paragraph(object1.toString()), Operation.UNSPECIFIED, Lists.<String>newArrayList(), object1); final PreparedUpdate create1 = new PreparedUpdate(update1, null, ... | public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new VelocityContext(); velo... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... |
@Test public void notification_auth_failed() { final RpslObject object1 = RpslObject.parse("mntner: DEV-ROOT1-MNT"); final Update update1 = new Update(new Paragraph(object1.toString()), Operation.UNSPECIFIED, Lists.<String>newArrayList(), object1); final PreparedUpdate create1 = new PreparedUpdate(update1, null, object... | public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new VelocityContext(); velo... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... | ResponseFactory { public ResponseMessage createNotification(final UpdateContext updateContext, final Origin origin, final Notification notification) { final String ssoUserEmail = updateContext.getUserSession() != null ? updateContext.getUserSession().getUsername() : ""; final VelocityContext velocityContext = new Veloc... |
@Test public void testGetActions() { assertThat(subject.getActions(), containsInAnyOrder(Action.DELETE)); } | @Override public ImmutableList<Action> getActions() { return ACTIONS; } | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } } | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired SetNotReferencedValidator(final RpslObjectDao objectDao); } | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired SetNotReferencedValidator(final RpslObjectDao objectDao); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Acti... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired SetNotReferencedValidator(final RpslObjectDao objectDao); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Acti... |
@Test public void testGetTypes() { assertThat(subject.getTypes(), containsInAnyOrder(ObjectType.AS_SET, ObjectType.ROUTE_SET, ObjectType.RTR_SET)); } | @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } } | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired SetNotReferencedValidator(final RpslObjectDao objectDao); } | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired SetNotReferencedValidator(final RpslObjectDao objectDao); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Acti... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired SetNotReferencedValidator(final RpslObjectDao objectDao); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Acti... |
@Test public void set_that_has_incoming_references() { final RpslObject routeSet = RpslObject.parse("route-set: rs-AH"); when(update.getUpdatedObject()).thenReturn(routeSet); when(objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(ObjectType.ROUTE_SET, "rs-AH")).thenReturn(Lists.newArrayList(new RpslObjectInfo(1, Objec... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(updatedObject.getType(), updatedObject.getKey().toString()); if ... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... |
@Test public void set_that_has_no_incoming_references() { final RpslObject asSet = RpslObject.parse("as-set: AS1325:AS-lopp"); when(update.getUpdatedObject()).thenReturn(asSet); when(objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(ObjectType.AS_SET, "rs-AH")).thenReturn(Lists.<RpslObjectInfo>newArrayList()); subject... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(updatedObject.getType(), updatedObject.getKey().toString()); if ... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... | SetNotReferencedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final List<RpslObjectInfo> incomingReferences = objectDao.findMemberOfByObjectTypeWithoutMbrsByRef(upd... |
@Test public void testGetActions() { assertThat(subject.getActions(), containsInAnyOrder(Action.CREATE, Action.MODIFY)); } | @Override public ImmutableList<Action> getActions() { return ACTIONS; } | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } } | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } PeeringSetAttributeMustBePresent(); } | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } PeeringSetAttributeMustBePresent(); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } PeeringSetAttributeMustBePresent(); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override... |
@Test public void testGetTypes() { assertThat(subject.getTypes(), Matchers.contains(ObjectType.PEERING_SET, ObjectType.FILTER_SET)); } | @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } } | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } PeeringSetAttributeMustBePresent(); } | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } PeeringSetAttributeMustBePresent(); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } PeeringSetAttributeMustBePresent(); @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override... |
@Test public void mpPeering_and_peering_present() { when(update.getType()).thenReturn(ObjectType.PEERING_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("peering-set: prng-ripe\ndescr: description\npeering: AS6845 at 194.102.255.254\nmp-peering: AS702:PRNG-AT-CUSTOMER")); subject.validate(update, upda... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void mpPeering_nor_peering_present() { when(update.getType()).thenReturn(ObjectType.PEERING_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("peering-set: prng-ripe\ndescr: description")); subject.validate(update, updateContext); verify(updateContext).addMessage(update, UpdateMessages.neit... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void transform_inet6num_no_change() { final RpslObject rpslObject = RpslObject.parse("inet6num: 2001:67c:20c4::/48"); final RpslObject result = attributeSanitizer.sanitize(rpslObject, objectMessages); assertThat(result.getValueForAttribute(AttributeType.INET6NUM).toString(), is("2001:67c:20c4::/48")); veri... | public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null; final Sanitizer sani... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... |
@Test public void only_mpPeering_present() { when(update.getType()).thenReturn(ObjectType.PEERING_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("peering-set: prng-ripe\ndescr: description\nmp-peering: AS702:PRNG-AT-CUSTOMER")); subject.validate(update, updateContext); verify(updateContext, never()).... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void only_peering_present() { when(update.getType()).thenReturn(ObjectType.PEERING_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("peering-set: prng-ripe\ndescr: description\npeering: AS6845 at 194.102.255.254")); subject.validate(update, updateContext); verify(updateContext, never()).ad... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void filter_and_mpFilter_present() { when(update.getType()).thenReturn(ObjectType.FILTER_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("filter-set: prng-ripe\ndescr: description\nfilter: AS6845 at 194.102.255.254\nmp-filter: AS702:PRNG-AT-CUSTOMER")); subject.validate(update, updateCont... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void mpFilter_nor_filter_present() { when(update.getType()).thenReturn(ObjectType.FILTER_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("filter-set: prng-ripe\ndescr: description")); subject.validate(update, updateContext); verify(updateContext).addMessage(update, UpdateMessages.neitherS... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void only_mpFilter_present() { when(update.getType()).thenReturn(ObjectType.FILTER_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("filter-set: prng-ripe\ndescr: description\nmp-filter: AS702:PRNG-AT-CUSTOMER")); subject.validate(update, updateContext); verify(updateContext, never()).addM... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void only_filter_present() { when(update.getType()).thenReturn(ObjectType.FILTER_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("filter-set: prng-ripe\ndescr: description\nfilter: AS6845 at 194.102.255.254")); subject.validate(update, updateContext); verify(updateContext, never()).addMes... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attributeMap.get(objectType); final AttributeType simpleAttribute = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... | PeeringSetAttributeMustBePresent implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); final ObjectType objectType = update.getType(); final List<AttributeType> attributeTypes = attr... |
@Test public void getActions() { assertThat(subject.getActions(), containsInAnyOrder(Action.CREATE)); } | @Override public ImmutableList<Action> getActions() { return ACTIONS; } | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } } | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired SetnameMustExistValidator(final RpslObjectDao objectDao,
final AuthenticationModule authenticationModule); } | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired SetnameMustExistValidator(final RpslObjectDao objectDao,
final AuthenticationModule authenticationModule); @Override void validate(final P... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired SetnameMustExistValidator(final RpslObjectDao objectDao,
final AuthenticationModule authenticationModule); @Override void validate(final P... |
@Test public void getTypes() { assertThat(subject.getTypes(), containsInAnyOrder(ObjectType.AS_SET, ObjectType.FILTER_SET, ObjectType.PEERING_SET, ObjectType.ROUTE_SET, ObjectType.RTR_SET)); } | @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } } | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired SetnameMustExistValidator(final RpslObjectDao objectDao,
final AuthenticationModule authenticationModule); } | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired SetnameMustExistValidator(final RpslObjectDao objectDao,
final AuthenticationModule authenticationModule); @Override void validate(final P... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired SetnameMustExistValidator(final RpslObjectDao objectDao,
final AuthenticationModule authenticationModule); @Override void validate(final P... |
@Test public void validate_missing_parent() { when(update.getType()).thenReturn(ObjectType.FILTER_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("filter-set: FLTR-RIPE:FLTR-ALLOCBNDR:FLTR-IPV6:fltr-something")); when(objectDao.getByKeys(eq(ObjectType.FILTER_SET), anyCollection())).thenReturn(Lists.<R... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void validate_no_hiearchy() { when(update.getType()).thenReturn(ObjectType.FILTER_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("filter-set: FLTR-ND")); subject.validate(update, updateContext); verify(updateContext).getSubject(any(UpdateContainer.class)); verifyNoMoreInteractions(update... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void transform_inet6num_leading_zeroes() { final RpslObject rpslObject = RpslObject.parse("inet6num: 2001:067c:20c4::/48"); final RpslObject result = attributeSanitizer.sanitize(rpslObject, objectMessages); assertThat(result.getValueForAttribute(AttributeType.INET6NUM).toString(), is("2001:67c:20c4::/48"))... | public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null; final Sanitizer sani... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... |
@Test public void validate_autnum_lookup_does_not_exist() { when(update.getType()).thenReturn(ObjectType.AS_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("as-set: AS101:AS-TEST")); when(objectDao.getByKeys(eq(ObjectType.AUT_NUM), anyCollection())).thenReturn(Lists.<RpslObject>newArrayList()); subjec... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void validate_autnum_lookup_does_not_exist_with_override() { when(updateSubject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)).thenReturn(true); when(update.getType()).thenReturn(ObjectType.AS_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("as-set: AS101:AS-TEST")); subject.validate(update... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void validate_autnum_lookup_exists_but_is_not_authenticated() { when(update.getType()).thenReturn(ObjectType.AS_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("as-set: AS101:AS-TEST")); when(objectDao.getByKeys(eq(ObjectType.AUT_NUM), anyCollection())).thenReturn(Lists.<RpslObject>newArr... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void validate_autnum_lookup_exists_and_is_authenticated() { when(update.getType()).thenReturn(ObjectType.AS_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("as-set: AS101:AS-TEST")); when(objectDao.getByKeys(eq(ObjectType.AUT_NUM), anyCollection())).thenReturn(Lists.<RpslObject>newArrayLi... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void validate_routeset_against_autnum() { when(update.getType()).thenReturn(ObjectType.ROUTE_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("route-set: As101:RS-ROUTESET")); when(objectDao.getByKeys(eq(ObjectType.AUT_NUM), anyCollection())).thenReturn(Lists.<RpslObject>newArrayList(RpslO... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void validate_routeset_against_parent() { when(update.getType()).thenReturn(ObjectType.ROUTE_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("route-set: RS-PARENT:RS-CHILD")); when(objectDao.getByKeys(eq(ObjectType.ROUTE_SET), anyCollection())).thenReturn(Lists.<RpslObject>newArrayList(Rp... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void validate_routeset_against_parent_not_authenticated() { when(update.getType()).thenReturn(ObjectType.ROUTE_SET); when(update.getUpdatedObject()).thenReturn(RpslObject.parse("route-set: RS-PARENT:RS-CHILD")); when(objectDao.getByKeys(eq(ObjectType.ROUTE_SET), anyCollection())).thenReturn(Lists.<RpslObje... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getCleanValue().toString(); final int lastColon = key.lastIndexOf... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... | SetnameMustExistValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { if (updateContext.getSubject(update).hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final String key = update.getUpdatedObject().getTypeAttribute().getC... |
@Test public void getActions() { assertThat(subject.getActions().size(), is(2)); assertThat(subject.getActions().contains(Action.MODIFY), is(true)); assertThat(subject.getActions().contains(Action.CREATE), is(true)); } | @Override public ImmutableList<Action> getActions() { return ACTIONS; } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override ImmutableList<ObjectType> getTypes(); } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override ImmutableList<ObjectType> getTypes(); } |
@Test public void getTypes() { assertThat(subject.getTypes().size(), is(1)); assertThat(subject.getTypes().get(0), is(ObjectType.ORGANISATION)); } | @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override ImmutableList<ObjectType> getTypes(); } | OrganisationTypeValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Override void validate(final PreparedUpdate update, final UpdateContext updateContext); @Override ImmutableList<Action> getActions(); @Override ImmutableList<ObjectType> getTypes(); } |
@Test public void update_is_override() { when(authenticationSubject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)).thenReturn(true); subject.validate(update, updateContext); verify(updateContext).getSubject(any(UpdateContainer.class)); verifyNoMoreInteractions(update); verifyNoMoreInteractions(updateContext); } | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribute = update.getUpdatedObject().findAttribute(AttributeType.ORG... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... |
@Test public void transform_inet6num_uppercase() { final RpslObject rpslObject = RpslObject.parse("inet6num: 2001:67C:20C4::/48"); final RpslObject result = attributeSanitizer.sanitize(rpslObject, objectMessages); assertThat(result.getValueForAttribute(AttributeType.INET6NUM).toString(), is("2001:67c:20c4::/48")); veri... | public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null; final Sanitizer sani... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... |
@Test public void status_other() { when(update.getUpdatedObject()).thenReturn(RpslObject.parse("organisation: ORG-TST-RIPE\norg-type: other")); when(updateContext.getSubject(update)).thenReturn(authenticationSubject); subject.validate(update, updateContext); verify(updateContext, never()).addMessage(Matchers.<Update>an... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribute = update.getUpdatedObject().findAttribute(AttributeType.ORG... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... |
@Test public void orgtype_has_not_changed() { when(update.getUpdatedObject()).thenReturn(RpslObject.parse("organisation: ORG-TST-RIPE\norg-type: RIR")); when(updateContext.getSubject(update)).thenReturn(authenticationSubject); when(update.getReferenceObject()).thenReturn(RpslObject.parse("organisation: ORG-TST-RIPE\nor... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribute = update.getUpdatedObject().findAttribute(AttributeType.ORG... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... |
@Test public void not_auth_by_powermntner() { final RpslObject rpslObject = RpslObject.parse("organisation: ORG-TST-RIPE\norg-type: RIR"); when(update.getUpdatedObject()).thenReturn(rpslObject); when(updateContext.getSubject(update)).thenReturn(authenticationSubject); when(update.getReferenceObject()).thenReturn(RpslOb... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribute = update.getUpdatedObject().findAttribute(AttributeType.ORG... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... |
@Test public void orgtype_has_changed_auth_by_powermntner() { when(update.getUpdatedObject()).thenReturn(RpslObject.parse("organisation: ORG-TST-RIPE\norg-type: RIR")); when(updateContext.getSubject(update)).thenReturn(authenticationSubject); when(update.getReferenceObject()).thenReturn(RpslObject.parse("organisation: ... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribute = update.getUpdatedObject().findAttribute(AttributeType.ORG... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... | OrganisationTypeValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final Subject subject = updateContext.getSubject(update); if (subject.hasPrincipal(Principal.OVERRIDE_MAINTAINER)) { return; } final RpslAttribute orgTypeAttribut... |
@Test public void getActions() { assertThat(subject.getActions(), contains(Action.MODIFY)); } | @Override public ImmutableList<Action> getActions() { return ACTIONS; } | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } } | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired OrgNameNotChangedValidator(final RpslObjectUpdateDao objectUpdateDao, final RpslObjectDao objectDao, final Maintainers maintainers); } | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired OrgNameNotChangedValidator(final RpslObjectUpdateDao objectUpdateDao, final RpslObjectDao objectDao, final Maintainers maintainers); @Override void validate(final PreparedUpd... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<Action> getActions() { return ACTIONS; } @Autowired OrgNameNotChangedValidator(final RpslObjectUpdateDao objectUpdateDao, final RpslObjectDao objectDao, final Maintainers maintainers); @Override void validate(final PreparedUpd... |
@Test public void getTypes() { assertThat(subject.getTypes(), contains(ObjectType.ORGANISATION)); } | @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } } | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired OrgNameNotChangedValidator(final RpslObjectUpdateDao objectUpdateDao, final RpslObjectDao objectDao, final Maintainers maintainers); } | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired OrgNameNotChangedValidator(final RpslObjectUpdateDao objectUpdateDao, final RpslObjectDao objectDao, final Maintainers maintainers); @Override void validate(final PreparedUpd... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public ImmutableList<ObjectType> getTypes() { return TYPES; } @Autowired OrgNameNotChangedValidator(final RpslObjectUpdateDao objectUpdateDao, final RpslObjectDao objectDao, final Maintainers maintainers); @Override void validate(final PreparedUpd... |
@Test public void orgname_not_changed() { when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_SAME_NAME); subject.validate(update, updateContext); verify(updateContext, never()).addMessage(Matchers.<Update>anyObject(), Matchers.<Message>anyObject()); verify... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_not_referenced_at_all() { when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); when(updateDao.getReferences(ORIGINAL_ORG)).thenReturn(Collections.EMPTY_SET); subject.validate(update, updateContext); verify(updateC... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_for_lir() { presetOverrideAuthentication(); when(update.getReferenceObject()).thenReturn(ORIGINAL_LIR); when(update.getUpdatedObject()).thenReturn(UPDATED_LIR); presetReferrers(REFERRER_MNT_BY_RS, REFERRER_MNT_BY_LEGACY); subject.validate(update, updateContext); verify(updateContext, n... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_not_referenced_by_resource() { when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); when(updateDao.getReferences(ORIGINAL_ORG)).thenReturn(Sets.newHashSet(new RpslObjectInfo(5, ObjectType.PERSON, "TEST-NIC"))); su... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void transform_inet6num_trailing_zero() { final RpslObject rpslObject = RpslObject.parse("inet6num: 2001:67c:20c4::0/48"); final RpslObject result = attributeSanitizer.sanitize(rpslObject, objectMessages); assertThat(result.getValueForAttribute(AttributeType.INET6NUM).toString(), is("2001:67c:20c4::/48"));... | public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null; final Sanitizer sani... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... |
@Test public void orgname_changed_referenced_by_resource_without_RSmntner__no_RSmntner_auth() { when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); presetReferrers(REFERRER_MNT_BY_USER); subject.validate(update, updateContext); verify(updateConte... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_RSmntner__no_RSmntner_auth() { when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); when(maintainers.isRsMaintainer(Sets.newHashSet(CIString.ciString("RIPE-NCC-HM-MNT")))).thenReturn(tr... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_LEGACY_mntner__no_LEGACY_mntner_auth() { when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); when(maintainers.isRsMaintainer(Sets.newHashSet(CIString.ciString("RIPE-NCC-LEGACY-MNT"))))... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_RS_and_LEGACY_mntner__no_LEGACY_mntner_auth() { presetOverrideAuthentication(); when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); presetReferrers(REFERRER_MNT_BY_RS, REFERRER_MNT_BY_... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_RSmntner__RSmaintainer_auth() { presetOverrideAuthentication(); when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); presetReferrers(REFERRER_MNT_BY_RS); subject.validate(update, update... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_LEGACY_mntner__LEGACY_maintainer_auth() { presetRsAuthentication(); when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); presetReferrers(REFERRER_MNT_BY_LEGACY); subject.validate(update... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_RSmntner__auth_by_override() { presetOverrideAuthentication(); when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); presetReferrers(REFERRER_MNT_BY_RS); subject.validate(update, updateC... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_LEGACY_mntner__auth_by_override() { presetOverrideAuthentication(); when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); presetReferrers(REFERRER_MNT_BY_LEGACY); subject.validate(update... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_RS_and_LEGACY_mntner__auth_by_override() { presetOverrideAuthentication(); when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_NEW_NAME); presetReferrers(REFERRER_MNT_BY_RS, REFERRER_MNT_BY_LEGAC... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void orgname_changed_referenced_by_resource_with_RSmntner_change_is_case_sensitive() { when(update.getReferenceObject()).thenReturn(ORIGINAL_ORG); when(update.getUpdatedObject()).thenReturn(UPDATED_ORG_CASE_CHANGE); when(maintainers.isRsMaintainer(Sets.newHashSet(CIString.ciString("RIPE-NCC-HM-MNT")))).the... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; } if (orgNameDidntChange(originalObject, updatedObject)) { retu... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... | OrgNameNotChangedValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject originalObject = update.getReferenceObject(); final RpslObject updatedObject = update.getUpdatedObject(); if (isLir(originalObject)) { return; }... |
@Test public void transform_inet6num_prefix_with_comment() { final RpslObject rpslObject = RpslObject.parse("inet6num: 2001:67c:20c4::0/48 # Comment"); final RpslObject result = attributeSanitizer.sanitize(rpslObject, objectMessages); assertThat(result.toString(), is("inet6num: 2001:67c:20c4::/48 # Comment\n")); verify... | public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null; final Sanitizer sani... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... | AttributeSanitizer { public RpslObject sanitize(final RpslObject object, final ObjectMessages objectMessages) { final Map<RpslAttribute, RpslAttribute> replacements = Maps.newHashMap(); for (final RpslAttribute attribute : object.getAttributes()) { final AttributeType type = attribute.getType(); String newValue = null;... |
@Test public void has_no_abusec() { when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITHOUT_ABUSE_C); subject.validate(update, updateContext); verifyZeroInteractions(updateContext); } | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void references_role_without_abuse_mailbox() { when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITH_ABUSE_C); when(objectDao.getByKey(eq(ObjectType.ROLE), eq(CIString.ciString("AB-NIC")))).thenReturn(ROLE_WITHOUT_ABUSE_MAILBOX); subject.validate(update, updateContext); verify(updateContext).addMessage... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void references_role_with_abuse_mailbox() { when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITH_ABUSE_C); when(objectDao.getByKey(eq(ObjectType.ROLE), eq(CIString.ciString("AB-NIC")))).thenReturn(ROLE_WITH_ABUSE_MAILBOX); subject.validate(update, updateContext); verifyZeroInteractions(updateContext);... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void references_person_instead_of_role() { when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITH_ABUSE_C); when(objectDao.getByKey(eq(ObjectType.ROLE), eq(CIString.ciString("AB-NIC")))).thenThrow(new EmptyResultDataAccessException(1)); when(objectDao.getByKey(eq(ObjectType.PERSON), eq(CIString.ciString... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void reference_not_found() { when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITH_ABUSE_C); when(objectDao.getByKey(eq(ObjectType.ROLE), eq(CIString.ciString("AB-NIC")))).thenThrow(new EmptyResultDataAccessException(1)); when(objectDao.getByKey(eq(ObjectType.PERSON), eq(CIString.ciString("AB-NIC")))).... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void remove_abuse_contact_LIR_org() { when(update.getReferenceObject()).thenReturn(LIR_ORG_WITH_ABUSE_C); when(update.getUpdatedObject()).thenReturn(LIR_ORG_WITHOUT_ABUSE_C); subject.validate(update, updateContext); verify(updateContext).addMessage(update, UpdateMessages.abuseContactNotRemovable()); verify... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void allow_remove_abuse_contact_when_non_LIR_no_referencing_objects() { when(update.getReferenceObject()).thenReturn(OTHER_ORG_WITH_ABUSE_C); when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITHOUT_ABUSE_C); when(updateDao.getReferences(update.getUpdatedObject())).thenReturn(Collections.EMPTY_SET); su... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void allow_remove_abusec_when_referencing_object_is_not_resource() { final RpslObject referencingPerson = RpslObject.parse( "person: A Person\n" + "address: Address 1\n" + "phone: +31 20 535 4444\n" + "nic-hdl: DUMY-RIPE\n" + "org: ORG-1\n" + "mnt-by: A_NON_RS_MAINTAINER\n" + "source: RIPE"); final RpslObj... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void allow_remove_abuse_contact_when_referencing_resources_is_not_rs_maintained() { final RpslObjectInfo info = new RpslObjectInfo(1, ObjectType.AUT_NUM, "AS6"); when(update.getReferenceObject()).thenReturn(OTHER_ORG_WITH_ABUSE_C); when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITHOUT_ABUSE_C); when... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
@Test public void do_not_allow_remove_abuse_contact_when_a_referencing_resource_is_rs_maintained() { final RpslObjectInfo info = new RpslObjectInfo(1, ObjectType.AUT_NUM, "AS6"); when(update.getReferenceObject()).thenReturn(OTHER_ORG_WITH_ABUSE_C); when(update.getUpdatedObject()).thenReturn(OTHER_ORG_WITHOUT_ABUSE_C); ... | @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemoved(updatedObject, update, updateContext); } | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... | AbuseValidator implements BusinessRuleValidator { @Override public void validate(final PreparedUpdate update, final UpdateContext updateContext) { final RpslObject updatedObject = update.getUpdatedObject(); if (updatedObject == null) { return; } validateAbuseC(updatedObject, update, updateContext); validateAbuseCRemove... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.