@Override public SchemaEntry lookupById(String id) { return delegate.lookupById(id); }
@Override public SchemaEntry lookupById(String id) { return delegate.lookupById(id); }
/** * Look up a schema by subject + id pair. * * @param subject * the name of the subject * @param id * the id of the schema * @return A 200 response with the schema as the body, or a 404 response if * the subject or schema is not found */ @GET @Path("{subject}/id/{id}") public String schemaFromId(@HeaderParam("Accept") String mediaType, @PathParam("subject") String subject, @PathParam("id") String id) { return getRenderer(mediaType).renderSchemaEntry(exists(getSubject(subject).lookupById(id)), false); }
/** * Look up a schema by subject + id pair. * * @param subject * the name of the subject * @param id * the id of the schema * @return A 200 response with the schema as the body, or a 404 response if * the subject or schema is not found */ @GET @Path("{subject}/id/{id}") public String schemaFromId(@HeaderParam("Accept") String mediaType, @PathParam("subject") String subject, @PathParam("id") String id) { return getRenderer(mediaType).renderSchemaEntry(exists(getSubject(subject).lookupById(id)), false); }
latest = null; } else { latest = exists(s.lookupById(latestId));
latest = null; } else { latest = exists(s.lookupById(latestId));
Subject subject = repo.lookup(convertSubject.toString(subjectName)); if (subject != null) { SchemaEntry schemaEntry = subject.lookupById(convertId.toString(id)); if (schemaEntry != null) { schema = convertSchema.fromString(schemaEntry.getSchema());
Subject subject = repo.lookup(convertSubject.toString(subjectName)); if (subject != null) { SchemaEntry schemaEntry = subject.lookupById(convertId.toString(id)); if (schemaEntry != null) { schema = convertSchema.fromString(schemaEntry.getSchema());
Assert.assertNotNull(s1); SchemaEntry schemaEntry1ById = s1.lookupById("0"); Assert.assertNotNull(schemaEntry1ById); Assert.assertEquals(multiLineSchema1, schemaEntry1ById.getSchema()); Assert.assertEquals(multiLineSchema1, schemaEntry1BySchema.getSchema()); SchemaEntry schemaEntry2ById = s1.lookupById("1"); Assert.assertNotNull(schemaEntry2ById); Assert.assertEquals(multiLineSchema2, schemaEntry2ById.getSchema());
Assert.assertNull("non existent schema should return null", notThere); SchemaEntry resultfooid = subject.lookupById(foo.getId()); Assert.assertEquals("lookup by ID did not return same result", foo, resultfooid); SchemaEntry notTherById = subject.lookupById("notThere"); Assert.assertNull("non existent schema should return null", notTherById);