profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/graemerocher/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Graeme Rocher graemerocher @Oraclelabs http://micronaut.io Creator of Grails (http://grails.org) and Micronaut (http://micronaut.io) frameworks. Architect at Oracle

graalvm/native-build-tools 89

Native-image plugins for various build tools

dima767/grails-internals-handbook 74

A community-driven book describing inner workings of the Grails framework

graemerocher/framework-comparison-2020 41

Compares Frameworks in April 2020

graemerocher/grails-core 8

The Grails Web Application Framework

graemerocher/gorm-61-demo 7

Demos from GORM 6.1 Presentation

graemerocher/gdoc-to-asciidoc 5

Converts Grails' GDoc format to AsciiDoc

graemerocher/gant 2

Gant is a Groovy way of using the Ant tasks -- Ant scripting using Groovy, no XML.

graemerocher/gmongo 2

A Groovy wrapper to the mongodb Java driver

graemerocher/functions-framework-java 1

FaaS (Function as a service) framework for writing portable Java functions

pull request commentmicronaut-projects/micronaut-core

Fix support nullable inputstream / empty publisher for body

I will update the Pr to make it configurable

graemerocher

comment created time in a day

PullRequestReviewEvent

pull request commentmicronaut-projects/micronaut-guides

mongodb reactive

I personally kind of like that they are separate to explain best practise for each

sdelamo

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentmicronaut-projects/micronaut-guides

mongodb reactive

