Package org.sonatype.nexus.capability

Examples of org.sonatype.nexus.capability.CapabilityDescriptor.convert()


    final Map<String, String> newProps = Maps.newHashMap();
    oldProps.put("p1", "v1-converted");
    oldProps.put("p3", "v3");

    when(descriptor.convert(oldProps, 0)).thenReturn(newProps);

    underTest.load();

    verify(capabilityStorage).getAll();
    verify(descriptor, atLeastOnce()).version();
View Full Code Here


    final CapabilityDescriptor descriptor = mock(CapabilityDescriptor.class);
    when(capabilityDescriptorRegistry.get(CAPABILITY_TYPE)).thenReturn(descriptor);
    when(descriptor.version()).thenReturn(1);

    when(descriptor.convert(oldProps, 0)).thenThrow(new RuntimeException("expected"));

    underTest.load();

    verify(capabilityStorage).getAll();
    verify(descriptor, atLeastOnce()).version();
View Full Code Here

        log.debug(
            "Converting capability '{}' properties from version '{}' to version '{}'",
            id, item.getVersion(), descriptor.version()
        );
        try {
          properties = descriptor.convert(properties, item.getVersion());
          if (properties == null) {
            properties = Collections.emptyMap();
          }
          if (log.isDebugEnabled()) {
            log.debug(
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.