@Test public void testGetProviderInternal_ScimServerExceptionThrownWhenNoProvider() throws ScimServerException { @SuppressWarnings("rawtypes") BaseResourceTypeResourceImpl baseResourceImpl = Mockito.mock(BaseResourceTypeResourceImpl.class); when(baseResourceImpl.getProviderInternal()).thenCallRealMethod(); assertThrows(ScimServerException.class, () -> baseResourceImpl.getProviderInternal()); }
Provider<T> getProviderInternal() throws ScimServerException { Provider<T> provider = getProvider(); if (provider == null) { throw new ScimServerException(Status.INTERNAL_SERVER_ERROR, "Provider not defined"); } return provider; }
BaseResourceTypeResourceImpl implements BaseResourceTypeResource<T> { Provider<T> getProviderInternal() throws ScimServerException { Provider<T> provider = getProvider(); if (provider == null) { throw new ScimServerException(Status.INTERNAL_SERVER_ERROR, "Provider not defined"); } return provider; } }
BaseResourceTypeResourceImpl implements BaseResourceTypeResource<T> { Provider<T> getProviderInternal() throws ScimServerException { Provider<T> provider = getProvider(); if (provider == null) { throw new ScimServerException(Status.INTERNAL_SERVER_ERROR, "Provider not defined"); } return provider; }  }
BaseResourceTypeResourceImpl implements BaseResourceTypeResource<T> { Provider<T> getProviderInternal() throws ScimServerException { Provider<T> provider = getProvider(); if (provider == null) { throw new ScimServerException(Status.INTERNAL_SERVER_ERROR, "Provider not defined"); } return provider; }  abstract Provider<T> getProvider(); @Override Response getById(String id, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response query(AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes, FilterWrapper filter, AttributeReference sortBy, SortOrder sortOrder, Integer startIndex, Integer count); @Override Response create(T resource, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response find(SearchRequest request); @Override Response update(T resource, String id, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response patch(PatchRequest patchRequest, String id, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response delete(String id); static Response createGenericExceptionResponse(Throwable e1, Status status); }
BaseResourceTypeResourceImpl implements BaseResourceTypeResource<T> { Provider<T> getProviderInternal() throws ScimServerException { Provider<T> provider = getProvider(); if (provider == null) { throw new ScimServerException(Status.INTERNAL_SERVER_ERROR, "Provider not defined"); } return provider; }  abstract Provider<T> getProvider(); @Override Response getById(String id, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response query(AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes, FilterWrapper filter, AttributeReference sortBy, SortOrder sortOrder, Integer startIndex, Integer count); @Override Response create(T resource, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response find(SearchRequest request); @Override Response update(T resource, String id, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response patch(PatchRequest patchRequest, String id, AttributeReferenceListWrapper attributes, AttributeReferenceListWrapper excludedAttributes); @Override Response delete(String id); static Response createGenericExceptionResponse(Throwable e1, Status status);  }