+package example.micronaut;++import io.micronaut.context.ApplicationContext;+import io.micronaut.http.HttpStatus;+import io.micronaut.runtime.server.EmbeddedServer;+import org.junit.jupiter.api.Test;+import static org.junit.jupiter.api.Assertions.assertTrue;+import static org.junit.jupiter.api.Assertions.assertNull;+import static org.junit.jupiter.api.Assertions.assertFalse;+import static org.junit.jupiter.api.Assertions.assertEquals;+import java.util.Collections;+import java.util.List;++public class FruitControllerTest {

Does it make sense to share this template with the synchronous guide since they should be the same

sdelamo

comment created time in 2 days

Pull request review commentmicronaut-projects/micronaut-guides

Mongo sync guide

+package example.micronaut;++import io.micronaut.context.ApplicationContext;+import io.micronaut.core.type.Argument;+import io.micronaut.http.HttpRequest;+import io.micronaut.http.HttpResponse;+import io.micronaut.http.HttpStatus;+import io.micronaut.http.client.BlockingHttpClient;+import io.micronaut.http.client.HttpClient;+import io.micronaut.runtime.server.EmbeddedServer;+import org.junit.jupiter.api.Test;+import org.testcontainers.containers.MongoDBContainer;+import org.testcontainers.utility.DockerImageName;+import static org.junit.jupiter.api.Assertions.assertTrue;+import static org.junit.jupiter.api.Assertions.assertNull;+import static org.junit.jupiter.api.Assertions.assertFalse;+import static org.junit.jupiter.api.Assertions.assertEquals;++import java.util.Collections;+import java.util.List;++public class FruitControllerTest {++    @Test+    void fruitsEndpointInteractsWithMongo() {+        MongoDBContainer mongoDBContainer = new MongoDBContainer(DockerImageName.parse("mongo:4.0.10"))+                .withExposedPorts(27017);+        mongoDBContainer.start();++        EmbeddedServer embeddedServer = ApplicationContext.run(EmbeddedServer.class, Collections.singletonMap("mongodb.uri", mongoDBContainer.getReplicaSetUrl()));+        HttpClient httpClient = embeddedServer.getApplicationContext().createBean(HttpClient.class, embeddedServer.getURL());+        BlockingHttpClient client = httpClient.toBlocking();

I pushed simplifications showing how to do this. With JUnit 5 you have to use @TestInstance(TestInstance.Lifecycle.PER_CLASS)

See https://micronaut-projects.github.io/micronaut-test/latest/guide/index.html#junit5

sdelamo

comment created time in 2 days

PullRequestReviewEvent

push eventmicronaut-projects/micronaut-guides

graemerocher

commit sha 7a97a7fc41ea7e8acdbaed8de2d9a4ae51b2afb5

simplify test

view details

push time in 2 days

push eventmicronaut-projects/micronaut-core

graemerocher

commit sha a7f265e1bc53b7e6a276560520a406fdeebe6f72

revert unnecessary change

view details

push time in 2 days

create barnchmicronaut-projects/micronaut-core

branch : nullable-stream

created branch time in 2 days

issue commentmicronaut-projects/micronaut-core

Support Cloud Native Buildpacks via Paketo

Thread on the topic https://twitter.com/andreasmanner/status/1438245716330225666?s=21

alvarosanchez

comment created time in 2 days

pull request commentmicronaut-projects/micronaut-core

Replace use of @Overrides with caching

Would love to but I have no idea how to write incremental tests for Gradle 🤔

graemerocher

comment created time in 2 days

Pull request review commentmicronaut-projects/micronaut-guides

Mongo sync guide

+package example.micronaut;++import com.mongodb.client.MongoClient;+import com.mongodb.client.MongoCollection;+import com.mongodb.client.MongoCursor;+import io.micronaut.core.annotation.NonNull;+import jakarta.inject.Singleton;+import org.bson.Document;+import javax.validation.Valid;+import javax.validation.constraints.NotNull;+import java.util.ArrayList;+import java.util.List;+import java.util.Optional;++@Singleton // <1>+public class MongoDbFruitRepository implements FruitRepository {++    private final MongoDbConfiguration mongoConf;+    private final MongoClient mongoClient;++    public MongoDbFruitRepository(MongoDbConfiguration mongoConf,  // <2>+                                  MongoClient mongoClient) {  // <3>+        this.mongoConf = mongoConf;+        this.mongoClient = mongoClient;+    }++    @Override+    public void save(@NonNull @NotNull @Valid Fruit fruit){+        getCollection().insertOne(fruitToDocument(fruit));+    }++    @Override+    @NonNull+    public List<Fruit> list() {+        List<Fruit> list = new ArrayList<>();+        try (MongoCursor<Document> cursor = getCollection().find().iterator()) {+            while (cursor.hasNext()) {+                documentToFruit(cursor.next()).ifPresent(list::add);+            }+        }

In that case you are better of using the into method. Change in FruitService

    public Iterable<Fruit> list() {
        return getCollection().find();
    }

to

    public Iterable<Fruit> list() {
       List<Fruit> list = new ArrayList():
       getCollection().find().into(list);
       return list;
    }
sdelamo

comment created time in 2 days

PullRequestReviewEvent

Pull request review commentmicronaut-projects/micronaut-guides

Mongo sync guide

+package example.micronaut;++import com.mongodb.client.MongoClient;+import com.mongodb.client.MongoCollection;+import com.mongodb.client.MongoCursor;+import io.micronaut.core.annotation.NonNull;+import jakarta.inject.Singleton;+import org.bson.Document;+import javax.validation.Valid;+import javax.validation.constraints.NotNull;+import java.util.ArrayList;+import java.util.List;+import java.util.Optional;++@Singleton // <1>+public class MongoDbFruitRepository implements FruitRepository {++    private final MongoDbConfiguration mongoConf;+    private final MongoClient mongoClient;++    public MongoDbFruitRepository(MongoDbConfiguration mongoConf,  // <2>+                                  MongoClient mongoClient) {  // <3>+        this.mongoConf = mongoConf;+        this.mongoClient = mongoClient;+    }++    @Override+    public void save(@NonNull @NotNull @Valid Fruit fruit){+        getCollection().insertOne(fruitToDocument(fruit));+    }++    @Override+    @NonNull+    public List<Fruit> list() {+        List<Fruit> list = new ArrayList<>();+        try (MongoCursor<Document> cursor = getCollection().find().iterator()) {+            while (cursor.hasNext()) {+                documentToFruit(cursor.next()).ifPresent(list::add);+            }+        }+        return list;+    }++    @NonNull+    private Optional<Fruit> documentToFruit(@NonNull Document document) {+        try {+            String name = document.getString("name");+            if (name == null) {+                return Optional.empty();+            }+            return Optional.of(new Fruit(name, document.getString("description")));+        } catch (ClassCastException e) {+            return Optional.empty();+        }+    }

You can but you need to annotate the constructor with BsonCreator. See https://mongodb.github.io/mongo-java-driver/3.5/bson/pojos/ and "Supporting POJOs without no args constructors"

sdelamo

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventmicronaut-projects/micronaut-core

graemerocher

commit sha c3b82571400ae41f7f2f18ee71af851cc677f556

Optimize with loop

view details

push time in 2 days

create barnchmicronaut-projects/micronaut-core

branch : issue-6158

created branch time in 2 days

push eventmicronaut-projects/micronaut-jaxrs

graemerocher

commit sha a911434118dc3ea6a4385a6b7ae002ee00860223

Fix incremental compilation

view details

push time in 2 days

push eventmicronaut-projects/micronaut-jaxrs

graemerocher

commit sha d5b3511c9904795d5dc6a914a0c83809b400dade

Add missing classes from PR

view details

push time in 2 days

push eventmicronaut-projects/micronaut-jaxrs

graemerocher

commit sha b5e8c7f1acdd2a010515ac0f05e351e4d023c177

support with context annotation

view details

push time in 2 days

create barnchmicronaut-projects/micronaut-jaxrs

branch : security-context

created branch time in 2 days

delete branch micronaut-projects/micronaut-data

delete branch : localtime

delete time in 3 days

push eventmicronaut-projects/micronaut-data

Denis Stepanov

commit sha a7bca26b85fded924f602f59a5c98a2ecec6433e

Add localtime converters (#1170)

view details

push time in 3 days

PR merged micronaut-projects/micronaut-data

Reviewers
Add localtime converters

Storing local time with the current date part. https://github.com/micronaut-projects/micronaut-data/discussions/1168

+24 -1

0 comment

2 changed files

dstepanov

pr closed time in 3 days