MetaJobRunnable implements JobRunnable { public final Instant getMetaAsInstant(final String key) { checkKey(key); return getMetaAsInstant(key, null); } protected  MetaJobRunnable(final String jobType,
                              final JobMetaRepository metaRepository); final String getJobType(); final void deleteMeta(final String key); final void setMeta(final String key, final String value); final void setMeta(final String key, final int value); final void setMeta(final String key, final Integer value); final void setMeta(final String key, final long value); final void setMeta(final String key, final Long value); final void setMeta(final String key, final Instant value); final String getMetaAsString(final String key); final String getMetaAsString(final String key, final String defaultValue); int getMetaAsInt(final String key, final int defaultValue); final long getMetaAsLong(final String key, final long defaultValue); final Instant getMetaAsInstant(final String key); final Instant getMetaAsInstant(final String key, final Instant defaultValue);  }
@Test public void shouldGetJobMetaAsInstant() { when(metaRepository.getValue("someJob", "key")).thenReturn("42"); final Instant value = testee.getMetaAsInstant("key"); assertThat(value.toEpochMilli(), is(42L)); }