Skip to content

Commit

Permalink
Fix updated API
Browse files Browse the repository at this point in the history
  • Loading branch information
ericvergnaud committed Aug 30, 2021
1 parent e6b6c11 commit bb60156
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ public void flush() throws PromptoError {
readers.put(Family.DATETIME, (o)->o instanceof Document ? PromptoDateTime.parse(((Document)o).getString("text")) : null);
readers.put(Family.BLOB, MongoStore::binaryToPromptoBinary);
readers.put(Family.IMAGE, MongoStore::binaryToPromptoBinary);
readers.put(Family.VERSION, (o)->PromptoVersion.parse((int)o));
readers.put(Family.VERSION, (o)->PromptoVersion.parseInt((int)o));
}

static Object binaryToPromptoBinary(Object o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public Class<PromptoVersion> getEncoderClass() {

@Override
public PromptoVersion decode(BsonReader reader, DecoderContext decoderContext) {
return PromptoVersion.parse(reader.readInt32());
return PromptoVersion.parseInt(reader.readInt32());
}

@Override
Expand Down
14 changes: 7 additions & 7 deletions Server/src/test/java/prompto/code/TestCodeStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public void fetchesDeclarationsWithAnnotationsFromMemStore() throws Exception {
Mode.set(Mode.UNITTEST);
ICodeStore codeStore = Standalone.bootstrapCodeStore(new MemStore(), newRuntimeConfig(null));
DeclarationList read = parseEResource("prompto/graphQLMethods.pec");
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parse(1), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parse(2), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parse(1), "Other");
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parseInt(1), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parseInt(2), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parseInt(1), "Other");
Context context = Context.newGlobalsContext();
Iterable<IDeclaration> decls = context.getRegisteredDeclarationsWithAnnotations("@GraphQLQuery", "@GraphQLMutation");
Set<String> names = StreamSupport.stream(decls.spliterator(), false).map(IDeclaration::getName).collect(Collectors.toSet());
Expand All @@ -75,9 +75,9 @@ public void fetchesDeclarationsWithAnnotationsFromMongoStore() throws Exception
Mode.set(Mode.UNITTEST);
ICodeStore codeStore = Standalone.bootstrapCodeStore(store, newRuntimeConfig(null));
DeclarationList read = parseEResource("prompto/graphQLMethods.pec");
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parse(1), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parse(2), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parse(1), "Other");
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parseInt(1), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parseInt(2), null);
codeStore.storeDeclarations(read, Dialect.E, PromptoVersion.parseInt(1), "Other");
Context context = Context.newGlobalsContext();
Iterable<IDeclaration> decls = context.getRegisteredDeclarationsWithAnnotations("@GraphQLQuery", "@GraphQLMutation");
Set<String> names = StreamSupport.stream(decls.spliterator(), false).map(IDeclaration::getName).collect(Collectors.toSet());
Expand All @@ -100,7 +100,7 @@ private IRuntimeConfiguration newRuntimeConfig(String testResourcePath) {
runtimeLibs.add(Thread.currentThread().getContextClassLoader().getResource(testResourcePath));
return new IRuntimeConfiguration.Inline()
.withApplicationName("TestCodeStore")
.withApplicationVersion(PromptoVersion.parse(1))
.withApplicationVersion(PromptoVersion.parseInt(1))
.withRuntimeLibs(()->runtimeLibs);
}
}

0 comments on commit bb60156

Please sign in to comment.