Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Delete useless Mocked methods - MEED-1580 - Meeds-io/meeds#1428 #447

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public IdentityManagerMock() {
}
}

@Override
public Identity getOrCreateIdentity(String providerId, String remoteId, boolean isProfileLoaded) {
return identities.stream()
.filter(identity -> StringUtils.equals(identity.getProviderId(), providerId)
Expand All @@ -63,85 +62,69 @@ public Identity getOrCreateIdentity(String providerId, String remoteId, boolean
.orElse(null);
}

@Override
public Identity getIdentity(String identityId, boolean isProfileLoaded) {
return identities.stream()
.filter(identity -> StringUtils.equals(identity.getId(), identityId))
.findFirst()
.orElse(null);
}

@Override
public void registerIdentityProviders(IdentityProviderPlugin plugin) {
// NOOP
}

@Override
public void addProfileListener(ProfileListenerPlugin plugin) {
// NOOP
}

@Override
public Identity getIdentity(String providerId, String remoteId, boolean loadProfile) {
return getOrCreateIdentity(providerId, remoteId, loadProfile);
}

@Override
public boolean identityExisted(String providerId, String remoteId) {
return getOrCreateIdentity(providerId, remoteId, true) != null;
}

@Override
public Identity getIdentity(String id) {
return getIdentity(id, true);
}

@Override
public Identity getOrCreateIdentity(String providerId, String remoteId) {
return getOrCreateIdentity(providerId, remoteId, true);
}

@Override
public Identity updateIdentity(Identity identity) {
return identity;
}

@Override
public List<Identity> getLastIdentities(int limit) {
throw new UnsupportedOperationException();
}

@Override
public void deleteIdentity(Identity identity) {
throw new UnsupportedOperationException();
}

@Override
public void hardDeleteIdentity(Identity identity) {
throw new UnsupportedOperationException();
}

@Override
public ListAccess<Identity> getConnectionsWithListAccess(Identity identity) {
throw new UnsupportedOperationException();
}

@Override
public Profile getProfile(Identity identity) {
return identity.getProfile();
}

@Override
public InputStream getAvatarInputStream(Identity identity) throws IOException {
throw new UnsupportedOperationException();
}

@Override
public InputStream getBannerInputStream(Identity identity) throws IOException {
throw new UnsupportedOperationException();
}

@Override
public void updateProfile(Profile specificProfile) {
List<Profile.UpdateType> list = new ArrayList<>();
if (specificProfile.getProperty(Profile.FIRST_NAME) != null || specificProfile.getProperty(Profile.POSITION) != null ) {
Expand All @@ -155,163 +138,93 @@ public void updateProfile(Profile specificProfile) {
}
}

@Override
public ListAccess<Identity> getIdentitiesByProfileFilter(String providerId,
ProfileFilter profileFilter,
boolean isProfileLoaded) {
throw new UnsupportedOperationException();
}

@Override
public ListAccess<Identity> getIdentitiesForUnifiedSearch(String providerId, ProfileFilter profileFilter) {
throw new UnsupportedOperationException();
}

@Override
public ListAccess<Identity> getSpaceIdentityByProfileFilter(Space space,
ProfileFilter profileFilter,
Type type,
boolean isProfileLoaded) {
throw new UnsupportedOperationException();
}

@Override
public void addIdentityProvider(IdentityProvider<?> identityProvider) {
throw new UnsupportedOperationException();
}

@Override
public void removeIdentityProvider(IdentityProvider<?> identityProvider) {
throw new UnsupportedOperationException();
}

@Override
public void registerProfileListener(ProfileListenerPlugin profileListenerPlugin) {
profileLifeCycle.addListener(profileListenerPlugin);
}

@Override
public void processEnabledIdentity(String remoteId, boolean isEnable) {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentitiesByProfileFilter(String providerId, ProfileFilter profileFilter) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentitiesByProfileFilter(String providerId,
ProfileFilter profileFilter,
long offset,
long limit) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentitiesByProfileFilter(ProfileFilter profileFilter) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentitiesByProfileFilter(ProfileFilter profileFilter, long offset, long limit) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentitiesFilterByAlphaBet(String providerId, ProfileFilter profileFilter) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentitiesFilterByAlphaBet(String providerId,
ProfileFilter profileFilter,
long offset,
long limit) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentitiesFilterByAlphaBet(ProfileFilter profileFilter) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public long getIdentitiesCount(String providerId) {
throw new UnsupportedOperationException();
}

@Override
public void saveIdentity(Identity identity) {
throw new UnsupportedOperationException();
}

@Override
public void saveProfile(Profile profile) {
throw new UnsupportedOperationException();
}

@Override
public void addOrModifyProfileProperties(Profile profile) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public void updateAvatar(Profile p) {
throw new UnsupportedOperationException();
}

@Override
public void updateBasicInfo(Profile p) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public void updateContactSection(Profile p) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public void updateExperienceSection(Profile p) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public void updateHeaderSection(Profile p) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentities(String providerId) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getIdentities(String providerId, boolean loadProfile) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public List<Identity> getConnections(Identity ownerIdentity) throws Exception {
throw new UnsupportedOperationException();
}

@Override
public IdentityStorage getIdentityStorage() {
throw new UnsupportedOperationException();
}

@Override
public IdentityStorage getStorage() {
throw new UnsupportedOperationException();
}

@Override
public void registerProfileListener(ProfileListener listener) {
throw new UnsupportedOperationException();
}

@Override
public void unregisterProfileListener(ProfileListener listener) {
throw new UnsupportedOperationException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,6 @@ public Space getSpaceByName(String spaceName) throws SpaceException {

}

public List<Space> getSpacesByFirstCharacterOfName(String firstCharacterOfName) throws SpaceException {
throw new UnsupportedOperationException();

}

public List<Space> getSpacesBySearchCondition(String condition) throws Exception {
throw new UnsupportedOperationException();

Expand Down Expand Up @@ -573,16 +568,4 @@ public boolean isSuperManager(String userId) {
return false;
}

public List<MembershipEntry> getSuperManagersMemberships() {
throw new UnsupportedOperationException();
}

public void addSuperManagersMembership(String permissionExpression) {
throw new UnsupportedOperationException();
}

public void removeSuperManagersMembership(String permissionExpression) {
throw new UnsupportedOperationException();
}

}