Skip to content

Instantly share code, notes, and snippets.

View dschulten's full-sized avatar

Dietrich Schulten dschulten

View GitHub Profile
@dschulten
dschulten / gist:5696110
Last active December 18, 2015 00:19
Possible HAL equivalent to forms
// HAL "form" for single-item-resource. Clients must query OPTIONS for /account
// to ensure they can PUT, POST, DELETE, GET. The profile attribute contains a json-schema
// which can also be requested in other media types from /rels/account.
{
"userName": "Fred",
"realName": "Fred Flintstone",
"password": "yabbadabba",
"_links": {
"self": {
@dschulten
dschulten / ChoosePlanetSteps.java
Created July 25, 2013 16:55
Demo code that shows how to use Robotium RC with the Spinner sample app from the SDK and JBehave. It was necessary to create a RobotiumRC class with separate setup and teardown routines, e.g. to be called from a JUnit setup/teardown or from JBehave @BeforeStories and @AfterStories routines.
package com.example.robotiumrc;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import org.jbehave.core.annotations.AfterStory;
import org.jbehave.core.annotations.BeforeStory;
import org.jbehave.core.annotations.Given;
import org.jbehave.core.annotations.Then;
@dschulten
dschulten / event-api-entrypoint.jsonld
Created September 21, 2014 15:18
Entrypoint for an event API
{
"@context": {
"@vocab" : "http://schema.org",
"hydra" : "http://www.w3.org/ns/hydra/core#"
},
"@id": "http://www.markus-lanthaler.com/hydra/event-api/",
"@type": "hydra:EntryPoint",
"event": {
"@id": "http://www.markus-lanthaler.com/hydra/event-api/events/",
"@type": "hydra:Link"
@dschulten
dschulten / events.jsonld
Created September 21, 2014 15:21
Event list with POST operation
{
"@context": {
"@vocab": "http://schema.org",
"hydra": "http://www.w3.org/ns/hydra/core#"
},
"@id": "http://www.markus-lanthaler.com/hydra/event-api/events/",
"@type": "hydra:Collection",
"hydra:member": [
{
"@id": "http://www.markus-lanthaler.com/hydra/event-api/events/1",
@dschulten
dschulten / event.jsonld
Last active August 29, 2015 14:06
Editable event
{
"@context": {
"@vocab": "http://schema.org",
"hydra": "http://www.w3.org/ns/hydra/core#"
},
"@id": "http://www.markus-lanthaler.com/hydra/event-api/events/1",
"@type": "Event",
"name": "Walk off the Earth - REVO tour",
"description": "Live in concert",
"startDate": "2014-06-14T20:00:00Z",
@dschulten
dschulten / README.md
Last active November 4, 2015 07:27 — forked from anonymous/README.md
JSON-LD Playground: custom attributes
@dschulten
dschulten / uber-events.json
Created May 6, 2016 09:50
Sample uber response with nested model data
{
"uber": {
"data": [
{
"rel": [
"self"
],
"url": "http://localhost:8080/webapp/hypermedia-api/events",
"action": "APPEND",
"model": "performer={performer}&workPerformed.name={workPerformed.name}&location={location}&eventStatus={eventStatus}"
@dschulten
dschulten / JSONObjectBuilders.java
Last active January 24, 2022 11:31
JsonNodeBuilders
package de.escalon.builders.json;
import net.minidev.json.JSONArray;
import net.minidev.json.JSONObject;
import java.io.Serializable;
/**
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
@SpringIntegrationTest
@ActiveProfiles("local")
@AutoConfigureMockMvc
@TestPropertySource(properties = {
"my.setting=watchamacallit"
})
public class ApplicationTest {
@dschulten
dschulten / DmnConfig.java
Last active December 23, 2018 14:31
Activate Feel Scala Plugin for Camunda Dmn
@Configuration
public class DmnConfig {
/**
* Creates DMN engine with feel-scala engine as default language.
*
* @return engine
* @see <a href="https://github.com/camunda/camunda-engine-dmn">Simple Engine Setup</a>
* @see <a href="https://github.com/camunda/feel-scala/tree/master/feel-engine#how-to-use-it">Using full FEEL language in Camunda DMN</a>
*/