KeyedAppState { @NonNull public static KeyedAppStateBuilder builder() { return new AutoValue_KeyedAppState.Builder().setSeverity(SEVERITY_INFO); } KeyedAppState(); @NonNull static KeyedAppStateBuilder builder(); @NonNull abstract String getKey(); @Severity abstract int getSeverity(); @Nullable abstract String getMessage(); @Nullable abstract String getData(); static final int SEVERITY_INFO; static final int SEVERITY_ERROR; static final int MAX_KEY_LENGTH; static final int MAX_MESSAGE_LENGTH; static final int MAX_DATA_LENGTH; }
@Test @SmallTest public void keyIsRequired() { KeyedAppStateBuilder builder = KeyedAppState.builder().setSeverity(SEVERITY_INFO).setMessage(MESSAGE).setData( DATA); try { builder.build(); fail(); } catch (IllegalStateException expected) { } }