use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class InstancePermissionImplificationTest method testMultipleAccessesPermit.
@Test
public void testMultipleAccessesPermit() {
// Test different Instances
Permission pStored = DatasetPermission.onInstance(EnumSet.of(Ability.READ, Ability.DOWNLOAD), new DatasetId(DATASET1));
Permission pRequested = DatasetPermission.onInstance(Ability.READ.asSet(), new DatasetId(DATASET1));
assert pStored.implies(pRequested);
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class IdTests method testEquals.
@Test
public void testEquals() {
ConceptTreeChildId idA = new ConceptTreeChildId(new ConceptTreeChildId(new ConceptId(new DatasetId("1"), "2"), "3"), "4");
ConceptTreeChildId idB = new ConceptTreeChildId(new ConceptTreeChildId(new ConceptId(new DatasetId("1"), "2"), "3"), "4");
assertThat(idA).isEqualTo(idB);
assertThat(idA).hasSameHashCodeAs(idB);
assertThat(idA.toString()).isEqualTo(idB.toString());
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class IdTests method testJacksonBinarySerialization.
@Test
public void testJacksonBinarySerialization() throws JsonParseException, JsonMappingException, JsonProcessingException, IOException {
ConceptTreeChildId id = new ConceptTreeChildId(new ConceptTreeChildId(new ConceptId(new DatasetId("1"), "2"), "3"), "4");
ObjectMapper mapper = Jackson.BINARY_MAPPER;
ConceptTreeChildId copy = mapper.readValue(mapper.writeValueAsBytes(id), ConceptTreeChildId.class);
assertThat(copy).isEqualTo(id);
assertThat(copy).hasSameHashCodeAs(id);
assertThat(copy.toString()).isEqualTo(id.toString());
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class SerializationTests method group.
@Test
public void group() throws IOException, JSONException {
Group group = new Group("group", "group", STORAGE);
group.addPermission(DatasetPermission.onInstance(Ability.READ, new DatasetId("test")));
group.addPermission(ExecutionPermission.onInstance(Ability.READ, new ManagedExecutionId(new DatasetId("dataset"), UUID.randomUUID())));
group.addRole(new Role("company", "company", STORAGE));
Role role = new Role("company", "company", STORAGE);
group.addRole(role);
User user = new User("userName", "userLabel", STORAGE);
group.addMember(user);
CentralRegistry registry = new CentralRegistry();
registry.register(role);
registry.register(user);
SerializationTestUtil.forType(Group.class).injectables(STORAGE).registry(registry).test(group);
}
use of com.bakdata.conquery.models.identifiable.ids.specific.DatasetId in project conquery by bakdata.
the class SerializationTests method executionCreationResolveError.
@Test
public void executionCreationResolveError() throws JSONException, IOException {
ConqueryError error = new ConqueryError.ExecutionCreationResolveError(new DatasetId("test"));
SerializationTestUtil.forType(ConqueryError.class).test(error);
}
Aggregations