-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
111 additions
and
30 deletions.
There are no files selected for viewing
15 changes: 0 additions & 15 deletions
15
src/main/java/net/dancier/dancer/core/DancerRepository.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/net/dancier/dancer/dancers/DancerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package net.dancier.dancer.dancers; | ||
|
||
import net.dancier.dancer.core.model.Dancer; | ||
import net.dancier.dancer.core.model.Gender; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import java.util.UUID; | ||
|
||
public interface DancerRepository extends JpaRepository<Dancer, UUID> { | ||
|
||
Optional<Dancer> findByUserId(UUID userid); | ||
|
||
Boolean existsByDancerName(String dancerName); | ||
|
||
List<Dancer> findFirst500ByGenderAndLongitudeBetweenAndLatitudeBetween( | ||
Gender gender, | ||
double lowerLongitude, | ||
double upperLongitude, | ||
double lowerLatitude, | ||
double upperLatitude | ||
); | ||
|
||
List<Dancer> findFirst500ByLongitudeBetween( | ||
double lowerLongitude, | ||
double upperLongitude | ||
); | ||
|
||
List<Dancer> findFirst500ByGender( | ||
Gender gender | ||
); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/net/dancier/dancer/recommendation/RecommendationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/test/java/net/dancier/dancer/dancers/DancerControllerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package net.dancier.dancer.dancers; | ||
|
||
import net.dancier.dancer.AbstractPostgreSQLEnabledTest; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.security.test.context.support.WithUserDetails; | ||
import org.springframework.test.context.jdbc.Sql; | ||
import org.springframework.test.web.servlet.ResultActions; | ||
import org.springframework.util.MultiValueMap; | ||
|
||
import java.util.UUID; | ||
|
||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | ||
|
||
public class DancerControllerTest extends AbstractPostgreSQLEnabledTest { | ||
|
||
|
||
UUID userId = UUID.fromString("55bbf334-6649-11ed-8f65-5b299f0e161f"); | ||
|
||
@Test | ||
@WithUserDetails("user-with-a-profile@dancier.net") | ||
void getDancersShouldNotReturnOwnProfile() throws Exception { | ||
|
||
ResultActions result = mockMvc | ||
.perform(get("/dancers") | ||
.param("range", "20") | ||
.param("gender", "MALE") | ||
) | ||
.andExpect(status().isOk()); | ||
|
||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/test/java/net/dancier/dancer/recommendation/EndToEndRecommendationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters