@Test public void testResolverSnapshotResolver$resolveSnapshot$happyPath() throws Exception { final URI base = URI.create("http: final String path="resource/path/"; final ResourceId resourceId = ResourceId.createId(NamingScheme.getDefault().name("name"),"template"); new Expectations() {{ snapshot.name();result=resourceId.name(); snapshot.templateId();result=resourceId.templateId(); engine.unwrap(DefaultApplicationEngine.class);result=engine; engine.activeContext();result=context; context.resolveResource(resourceId);result=endpoint; endpoint.deleted();result=null; endpoint.path();result=path; }}; new MockUp<ApplicationEngine>() { @Mock public ApplicationEngine engine() throws ApplicationEngineException { return engine; } }; CoreRuntimeDelegate sut=new CoreRuntimeDelegate(); ResourceSnapshotResolver resolver = sut.createResourceResolver(base, session); assertThat(resolver.resolve(snapshot),equalTo(base.resolve(path))); }
@Override public ResourceSnapshotResolver createResourceResolver(URI canonicalBase, ReadSession session) { return new DefaultSnapshotResolver(canonicalBase,session); }
CoreRuntimeDelegate extends RuntimeDelegate { @Override public ResourceSnapshotResolver createResourceResolver(URI canonicalBase, ReadSession session) { return new DefaultSnapshotResolver(canonicalBase,session); } }
CoreRuntimeDelegate extends RuntimeDelegate { @Override public ResourceSnapshotResolver createResourceResolver(URI canonicalBase, ReadSession session) { return new DefaultSnapshotResolver(canonicalBase,session); } CoreRuntimeDelegate(); }
CoreRuntimeDelegate extends RuntimeDelegate { @Override public ResourceSnapshotResolver createResourceResolver(URI canonicalBase, ReadSession session) { return new DefaultSnapshotResolver(canonicalBase,session); } CoreRuntimeDelegate(); @Override boolean isOffline(); @Override WriteSession createSession(); @Override ResourceSnapshotResolver createResourceResolver(URI canonicalBase, ReadSession session); @Override void registerShutdownListener(ShutdownListener listener); }
CoreRuntimeDelegate extends RuntimeDelegate { @Override public ResourceSnapshotResolver createResourceResolver(URI canonicalBase, ReadSession session) { return new DefaultSnapshotResolver(canonicalBase,session); } CoreRuntimeDelegate(); @Override boolean isOffline(); @Override WriteSession createSession(); @Override ResourceSnapshotResolver createResourceResolver(URI canonicalBase, ReadSession session); @Override void registerShutdownListener(ShutdownListener listener);  }