use of org.neo4j.token.api.NamedToken in project neo4j by neo4j.
the class TokenRegistryTest method putAllMustNotThrowWhenInternalTokenDuplicatesNameOfPublicToken.
@Test
void putAllMustNotThrowWhenInternalTokenDuplicatesNameOfPublicToken() {
registry.put(new NamedToken(INBOUND1_TYPE, 1));
registry.putAll(singletonList(new NamedToken(INBOUND1_TYPE, 2, true)));
}
use of org.neo4j.token.api.NamedToken in project neo4j by neo4j.
the class TokenRegistryTest method getIdInternalMustFindInternalTokens.
@Test
void getIdInternalMustFindInternalTokens() {
registry.put(new NamedToken(INBOUND1_TYPE, 1, true));
assertThat(registry.getIdInternal(INBOUND1_TYPE)).isEqualTo(1);
}
use of org.neo4j.token.api.NamedToken in project neo4j by neo4j.
the class TokenRegistryTest method allTokensMustIncludePublicTokensButNotIncludeInternalTokens.
@Test
void allTokensMustIncludePublicTokensButNotIncludeInternalTokens() {
registry.putAll(asList(new NamedToken(INBOUND1_TYPE, 1), new NamedToken(INBOUND1_TYPE, 2, true), new NamedToken(INBOUND2_TYPE, 3), new NamedToken(INBOUND2_TYPE, 4, true)));
Collection<NamedToken> tokens = registry.allTokens();
assertThat(tokens).contains(new NamedToken(INBOUND1_TYPE, 1), new NamedToken(INBOUND2_TYPE, 3));
}
use of org.neo4j.token.api.NamedToken in project neo4j by neo4j.
the class TokenRegistryTest method getIdInternalMustNotFindPublicTokens.
@Test
void getIdInternalMustNotFindPublicTokens() {
registry.put(new NamedToken(INBOUND1_TYPE, 1));
assertThat(registry.getIdInternal(INBOUND1_TYPE)).isNull();
}
use of org.neo4j.token.api.NamedToken in project neo4j by neo4j.
the class TokenRegistryTest method getIdMustNotFindInternalTokens.
@Test
void getIdMustNotFindInternalTokens() {
registry.put(new NamedToken(INBOUND1_TYPE, 1, true));
assertThat(registry.getId(INBOUND1_TYPE)).isNull();
}
Aggregations