@Override public EndpointProfileSchemaDto findProfileSchemaByAppIdAndVersion( String appId, int schemaVersion) { validateId(appId, "Can't find profile schema. Invalid application id: " + appId); return getDto(profileSchemaDao.findByAppIdAndVersion(appId, schemaVersion)); }
@Test public void findByAppIdAndVersion() { List<EndpointProfileSchema> schemas = generateProfSchema(null, 4); Assert.assertEquals(4, schemas.size()); EndpointProfileSchema schema = schemas.get(2); Application app = schema.getApplication(); EndpointProfileSchema found = profileSchemaDao.findByAppIdAndVersion(app.getId().toString(), schema.getVersion()); Assert.assertNotNull(found); Assert.assertEquals(3, found.getVersion()); }